# Rails and Lighttpd, hangs?

**URL:** <https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009>\
**Category:** Rails\
**Created:** [March 25, 2006, 9:54am UTC](https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009 "2006-03-25T09:54:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berlin\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@Berlin\_B](https://www.ruby-forum.com/u/Berlin_B)\
**Post date:** [March 25, 2006, 9:54am UTC](https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009/1 "2006-03-25T09:54:48Z")

</div>

I know this is kind of a generic question. But, when hitting my  
lighttpd/rails site on some of the first hits, the site hangs. I  
think it has something with the lighttpd configuration, possibly  
something I am missing with rails or ruby? Any ideas or how to track  
this down.

fastcgi.server = (  
“.fcgi” =\> (  
“0.0.0.0” =\> (  
“socket” =\> “/home/bbrown/light/lighttpd/log/fast.socket”,  
“min-procs” =\> 2,  
“max-procs” =\> 12,  
“idle-timeout” =\> 30,  
“bin-path” =\>  
“/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “development” ),  
)  
)  
)

ruby 1.8.3 (2005-06-23) [i486-linux]

Rails 1.0.0

---

<div class="post-metadata">

**Author:** ![Berlin\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@Berlin\_B](https://www.ruby-forum.com/u/Berlin_B)\
**Post date:** [March 25, 2006, 11:45am UTC](https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009/2 "2006-03-25T11:45:17Z")

</div>

The answer is no.  
You will most likely never need 12 dispatchers, especially when your  
RAILS\_ENV is development.  
Each dispatcher is attempting to get its share of memory, so that could  
be  
the reason for your site to hang.

---

<div class="post-metadata">

**Author:** ![Berlin\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@Berlin\_B](https://www.ruby-forum.com/u/Berlin_B)\
**Post date:** [March 27, 2006, 11:43pm UTC](https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009/3 "2006-03-27T23:43:56Z")

</div>

Ezra Zymuntowicz wrote:

> ```
> The min-procs does not do anything in lighttpd currently, its 
> 
> could be the reason for your site to hang.
> this down.
> "/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi",
> removed_email_address@domain.invalid <mailto:removed_email_address@domain.invalid>
> 
> ```
> 
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

I added the 12 procs as a test. I had the issue when I had 1 and 1 max  
procs.

–  
Berlin B.  
(ramaza3 on freenode)  
[http://www.newspiritcompany.com](http://www.newspiritcompany.com)  
also checkout alpha version of botverse:  
[http://www.newspiritcompany.com:8086/universe\_home](http://www.newspiritcompany.com:8086/universe_home)

---

<div class="post-metadata">

**Author:** ![Berlin\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@Berlin\_B](https://www.ruby-forum.com/u/Berlin_B)\
**Post date:** [March 25, 2006, 11:18pm UTC](https://www.ruby-forum.com/t/rails-and-lighttpd-hangs/87009/4 "2006-03-25T23:18:53Z")

</div>

Berlin-

The hand you are seeing is because you are using 12 dispatchers. Those  
twelve dispatcher processes each take up anywhere from 20Mb to 90MB  
_each_ so when your site is not getting hit for a while, those  
dispatchers get swapped out of memory to disk and that could mean paging  
back in 12\*(20Mb-90Mb). So when you come back and hit the site, all  
twelve dispatchers need to get paged back into memory and this can take  
a while especially with 12 processes.

```
The min-procs does not do anything in lighttpd currently, its 

```

deprecated for now. So whatever you set your max-procs to is what will  
get started up when you start lighty. You probably only need one or two  
dispatcher until your site is geting major traffic. For dev just use one  
fcgi unless you need two for upload\_progress or something else that  
requires two dispatchers at once.

```
Now one way to keep the hang from happening when there is inactiv is 

```

to use wget or curl with a cron job to grab a dynamic page from your  
site and send the output to /dev/null. This ‘exercises’ your fcgi’s so  
they don’t get swapped out of main memory.

Cheers-

-Ezra

```
   _____

```

From: Bogdan I. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
To: removed\_email\_address@domain.invalid  
Sent: Sat, 25 Mar 2006 02:4505 -0800  
Subject: Re: [Rails] Rails and Lighttpd, hangs?

The answer is no.  
You will most likely never need 12 dispatchers, especially when your  
RAILS\_ENV is development.  
Each dispatcher is attempting to get its share of memory, so that could  
be the reason for your site to hang.

On 3/25/06, Berlin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: I know this is  
kind of a generic question. But, when hitting my  
lighttpd/rails site on some of the first hits, the site hangs. I  
think it has something with the lighttpd configuration, possibly  
something I am missing with rails or ruby? Any ideas or how to track  
this down.

fastcgi.server = (  
“.fcgi” =\> (  
“0.0.0.0” =\> (  
“socket” =\> “/home/bbrown/light/lighttpd/log/fast.socket”,  
“min-procs” =\> 2,  
“max-procs” =\> 12,  
“idle-timeout” =\> 30,  
“bin-path” =\>  
“/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “development” ),  
)  
)  
)

ruby 1.8.3 (2005-06-23) [i486-linux]

Rails 1.0.0

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
