#148 new
Alexis Sprunger

Problem when trying to up 3 rails apps with different ports on one IP

Reported by Alexis Sprunger | July 28th, 2011 @ 09:20 AM

hi all,

I have a problem with thin 1.2.7
In fact, I have to up multiple rails apps with differents ports on one IP address.
The first apps is on the default port, 80, and works perfectly.
The second apps is on one port I randomly choose, 8082, and works perfectly.

When I have only 2 apps all is ok, and my 2 apps work 100% (2 website on one IP)

The matter come when I try to up one third apps.
The third apps is on the port 8083, when I power my ubuntu 10.04 on, only the 2 first servers launch corretly. The third, that is on port 8083, fail start.

I'm using Nginx, and some thin sockets.
I have one "upstream thin_cluster" for each apps with number 1,2,3.
Each apps has 2 sockets.

Then when I make a "thin restart" this happens:

[restart] /etc/thin/First_App.yml ...

Stopping server on /tmp/thin.0.sock ...
Sending QUIT signal to process 1233 ...
Stopping server on /tmp/thin.1.sock ...
Sending QUIT signal to process 1238 ...
Starting server on /tmp/thin.0.sock ...
Starting server on /tmp/thin.1.sock ...

[restart] /etc/thin/Second_App.yml ...

Stopping server on /tmp/thin_SecondApp.0.sock ...
Sending QUIT signal to process 1271 ...
Stopping server on /tmp/thin_SecondApp.1.sock ...
Sending QUIT signal to process 1276 ...
Starting server on /tmp/thin_SecondApp.0.sock ...
Starting server on /tmp/thin_SecondApp.1.sock ...

[restart] /etc/thin/Third_App.yml ...

Stopping server on /tmp/thin_ThirdApp.0.sock ...
Sending QUIT signal to process 1323 ...
Timeout!
Sending KILL signal to process 1323 ...
Stopping server on /tmp/thin_ThirdApp.1.sock ...
Sending QUIT signal to process 1328 ...
Starting server on /tmp/thin_ThirdApp.0.sock ...
Starting server on /tmp/thin_ThirdApp.1.sock ...

Now the problem isn't anymore about app 3 that was down.
The new problem is that now:
App 1 on port 80 default is OK App 2 on port 8082 is DOWN App 3 on port 8083 is OK

All ports are listenned by Nginx, and the problem don't come from Nginx, cause at starting, the 2 first apps work but not the third, and after "thin restart" the app 1 and the app 3 work, but it's the app 2 that is now down.

When I say down, I mean: Nginx give me 404 not found, and it seem like the thin proccess is off.

It looks like the App 3 on the port 8083 took the place of the App on the port 8082, like if App 3 killed the proccess of App 2 for starting its own proccess.

And during the restart, when it take some time to give the "Timeout!" for App 3, the App 2 is available on the port 8082 but App 3 is down on port 8083.

Does anyone else have the same problem?

If you need the nginx.conf, sites-available files, Apps.yml for trying to understand where is the problem, I'll post them.

Comments and changes to this ticket

  • Alexis Sprunger

    Alexis Sprunger July 29th, 2011 @ 09:22 AM

    Resolved, I found the problem.

    I named my sockets for the App 3 differently, without the underscore bar, and now all works Fine.

    App 1 socket: thin.0.sock
    App 2 socket: thin_SecondApp.0.sock
    App 3 socket: thinThirdApp.0.sock

    And by security I putted the App 3 on port 9093 instead of 8083

    Hope this will help others who had the same problem than I.

  • Alexis Sprunger

    Alexis Sprunger July 29th, 2011 @ 10:17 AM

    My bad.

    My MAIN error was I failed to change one symbolic Link on my App 3!

    the link pointed on the same directory than App 2!

    Just a mistake of innattention from my own ^^'

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages