# Rails Spawn plugin under nginx

**URL:** <https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358>\
**Category:** NGINX\
**Created:** [March 30, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358 "2008-03-30T21:25:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tschneit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@tschneit](https://www.ruby-forum.com/u/tschneit)\
**Post date:** [March 30, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358/1 "2008-03-30T21:25:55Z")

</div>

Howdy folks -  
I am having trouble with the ‘Spawn’ plugin, which is used to launch  
long-running processes in the background.

When I hit a single mongrel process, it works great. However, when I hit  
it through nginx, a the long-running task stays within the same process.  
I have no clue why this is happening, but it is dragging down my  
performance.

Does anyone have any input?

Thanks!

---

<div class="post-metadata">

**Author:** ![tschneit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@tschneit](https://www.ruby-forum.com/u/tschneit)\
**Post date:** [March 30, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358/2 "2008-03-30T21:52:10Z")

</div>

Hey,

Every client we have using spawn at engine yard has problems. The  
short answer is just don’t do it. You need to use real queueing a la  
bj, backgroundrb, starling, etc. I’m pretty sure that the upstream  
gets confused with all the fd closing/reopening/reconnecting.

\_\_  
Corey D.  
removed\_email\_address@domain.invalid  
(866) 518-9273 x207

---

<div class="post-metadata">

**Author:** ![tschneit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@tschneit](https://www.ruby-forum.com/u/tschneit)\
**Post date:** [March 30, 2008, 10:38pm UTC](https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358/3 "2008-03-30T22:38:45Z")

</div>

Howdy Corey-  
Thanks for your input. I will look into one of these alternatives.

Again, thanks for the quick response!

Corey D. wrote:

> Hey,
> 
> Every client we have using spawn at engine yard has problems. The  
> short answer is just don’t do it. You need to use real queueing a la  
> bj, backgroundrb, starling, etc. I’m pretty sure that the upstream  
> gets confused with all the fd closing/reopening/reconnecting.
> 
> \_\_  
> Corey D.  
> removed\_email\_address@domain.invalid  
> (866) 518-9273 x207

---

<div class="post-metadata">

**Author:** ![tschneit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@tschneit](https://www.ruby-forum.com/u/tschneit)\
**Post date:** [October 13, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/rails-spawn-plugin-under-nginx/133358/4 "2008-10-13T23:59:33Z")

</div>

BTW, the problems with Nginx were solved shortly after these messages  
appeared. The solution was to have spawn disconnect from the listening  
sockets in the child process. You should be able to use Spawn with  
nginx without problems now.

Tr Schneit wrote:

> Howdy Corey-  
> Thanks for your input. I will look into one of these alternatives.
> 
> Again, thanks for the quick response!
> 
> Corey D. wrote:
> 
> > Hey,
> > 
> > Every client we have using spawn at engine yard has problems. The  
> > short answer is just don’t do it. You need to use real queueing a la  
> > bj, backgroundrb, starling, etc. I’m pretty sure that the upstream  
> > gets confused with all the fd closing/reopening/reconnecting.
> > 
> > \_\_  
> > Corey D.  
> > removed\_email\_address@domain.invalid  
> > (866) 518-9273 x207
