libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] 100% CPU Usage with Keep-Alives


From: Christian Grothoff
Subject: Re: [libmicrohttpd] 100% CPU Usage with Keep-Alives
Date: Fri, 19 Mar 2010 07:13:37 +0100
User-agent: KMail/1.12.4 (Linux/2.6.31-14-generic; KDE/4.3.5; i686; ; )

I suggest you first update to 0.4.6 since since 0.4.4 two issues that relate 
to this have been fixed (depending on how exactly you're using the library, 
see ChangeLog excerpts below).

Best,

Christian

Sat Mar 13 09:41:01 CET 2010
        Releasing libmicrohttpd 0.4.6. -CG

Tue Feb  9 20:31:51 CET 2010
        Fixed issue with poll doing busy waiting. -BK/CG

Thu Jan 28 21:28:56 CET 2010
        Releasing libmicrohttpd 0.4.5. -CG

Mon Nov 16 14:41:26 CET 2009
        Fixed busy-loop in internal select mode for inactive
        clients with infinite connection timeout. -CG

Wed Oct 28 20:26:00 CET 2009
        Releasing libmicrohttpd 0.4.4. -CG



On Thursday 18 March 2010 07:56:34 pm Larry Wimble wrote:
> Greetings....
> 
> I am having a problem in my application which uses libmicrohttpd wherein
> the CPU usage spikes to 100% after the first request from Firefox and
> stays there until the connection times out or you close the browser.
> 
> I can reproduce this over and over.  I have:
> 
> 1) Fired up my webserver based on libmicrohttpd
> 2) Fired up 'top' in another terminal.
> 3) Checked to see that CPU usage was normal (it is).
> 4) Made a request using CURL from the command line with no keep-alives.
> 5) Checked both netstat -an and top to make sure the connection was
> closed and CPU usage was normal.
> 6) Made a request from Firefox.
> 7) CPU Usage for my webserver process immediately spikes to 100% and
> stays there.
> 8) netstat -an states there is an established connection (as it should
> in a keep-alive situation)
> 9) Wait 60 seconds.  Process is still at 100%
> 9) Close browser (thus killing the connection).  CPU utilization
> immediately drops back to normal.
> 
> I temporarily added a "Connection: close" header to stop this which has
> been successful, however, since the application here is a web
> map-tile-server, the use of keep-alives is definitely desired.  I
> thought perhaps I had an errant thread or something, but have now
> verified that all calls to the callback specified in MHD_ start_daemon
> exit normally (with MHD_YES).  I am using no other threading.
> 
> Setup:
> 
> Gentoo Linux
> libmicrohttpd 0.4.4
> gcc 4.3.2
> Not using SSL
> 
> My start-up code:
> 
> MHD_start_daemon(
>                MHD_USE_THREAD_PER_CONNECTION, PORT, NULL, NULL,
>                &http_request_handler, NULL, MHD_OPTION_END);
> 
> Any suggestions?
> 
> Larry
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]