I have a site with some administration actions that are long running.
The problem seems to be that pound is sending requests to this locked up
mongrel process, even though it has three other open ones. This is
manifested as intermittent “Internal Server Error” when browsing the
site while this action is running. It happens about 1 in 4 page loads,
and there are 4 mongrels so I am pretty sure this is whats going on.
I cant find any log entries about anything going wrong. How do I tell
pound to only send requests to unused mongrels?
I had this working on another box with lighttpd, which handled this
beautifully.
Thanks!
Alex,
I would strongly recommend reworking your code to execute your
long running actions in a separated thread. This way you will prevent
that every Mongrel gets busy with long running threads and your
aplication becomes unresponsive.
There are different ways to handle Rails long running threads, the
simplest is to spawn a new script/runner process, also you could use
BackgroundDrb:
http://backgroundrb.rubyforge.org/
Best regards,
–
Aníbal Rojas
On Oct 5, 2:15 am, Alex W. [email protected]
AnÃbal Rojas wrote:
Alex,
I would strongly recommend reworking your code to execute your
long running actions in a separated thread. This way you will prevent
that every Mongrel gets busy with long running threads and your
aplication becomes unresponsive.
There are different ways to handle Rails long running threads, the
simplest is to spawn a new script/runner process, also you could use
BackgroundDrb:
http://backgroundrb.rubyforge.org/
Best regards,
I knew that was an option, but this is a somewhat old rails app at this
point for an old client. I was trying to avoid spending this refactor
time, hoping that mongrel + pound could handle this as elegantly as
lighttpd + fcgi did.
There is also the added issue that the long running action writes to the
session periodcally to update the user on its process. This would not
work with Drb or script/runner since there is no session there. I guess
I can write it to a file, and read that in.
But it’s work I was hoping I wouldn’t have to do.
Thanks for the tips