Switchpipe and Thin

0 views
Skip to first unread message

JY35

unread,
Apr 29, 2008, 5:18:46 PM4/29/08
to SwitchPipe
I try since several hours to make Switchpipe to launch Thin instance
via socket to deliver service for a rails app.
Here is the switchpipe app config file :
---
type: thin
socket_type: unix
user: www-data
group: www-data
path: /var/www/nginx-default/rorprotack
max_instances: 3
timeout: 9
---
As you can see, I use nginx as front server.

Any ideas ?

JY

Peter Cooper

unread,
Apr 30, 2008, 10:19:47 PM4/30/08
to SwitchPipe
Start from something simpler, and work your way up. That should
highlight where the problem is.

Also, you need to make sure that wherever "thin" is located is within
your path. SwitchPipe will go to /var/www/nginx-default/rorprotack and
then run:

thin --socket /tmp/switchpipe-[[RANDOMISH NUMBER HERE]].sock -u www-
data -g www-data -e production start

Try going to /var/www/nginx-default/rorprotack and running such a line
yourself:

thin --socket /tmp/switchpipe-1234.sock -u www-data -g www-data -e
production start

Does it just work? If not, that's the problem. If it does, then.. I
might need to think about it. But in any case, do post back here :)

Cheers,
Peter Cooper

JY35

unread,
May 1, 2008, 11:25:04 AM5/1/08
to SwitchPipe
Oupsssss !

Thanks for your help, it was simply a path problem : the good one
should be path: /var/www/nginx-default/rorprotrack
Now it works for a little useless app. I've tried to set it for
another one, but switchpipe kill and restart indefinitely the thin
process.
I'll have to look futher deep before asking for some help.

Just a question, is it stupid to imagine to use switchpipe for
launching php-cgi process ?

Cheers
JY

Peter Cooper

unread,
May 1, 2008, 8:03:09 PM5/1/08
to SwitchPipe


On May 1, 4:25 pm, JY35 <jysui...@gmail.com> wrote:
> Oupsssss !
>
> Thanks for your help, it was simply a path problem : the good one
> should be path: /var/www/nginx-default/rorprotrack
> Now it works for a little useless app. I've tried to set it for
> another one, but switchpipe kill and restart indefinitely the thin
> process.

If SwitchPipe's doing that, then either the app is not responding
within a certain number of seconds, and SwitchPipe is then forcing a
restart (I think this is in the settings) OR the app is simply not
responding or SwitchPipe cannot connect to it. I have not come across
a Rails application, at least, that takes more than 5 or 6 seconds to
start, but your situation may vary.

> I'll have to look futher deep before asking for some help.
>
> Just a question, is it stupid to imagine to use switchpipe for
> launching php-cgi process ?

I am not particularly familiar with PHP in its CGI mode, but I can't
see why not as long as you can start it from the command line in the
way SwitchPipe expects. Apache with mod_php is, of course, the far
easier option for PHP ;-)

Pete

JY35

unread,
May 3, 2008, 5:52:03 AM5/3/08
to SwitchPipe


On 2 mai, 02:03, Peter Cooper <pcoo...@gmail.com> wrote:
> On May 1, 4:25 pm, JY35 <jysui...@gmail.com> wrote:
>
> > Oupsssss !
>
> > Thanks for your help, it was simply a path problem : the good one
> > should be path: /var/www/nginx-default/rorprotrack
> > Now it works for a little useless app. I've tried to set it for
> > another one, but switchpipe kill and restart indefinitely the thin
> > process.
>
> If SwitchPipe's doing that, then either the app is not responding
> within a certain number of seconds, and SwitchPipe is then forcing a
> restart (I think this is in the settings) OR the app is simply not
> responding or SwitchPipe cannot connect to it. I have not come across
> a Rails application, at least, that takes more than 5 or 6 seconds to
> start, but your situation may vary.

Yes, I have to look deeper (as I'm not a Ruby specialist)
>
> > I'll have to look futher deep before asking for some help.
>
> > Just a question, is it stupid to imagine to use switchpipe for
> > launching php-cgi process ?
>
> I am not particularly familiar with PHP in its CGI mode, but I can't
> see why not as long as you can start it from the command line in the
> way SwitchPipe expects. Apache with mod_php is, of course, the far
> easier option for PHP ;-)

Yes, but I use NGinx and I feel ok with it. Maybe I should try that,
mainly for the challenge.
>
> Pete

JY
Reply all
Reply to author
Forward
0 new messages