I am currently hosting a rails application on Textdrive and they have just informed me that some of my code has gone wild: Now I have no idea what could be causing this. Can someone point me in the right direction? Thanks _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Wed, 15 Dec 2004 10:28:31 -0800, Russ Smith <russ-Bff6KPpgmvsxnA8XTFIEbw@public.gmane.org> wrote:> I am currently hosting a rails application on Textdrive and they have > just informed me > that some of my code has gone wild: > > > > > Now I have no idea what could be causing this. Can someone point me in > the right direction? > > Thanks >I doubt this is related in the least, but last night, I tried out Rails with mod_ruby and fcgi, and on each Rails request, about 10 fcgi processes would get loaded, system load increased to the point where the box was unusable. I had to go back to using webrick.
I forgot to mention that it''s running on CGI (Technical Reasons). But I''m thinking that a new process is being loaded every time? On Dec 15, 2004, at 10:35 AM, Joe Van Dyk wrote:> On Wed, 15 Dec 2004 10:28:31 -0800, Russ Smith <russ-Bff6KPpgmvsxnA8XTFIEbw@public.gmane.org> > wrote: >> I am currently hosting a rails application on Textdrive and they have >> just informed me >> that some of my code has gone wild: >> >> >> >> >> Now I have no idea what could be causing this. Can someone point me in >> the right direction? >> >> Thanks >> > > I doubt this is related in the least, but last night, I tried out > Rails with mod_ruby and fcgi, and on each Rails request, about 10 fcgi > processes would get loaded, system load increased to the point where > the box was unusable. I had to go back to using webrick. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Russ Smith wrote:> I forgot to mention that it''s running on CGI (Technical Reasons). But > I''m thinking that a new process is being loaded every time?A yes, I saw your processes. There were only a couple of them, but they did use about 40% CPU usage each. Are you by any chance using RedCloth (or the textile / textilize functions)? If so, RedCloth has an issue with empty strings where it''ll sit in an endless loop taking up a lot of CPU power. -- Marten Veldthuis
Yeah, I''m using the textilize functions. I guess I should be checking to see if the string is empty first. Should I be caching the output as well? On Dec 15, 2004, at 11:47 AM, Marten Veldthuis wrote:> Russ Smith wrote: >> I forgot to mention that it''s running on CGI (Technical Reasons). But >> I''m thinking that a new process is being loaded every time? > > A yes, I saw your processes. There were only a couple of them, but > they did use about 40% CPU usage each. > > Are you by any chance using RedCloth (or the textile / textilize > functions)? If so, RedCloth has an issue with empty strings where > it''ll sit in an endless loop taking up a lot of CPU power. > > -- > Marten Veldthuis > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Russ Smith wrote:> Yeah, I''m using the textilize functions. I guess I should be checking to > see if the string is empty first. Should I be caching the output as well?That''s ofcourse preferred most of the time, but it wouldn''t be the cause. It''ll only speed up processing of your pages. -- Marten Veldthuis
On 16/12/2004, at 7:21 AM, Russ Smith wrote:> Yeah, I''m using the textilize functions. I guess I should be checking > to see if the string is empty first. Should I be caching the output as > well?I have a field called "excerpt" and another one "excerpt_render" and I store the textilized version in the "_render" so I don''t need to convert the text each time it''s requested (which would be way too expensive). And you can have a "before_save" that just renders again and stores the rendered version in that column. Just my 2 cents, /B -- Bruno Mattarollo <bmatt-ee4meeAH724@public.gmane.org> Currently in: Sydney, Australia [ http://pokies.typepad.com/virtual_possum/ ] _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails