# Mod\_rails and long-running processes

**URL:** <https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288>\
**Category:** Rails\
**Created:** [April 20, 2008, 6:00pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288 "2008-04-20T18:00:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 20, 2008, 6:00pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/1 "2008-04-20T18:00:55Z")

</div>

What’s the impact of switching from mongrels to mod\_rails with respect  
to the ability to support long-running processes within a Rails app, as  
opposed to the current situation where they’re best moved off to a  
distributed process?

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 20, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/2 "2008-04-20T20:49:35Z")

</div>

On Apr 20, 2008, at 9:59 AM, Bill W. wrote:

> What’s the impact of switching from mongrels to mod\_rails with  
> respect to the ability to support long-running processes within a  
> Rails app, as opposed to the current situation where they’re best  
> moved off to a distributed process?
> 
> Thanks,  
> Bill

That situation doesn’t change, you still need to separate out long  
requests.

Cheers-

- Ezra Z.  
– Founder & Software Architect  
– removed\_email\_address@domain.invalid  
– [EngineYard.com](http://EngineYard.com)

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 21, 2008, 1:44pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/3 "2008-04-21T13:44:45Z")

</div>

Ezra Z. wrote:

> On Apr 20, 2008, at 9:59 AM, Bill W. wrote:
> 
> > What’s the impact of switching from mongrels to mod\_rails with  
> > respect to the ability to support long-running processes within a  
> > Rails app, as opposed to the current situation where they’re best  
> > moved off to a distributed process?
> 
> That situation doesn’t change, you still need to separate out long  
> requests.

Thanks, Ezra. I realize this doesn’t change the fundamentals of Rails,  
but  
was hoping it might open some new avenues. We’ve got a user-initiated  
file-upload-and-process process that gets used maybe 3 or 4 times a  
month.  
The current config (mongrel cluster managed by haproxy) throws a proxy  
error  
for any process that takes more than 30 seconds to complete under the  
assumption that a mongrel has become unresponsive. This process takes  
considerably more than 30 seconds so the user sees an error page even  
though  
the process completes successfully. We’re reluctant to eliminate the  
haproxy timeout because the mongrels do need to be managed. Our  
infrastructure support team is new to Rails (and LAMP) and so we’re  
reluctant to insert distributed processes into the mix at this point.  
So…

suggestions ?

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 20, 2008, 8:53pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/4 "2008-04-20T20:53:42Z")

</div>

On 20 Apr 2008, at 19:48, Ezra Z. wrote:

> That situation doesn’t change, you still need to separate out long  
> requests.

And even if mod\_rails did change that, it would still be poor user  
experience to have the user just starting at their browser’s load bar  
without any progress information (or information that anything at all  
is happening).

Fred

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 21, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/5 "2008-04-21T16:31:30Z")

</div>

On Mon, 2008-04-21 at 07:17 -0500, Bill W. wrote:

> > requests.  
> > infrastructure support team is new to Rails (and LAMP) and so we’re  
> > reluctant to insert distributed processes into the mix at this point. So…
> 
> suggestions ?

* * *

backgroundrb plugin

that’s what it was created for

Craig

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [April 21, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/mod-rails-and-long-running-processes/135288/6 "2008-04-21T22:46:44Z")

</div>

On Apr 21, 2008, at 5:17 AM, Bill W. wrote:

> > That situation doesn’t change, you still need to separate out long  
> > assumption that a mongrel has become unresponsive. This process takes  
> > Thanks,  
> > Bill

You are either going to have to break out a background process of  
some sort or you are going to need to increase the haproxy timeout to  
a large enough value for the long task to complete. No magical way  
around it, it’s one of these two paths that you have to take.

Cheers-

- Ezra Z.  
– Founder & Software Architect  
– removed\_email\_address@domain.invalid  
– [EngineYard.com](http://EngineYard.com)
