[libmicrohttpd] libmicrohttpd: keep-alive connection alternative?
Andreas Røsdal
andrearo at pvv.ntnu.no
Mon Aug 25 12:28:46 MDT 2008
Hello!
I'm using libmicrohttpd as a HTTP server, and wonder how I should
configure libmicrohttpd optimally for the way I am using it.
I think that HTTP keep-alive connections support would be perfect,
but since that appears to be unspported I wonder about alternatives.
libmicrohttpd is setup to be a HTTP server in my back-end process.
A single web browser connects to libmicrohttpd through a HTTP proxy
based on the Apache Commons HttpClient. A libmicrohttpd server process
always connects to a single web browser client, because of the proxy.
As a result, the proxy always connects to a single libmicrohttpd process,
where about 4 connections every second is established between the proxy
and libmicrohttpd process. So a a huge amount of connections are created
and closed for the communication between the proxy and libmicrohttpd.
[Web browser] <-> [Proxy] <-> [libmicrohttpd]
I suspect in my current config, the connections are not closed and cleaned
up fast enough, and therefore uses more resources than neccesary.
If I set MHD_OPTION_CONNECTION_TIMEOUT = 1, then the connections are
cleaned up fast, but then the CPU usage goes to over 50% (way too high).
If I set to MHD_OPTION_CONNECTION_TIMEOUT = 0 (no timeout), then the
memory usage increases a lot.
So if the same connection could be reused or kept-alive, then I'd hope
that performance would be greatly improved. So do I need HTTP keep-alive
support, or is there anything I could do to improve my situation?
- Andreas
More information about the libmicrohttpd
mailing list