Interested in ErlyWeb, questions...

3 views
Skip to first unread message

bill robertson

unread,
May 1, 2008, 11:25:48 PM5/1/08
to erlyweb
If I can ask a few questions.

How stable is the current API? Is it expected to change much?

How stable is Erlyweb when running? I guess I expect minor issues
that can be worked around since it is new, but are there any larger
problems? What about yaws?

I have noticed that many tutorials are from late 2006. Are these
still valid, or has it changed a lot since then? Can somebody
recommend a good tutorial?

Are there any "live" Erlyweb sites out there today?

If I can ask about yaws too, does it do SSL?

Thanks.

David King

unread,
May 2, 2008, 2:44:46 PM5/2/08
to erl...@googlegroups.com
> How stable is Erlyweb when running? I guess I expect minor issues
> that can be worked around since it is new, but are there any larger
> problems? What about yaws?

I've never seen either crash, but "I've never seen" doesn't mean
"doesn't happen".

> I have noticed that many tutorials are from late 2006. Are these
> still valid, or has it changed a lot since then? Can somebody
> recommend a good tutorial?

They are mostly good, but cut-n-pasting code tends to not work. API
docs are decent, but under-written. The source remains the best way to
find some things. Some day when I get a round tuit, I'll release the
source for wrotit.com, which is (in theory, at least) a reasonably
good example.

> Are there any "live" Erlyweb sites out there today?

beerriot.com. wrotit.com. There may be others.

Dmitrii Dimandt

unread,
May 3, 2008, 4:38:38 AM5/3/08
to erl...@googlegroups.com
>
>> Are there any "live" Erlyweb sites out there today?
>
> beerriot.com. wrotit.com. There may be others.

Yariv's http://vimagi.com/

David Mitchell

unread,
May 4, 2008, 10:43:07 PM5/4/08
to erl...@googlegroups.com
I've managed to crash Erlyweb/Yaws, but only under a colossal load and
in a fairly unusual situation.

I was using Erlyweb to create traffic for a series of mainframe
capacity tests. The broad approach was:
- fill in details on an Erlyweb page of the mainframe transaction and
the data for that transaction
- Erlyweb then constucts an appropriate network packet and sends it to mainframe
- Erlyweb waits for a response from the mainframe and compares the
response with what Erlyweb has calculated it should be
(plus a few small variations on that approach). The whole thing was
driven by HP's LoadRunner tool, which was simulating several hundred
users hitting the Erlyweb interface as fast as they could. As the
workload increased, the responses from the mainframe started to slow
down; eventually I forced the mainframe to timeout after 20 seconds,
but that wasn't the case throughout all of the testing.

Under some pretty extreme loads - around 20,000 open mainframe
connections - I was blowing up Erlyweb/Yaws. As a sanity check, this
was when Erlyweb/Yaws was consuming ~90% of all 4 CPUs on a dedicated
newish Dell server running Ubuntu 7.10 server; there was probably
smoke coming out of the box at the time ;->

On occasion, I was also blowing up CICS on the mainframe (a Z9 series,
so pretty new gear) with workload supplied by this single Erlyweb box
on occasion, so maybe we were getting into some weird sort of
temporal, black-hole type situation where the universe was starting to
fold in on itself ;-> There's nothing like applying extreme workloads
to show up some really strange problems.

Unfortunately, I didn't capture the error message; I was short of
time, this was my first serious use of Erlyweb so I'm not 100%
convinced it wasn't a problem of my own making, OTP was recovering
things properly for me when it broke so I didn't really care that
much, and the workload I was applying was far enough above what was
required that it didn't matter for the purpose of the tests.

For that particular application, we were running at a steady state of
about 500,000 "pages served" from Erlyweb per hour, with peaks of up
to about 2 million pages per hour, for durations of up to 6 hours at a
time. To put it mildly, I was extremely impressed with the robustness
of the architecture; there's no way that any comparable
Apache/WebSphere or IIS/ASP.NET-based solution could have survived
that workload. I'm now moving some of my older C and Java server code
over to Erlang based on the results of this testing; not sure if I'll
be using Erlyweb as part of this migration, but its scalability and
reliability were definitely a big part of my decision to do so.

Regards

Dave Mitchell

2008/5/2 bill robertson <billrob...@gmail.com>:

Yariv Sadan

unread,
May 4, 2008, 11:32:30 PM5/4/08
to erl...@googlegroups.com
On Thu, May 1, 2008 at 8:25 PM, bill robertson
<billrob...@gmail.com> wrote:
>
> If I can ask a few questions.
>
> How stable is the current API? Is it expected to change much?

ErlyWeb is quite stable and I don't have plans for changing it very
much. The only API change I'm considering is to avoid generating so
many aggregate functions in ErlyDB modules (currently, a few per each
function such as sum, avg, etc) but this change would have a backwards
compatibility flag if I implement it. Other than that, I'm always
happy to accept patches for new features or improvements from other
developers.

>
> How stable is Erlyweb when running? I guess I expect minor issues
> that can be worked around since it is new, but are there any larger
> problems? What about yaws?

I've been running Vimagi for weeks now without any issues. I have had
a couple of outages but I think they were due to my VPS provider. I
don't think you should worry about stability with ErlyWeb and Yaws.

>
> I have noticed that many tutorials are from late 2006. Are these
> still valid, or has it changed a lot since then? Can somebody
> recommend a good tutorial?

Yeah, the tutorials are pretty old and outdated. The documentation is
the most recent and valid reference source for ErlyWeb. There's a
nice, new tutorial here:
http://code.google.com/p/erlyweb/wiki/IntroductionTutorial, but it
doesn't cover everything unfortunately. There really needs to be a
sample app that's open source...

>
> Are there any "live" Erlyweb sites out there today?

BeerRiot, Vimagi, the I Play WOW facebook app, wrotit.com (I think it
uses ErlyWeb), maybe some others that I don't know about.

>
> If I can ask about yaws too, does it do SSL?

Yes, it does do SSL.

>
> Thanks.
> >
>

bill robertson

unread,
May 10, 2008, 1:32:26 AM5/10/08
to erlyweb
Thanks to all for the for the responses. It's been a rough week, so I
had not had the chance to get back to this thread.

First though, a quick aside to David. :-) That's pretty robust. You
should see what happens to MQ when you start getting a lot of requests
piled up because the mainframe in the back end begins to slow down.
No fun when the failures start to cascade up the chain...

I have been reading about yaws, and there is one thing that I really
don't quite understand. Please bear with me, because this is an
honest question. What does using Erlyweb buy me over just using
yaws? It seems quite easy to structure code in yaws so it would
follow an mvc architecture. My interest is still high, but I have not
done lots of web development in the past, so I just don't see it. If
anybody could explain what is "better" about Erlyweb, I would
appreciate it.

Also, Yariv, if I may ask you about the mysql driver with your name on
it. IIRC, you added the ability to do prepared statements with the
driver. This is fantastic and great, but I don't see an example of
how to use that feature in the code that I got off of google code.
Can you please post an example here if you don't mind? Or tell me
where to look if I just missed it?

I need to do a relatively quick web project, and I'd like to use
Erlang (which is quite new to me), but I'm on the verge of taking
another path because I'm having difficulty figuring out how to get
access to a reasonable database. Mnesia is nice for what it is, but
makes for a lot of work because I would be forced to code all
constraints in the data access layer of the code. Mysql is always a
good option for something like this, but if I can't use prepared
statements in Erlang, then I'm going to have to use something else,
because I don't want to spend a lot of time writing code to prevent
sql injections attacks.

Thanks!

On May 4, 11:32 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> On Thu, May 1, 2008 at 8:25 PM, bill robertson
>

Yariv Sadan

unread,
May 14, 2008, 2:06:55 AM5/14/08
to erl...@googlegroups.com
On Fri, May 9, 2008 at 10:32 PM, bill robertson
<billrob...@gmail.com> wrote:
>
> Thanks to all for the for the responses. It's been a rough week, so I
> had not had the chance to get back to this thread.
>
> First though, a quick aside to David. :-) That's pretty robust. You
> should see what happens to MQ when you start getting a lot of requests
> piled up because the mainframe in the back end begins to slow down.
> No fun when the failures start to cascade up the chain...
>
> I have been reading about yaws, and there is one thing that I really
> don't quite understand. Please bear with me, because this is an
> honest question. What does using Erlyweb buy me over just using
> yaws? It seems quite easy to structure code in yaws so it would
> follow an mvc architecture. My interest is still high, but I have not
> done lots of web development in the past, so I just don't see it. If
> anybody could explain what is "better" about Erlyweb, I would
> appreciate it.

- ErlyDB. Yaws doesn't provide a database abstraction layer. If you're
only using Mnesia, though, you're probably ok.
- ErlTL. I personally much prefer ErlTL to Yaws pages and ehtml.
- url->controller->view mapping. Sure, you can do it yourself, but
why? It's already done for you in ErlyWeb.
- Component system. This is very useful for code modularity in
non-trivial applications.
- Phased rendering. It's a very neat feature once you start playing with it.

These are the main points for me...

>
> Also, Yariv, if I may ask you about the mysql driver with your name on
> it. IIRC, you added the ability to do prepared statements with the
> driver. This is fantastic and great, but I don't see an example of
> how to use that feature in the code that I got off of google code.
> Can you please post an example here if you don't mind? Or tell me
> where to look if I just missed it?

I did add that feature to the driver... however, I later realized it's
impractical to use it in ErlyDB. The reason is the great number of
potential queries that can be generated for each module, and also that
many of those queries are generated from runtime data, e.g.

person:find({name,'=',"joe"})

This would be translated at runtime into

"select * from person where name='joe'"

It wouldn't be practical to use prepared such statements at compile
time because of the huge number of possibilities. Doing this lazily at
runtime is an option, but it would add the complexity of adding a
prepared statements cache... ultimately, it seemed like a premature
optimization that didn't add enough value to try to solve.

>
> I need to do a relatively quick web project, and I'd like to use
> Erlang (which is quite new to me), but I'm on the verge of taking
> another path because I'm having difficulty figuring out how to get
> access to a reasonable database. Mnesia is nice for what it is, but
> makes for a lot of work because I would be forced to code all
> constraints in the data access layer of the code. Mysql is always a
> good option for something like this, but if I can't use prepared
> statements in Erlang, then I'm going to have to use something else,
> because I don't want to spend a lot of time writing code to prevent
> sql injections attacks.

ErlyDB protects you from SQL injection attacks by automatically
quoting all strings. In fact, unless you tell ErlyWeb to allow unsafe
statements, you wouldn't be able to write code that's vulnerable to
such attacks even if you tried.

Yariv

Reply all
Reply to author
Forward
0 new messages