# Mongrel zooms to 75% memory (750MB!) randomly

**URL:** <https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983>\
**Category:** Rails\
**Created:** [May 24, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983 "2007-05-24T16:42:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/1 "2007-05-24T16:42:18Z")

</div>

I have a rails app

- ubuntu feisty
- apache 2.2
- mod proxy
- 4 mongrels in a cluster
- 1g ram

About once a day, the memory usage (as reported by top) of one of the  
mongrels will zip from the normal 4% to 75% and never come back. At  
that point, the system is basically hosed and that mongrel needs to be  
restarted.

There’s alot of activity on this system, and I am having a hard time  
trying to pinpoint this problem.

Any advise ???

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/2 "2007-05-24T16:44:18Z")

</div>

I doubt its mongrel per se by the way, more likely something in my  
app, but still finding it is not easy.

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 4:49pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/3 "2007-05-24T16:49:18Z")

</div>

Hi,

You can try [http://blog.evanweaver.com/pages/code#bleak\_house](http://blog.evanweaver.com/pages/code#bleak_house) which  
has the slight overhead of building a custom binary ( rake task ).

- Lourens

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 6:46pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/4 "2007-05-24T18:46:42Z")

</div>

On 24 May 2007, at 16:40, uncle wrote:

> restarted.
> 
> There’s alot of activity on this system, and I am having a hard time  
> trying to pinpoint this problem.
> 
> Any advise ???

Could it be during an RMagick operation or file upload? This happened  
to me once a while back, but I think a gem update fixed my problem,  
because it was a one-time problem.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 26, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/5 "2007-05-26T18:12:17Z")

</div>

uncle wrote:

> restarted.
> 
> There’s alot of activity on this system, and I am having a hard time  
> trying to pinpoint this problem.
> 
> Any advise ???
> 
> >

Do you maybe use send\_file to stream big files back to user?  
I have similiar problem with memory consumption and it was send\_file…

best,  
Bojan

–  
Bojan M.  
 → Ruby on Rails and Web D. Blog : [http://source.mihelac.org](http://source.mihelac.org)

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 26, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/6 "2007-05-26T20:51:34Z")

</div>

Hi, do you have an isolated development box that you can use to  
diagnose the issue that you’re seeing in production? Also, what  
applications are running when this issue occurs? Last but not least,  
what exactly does your application do and could you provide  
information about the version of rails and third-party gems/plugins  
that you’re using for this application?

-Conrad

---

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/mongrel-zooms-to-75-memory-750mb-randomly/104983/7 "2007-05-24T21:03:06Z")

</div>

Thanks for the ideas, but there is no rmagick involved in this app,  
and no uploading !
