Hey All, First off, thanks for everyone''s work on backgroundrb. My company just started using BackgroundRB for our site and I have a few questions that I could not find documented elsewhere. Perhaps you can help me out with some info. 1) I see two ''overhead'' ruby processes; backgroundrb start and logger worker. Both of these are big - 108 megs of memory for each. Do I have something screwed up in my setup or is this normal? 2) The old versions of BDRB seemed to have had (based on the docs) a vanilla ruby worker and a rails worker that one could extend from, whereas 1.0 has only metaworker. Is there a way to get a vanilla ruby worker without loading my whole app? 3) I seemed to have a memory leak the first time I deployed, where the processes kept growing in a stair-step pattern of 50 meg stairs. My best hypothesis is that objects passed into ask_worker get kept in some datastructure that never goes away, and thus if you pass any objects there, things balloon; is that correct? If not, do you have any thoughts on common ''gotchas'' that could cause memory growth? Thanks so much everyone. I will try to blog the final solutions to the above to make this info available for others. -Noah Horton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080204/802f4a71/attachment.html
On 2/4/08, Noah Horton <noah at rapouts.com> wrote:> 3) I seemed to have a memory leak the first time I deployed, where the > processes kept growing in a stair-step pattern of 50 meg stairs. My best > hypothesis is that objects passed into ask_worker get kept in some > datastructure that never goes away, and thus if you pass any objects there, > things balloon; is that correct? If not, do you have any thoughts on common > ''gotchas'' that could cause memory growth?With an old version I found that I had to explicitly call #kill at the end of the task, or the object would sit around forever. I don''t think there''s an equivalent in the new version, or what version you''re running, so I''ve no idea if that will solve your question. -Ian
On Feb 5, 2008 10:42 AM, Ian Smith-Heisters <heisters at greenriver.org> wrote:> On 2/4/08, Noah Horton <noah at rapouts.com> wrote: > > 3) I seemed to have a memory leak the first time I deployed, where the > > processes kept growing in a stair-step pattern of 50 meg stairs. My best > > hypothesis is that objects passed into ask_worker get kept in some > > datastructure that never goes away, and thus if you pass any objects there, > > things balloon; is that correct? If not, do you have any thoughts on common > > ''gotchas'' that could cause memory growth?ask_work doesn''t make objects stay around in a data structure. However, you don''t want to pass big objects anyways. Also, go light on logging if possible.> > With an old version I found that I had to explicitly call #kill at the > end of the task, or the object would sit around forever. I don''t think > there''s an equivalent in the new version, or what version you''re > running, so I''ve no idea if that will solve your question.New version has "exit". So, if you call exit from inside of your worker, it will die.