On Mon, Dec 7, 2015 at 5:27 PM, Christian Grothoff <[email protected]>
wrote:

> [...]
> Well, on Linux C10k is easy these days. We had people using MHD that in
> practice had what you might call the C100k problem, and that was doable
> ;-).
>

Very good! Currently I'm using it only as embedded server providing
invoices from some supermarket checkouts, but I have plan to use MHD on
Linux as webserver instead of NodeJS. :-)

Well, thread-per-connection was never the most scalable option,
> especially if used like this...
>

Yes, you are right, it was just a test hehe.

If you really need to hit MHD with thousands of parallel requests, you
> may want to consider using the thread *pool* (set the thread pool size).


I want to use the more stable and fast Win32 option of MHD. The time of my
requests are very short, because it handles only some strings as JSON or
XML (about 500B ~ 2KB), so I belieave that I can to use select() instead of
thread-pool. But these errors scares me a little, because my app can't fail
in production (the Brazilian laws is terrible, a non sent invoice can
result in a catastrophic penalty :-( ).


> Not necessarily.  Using thread-per-connection will use way more RAM, but
> fewer expensive system calls.  So until you hit your memory limit or run
> into scheduler problems, thread-per-connection can be more scalable,
> especially on W32 where the current 'select()'-mechanism is rather
> awkward AFAIK.
>
> But even on GNU/Linux thread-per-connection can be faster as long as
> your system can handle all the threads (and doesn't encounter trouble
> with cache misses for all the stacks).


NodeJS is very fast and stable on Windows (I believe that `libuv` -- the
NodeJS heart -- uses IOCP), but I prefer to use MHD, because I can use it
as embedded server in my own application. I need to confirm if libuv uses
IOCP, if so, that's the secret, if not, IMHO MHD should take a look at the
NodeJS (or nginx, libevent etc) logic to undestand why it is so fast and
stable on Windows.

--
Silvio Clécio

Reply via email to