I have a website up and running on TextDrive with Rails/lighttpd/fcgi. Unfortunately, as my account is a "shared server" account on TxD, they kill processes that are hogging resources (quite understandably). Unfortunately for me, my Ruby fcgi processes load up rather ... large (just under 50mb). It doesn''t take much to push it to 50mb, at which point it gets killed. Does anyone have any suggestions for reducing the footprint of my app? I know that there is a profiler script available for benchmarking and such, but it seems that it focuses more on speed performance than memory (correct me if I am mistaken, but all the stats I see are for response time). My app seems rather responsive anyway (both as a qualitative observation from just using it, as well as browing through the logs). Running script/console (in development mode) the process loads up around 27mb. The live server runs in production mode, but loads up to almost 50mb. But I have no clue as to go about tracking down the memory hog of my app. The memory usage increase quite rapidly when I start "creating" new content, but even aside from that it eventually grows over 50mb. Any suggestions? Thanks! -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060103/1ed75d93/attachment.html
Are you using rmagick? Rmagick uses Ruby memory ''off the books'', this can cause large memory usage, but not trigger garbage collection. After doing a set of rmagick operations (usually at the end of the controller action), I force a garbage collection to clear out that memory with code that looks like this: def run_gc fDisabled = GC.enable GC.start GC.disable if fDisabled end _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Belorion Sent: Tuesday, January 03, 2006 2:31 PM To: rails@lists.rubyonrails.org Subject: [Rails] Reducing Memory Footprint (fcgi) I have a website up and running on TextDrive with Rails/lighttpd/fcgi. Unfortunately, as my account is a "shared server" account on TxD, they kill processes that are hogging resources (quite understandably). Unfortunately for me, my Ruby fcgi processes load up rather ... large (just under 50mb). It doesn''t take much to push it to 50mb, at which point it gets killed. Does anyone have any suggestions for reducing the footprint of my app? I know that there is a profiler script available for benchmarking and such, but it seems that it focuses more on speed performance than memory (correct me if I am mistaken, but all the stats I see are for response time). My app seems rather responsive anyway (both as a qualitative observation from just using it, as well as browing through the logs). Running script/console (in development mode) the process loads up around 27mb. The live server runs in production mode, but loads up to almost 50mb. But I have no clue as to go about tracking down the memory hog of my app. The memory usage increase quite rapidly when I start "creating" new content, but even aside from that it eventually grows over 50mb. Any suggestions? Thanks! -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060103/52f74a89/attachment.html
Hi Tom. On 1/3/06, Tom Fakes <tom@craz8.com> wrote:> > Are you using rmagick? Rmagick uses Ruby memory ''off the books'', this > can cause large memory usage, but not trigger garbage collection. >Why yes, yes I am using RMagick. After doing a set of rmagick operations (usually at the end of the> controller action), I force a garbage collection to clear out that memory > with code that looks like this: > *def* run_gc >fDisabled = GC.enable> > GC.start > > GC.disable *if* fDisabled > > *end* >Thanks for the tip! I will most certainly give that a shot. -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060103/84d202b3/attachment-0001.html
Apparently Analagous Threads
- Finding memory leaks?
- FastCGI: comm with (dynamic) server ...../dispatch.fcgi aborted: (first read) idle timeout (30 sec)
- reducing smbd memory footprint
- Possible solutions to txtdrive process killing for cpu usage
- (newbie) rails app not working after subversion integration?