# Monit mongrel limit

**URL:** <https://www.ruby-forum.com/t/monit-mongrel-limit/118761>\
**Category:** Deployment\
**Created:** [October 30, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761 "2007-10-30T18:22:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 30, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/1 "2007-10-30T18:22:32Z")

</div>

What do other people use as their memory limit for mongrel in monit?  
I’m using these settings below and it seems like I’m getting a lot of  
emails and restarts. Should I bumb up the totalmem limit to 80 or 100?

```
    if totalmem is greater than 60.0 MB for 5 cycles then

```

restart # eating up memory?  
if cpu is greater than 50% for 2 cycles then  
alert # send an email to admin  
if cpu is greater than 80% for 3 cycles then  
restart # hung process?  
if loadavg(5min) greater than 10 for 8 cycles then  
restart # bad, bad, bad  
if 3 restarts within 5 cycles then  
timeout # something is wrong, call the sys-  
admin

```
    if failed port 8000 protocol http
            with timeout 10 seconds
            then restart
    group mongrel
```

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 30, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/2 "2007-10-30T18:32:29Z")

</div>

I’m using 70 and 90MB in two different apps. So far it’s been good for  
me.

AEM

On 10/30/07, jnunemaker [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> if cpu is greater than 80% for 3 cycles then
> group mongrel
> 
> ```
> 
> >

–  
Adrian Esteban Madrid  
Lead Developer, Prefab Markets  
[http://www.prefabmarkets.com](http://www.prefabmarkets.com)

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 30, 2007, 7:57pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/3 "2007-10-30T19:57:20Z")

</div>

I set the default memory limit to 110Mb on engineyard slices. Memory  
usage also varied on 32bit vs 64bit platforms. If you are on 32bit  
then mongrels use about 10% less emory then on 64bit servers.

Cheers-  
-Ezra

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 30, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/4 "2007-10-30T18:40:04Z")

</div>

Yeah, I’m thinking that 60 might be too small. I’ll bump it up.

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 30, 2007, 8:28pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/5 "2007-10-30T20:28:55Z")

</div>

jnunemaker escribiÃ³:

> ```
> if failed port 8000 protocol http
> with timeout 10 seconds
> then restart
> group mongrel
> 
> ```

[OT] This configuration I thought it isn’t very correct. Imagine if you  
disable your web application(for example with: cap deploy:web:disable)  
and then you make changes while monit is trying to restart mongrel it  
can be a bit annoying. Maybe will be put an “and not exists  
public/system/maintenance.html” (pseudocode not real code) 😉

Regards

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 31, 2007, 3:09am UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/6 "2007-10-31T03:09:27Z")

</div>

Yeah, or you can disable the monitoring of mongrel before a longer  
change. I believe because all the mongrel checks have the group  
‘mongrel’ I can start/stop monitoring on them all at once without  
turning monit on and off.

---

<div class="post-metadata">

**Author:** ![jnunemaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jnunemaker](https://www.ruby-forum.com/u/jnunemaker)\
**Post date:** [October 31, 2007, 1:12pm UTC](https://www.ruby-forum.com/t/monit-mongrel-limit/118761/7 "2007-10-31T13:12:38Z")

</div>

We use a limit of around 110 - 130  
It really sucks as a solution though…
