I''ve had this problem for months with a certain server running Rails apps under FastCGI. It does not appear on other apps on other servers I run. Whenever I restart the httpd server, dispatch.fcgi processes are launched for the various Rails apps. When a dispatch.fcgi is first run (triggered by someone accessing an app), it uses about 90% CPU for several seconds, and then the page is delivered to the browser. All subsequent requests appear rapidly to Web users, yet the ruby dispatch.fcgi process is still using 80% CPU. This goes down slowly.. 70.. 60.. 50.. over the space of a few minutes. After several minutes, the CPU usage per dispatch.fcgi sits at around 3% or so, rising a little when a request comes in, as expected. It seems as if the Ruby interpreter is getting stuck in some loop or another, as the issue appears to be on the ruby end of things, rather than Apache itself. This only causes problems when httpd is restarted and only for the first 20 minutes or so, otherwise operation is perfect for weeks on end with these apps. Any ideas? TIA, Peter Cooper
On 5/8/05, Peter Cooper <peter-kB4nxRGAR8jpCd0h4Hqbjlpr/1R2p/CL@public.gmane.org> wrote:> This only causes problems when httpd is restarted and only for the > first 20 minutes or so, otherwise operation is perfect for weeks on > end with these apps. Any ideas?I''ve had a similar experience, but not quite the same... I''m using lighttpd, and when I restart it, my system load just increases gradually, basically forever (the highest I''ve seen it go is about 15, but it showed no sign of stopping then). Simply doing a single page load of the rails app makes this stop... that page load takes a couple minutes, but after that, all requests are quite snappy. So when I restart lighttpd, system load spirals out of control until I do a page load, then it comes back down to earth. -- Urban Artography http://artography.ath.cx
David Goodlad
2005-May-11 15:38 UTC
Re: On httpd restart only - Rails apps cause high CPU load
On 5/8/05, Rob Park <rbpark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/8/05, Peter Cooper <peter-kB4nxRGAR8jpCd0h4Hqbjlpr/1R2p/CL@public.gmane.org> wrote: > > This only causes problems when httpd is restarted and only for the > > first 20 minutes or so, otherwise operation is perfect for weeks on > > end with these apps. Any ideas? > > I''ve had a similar experience, but not quite the same... I''m using > lighttpd, and when I restart it, my system load just increases > gradually, basically forever (the highest I''ve seen it go is about 15, > but it showed no sign of stopping then). Simply doing a single page > load of the rails app makes this stop... that page load takes a couple > minutes, but after that, all requests are quite snappy. > > So when I restart lighttpd, system load spirals out of control until I > do a page load, then it comes back down to earth. > > -- > Urban Artography > http://artography.ath.cx > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >A big "me too" here. The dispatch.fcgi processes spawned by lighttpd when it''s starting up take very large amounts of CPU for about 10-20 seconds, then calm down. The first page load for either of my sites takes a bit, then after that it''s very responsive. Seems to me like it''s sitting there caching a ton of stuff... or something :) I haven''t yet taken the time to locate the cause of this high CPU usage. Dave -- Dave Goodlad dgoodlad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org or dave-eHfbeeWWzZOw5LPnMra/2Q@public.gmane.org http://david.goodlad.ca/