However, if you have to ask, Yaws is probably what you want.
-bob
Thanks
Brian
On Nov 6, 8:46 am, "Bob Ippolito" <b...@redivi.com> wrote:
> mochiweb is a minimal and modular set of libraries to build high
> performance application specific HTTP servers. Yaws is a complicated
> web server that is much more difficult to integrate into other
> applications and is not very modular.
>
> However, if you have to ask, Yaws is probably what you want.
>
> -bob
>
The performance is orders of magnitude better than Twisted in my experience.
It supports HTTP 1.1 in that it can parse HTTP 1.1 headers, does
keep-alive correctly, and it gives you functions to write a chunked
response or parse a multipart POST but it doesn't do anything with
regard to caching or files (though it gives you a function that can be
used to serve files).
It hasn't really been tested on the open internet, we use nginx as the
front-end HTTP server which load balances to mochiweb instances on
various machines in the cluster.
-bob
That makes sense.
> The performance is orders of magnitude better than Twisted in my experience.
Wow, that is pretty amazing. It is not like Twisted is super slow.
Do you have any sense of why this is the case?
> It supports HTTP 1.1 in that it can parse HTTP 1.1 headers, does
> keep-alive correctly, and it gives you functions to write a chunked
> response or parse a multipart POST but it doesn't do anything with
> regard to caching or files (though it gives you a function that can be
> used to serve files).
I am looking for something low-level so this is just fine.
Brian
The networking core of Erlang is pretty much all C code, and Twisted
builds like seven layers of abstraction on top of the _socket module?
There's probably a lot less memory mangling with iolist than with
Twisted's buffers... I'm not sure exactly, I didn't care to dig too
deep into the differences. mochiweb (ab)uses undocumented HTTP header
parsing code in the Erlang VM, so that might account for some of it.
I built a prototype with Erlang and it was so much faster than Twisted
that I thought it was broken. Turned out it wasn't, and I haven't
looked back. I also find Erlang code easier to reason about than
Twisted code, and we take advantage of Erlang inter-node messaging and
mnesia, so Python isn't really all that appealing to us any more for
heavy networking tasks (we still use Python for ETL and the web UI).
> > It supports HTTP 1.1 in that it can parse HTTP 1.1 headers, does
> > keep-alive correctly, and it gives you functions to write a chunked
> > response or parse a multipart POST but it doesn't do anything with
> > regard to caching or files (though it gives you a function that can be
> > used to serve files).
>
> I am looking for something low-level so this is just fine.
Then mochiweb is probably appropriate for what you're doing.
-bob