0

When starting multiple thin servers running Rails 3, is there any way to tell them apart in the code?

For example, if I have a configuration like this:

port: 4000
pid: tmp/pids/thin.pid
servers: 2

Is there a way to tell whether the code is runnin on the process on port 4000 or 4001?

zoli
  • 469
  • 6
  • 17

2 Answers2

1

you can start 2 servers separately

thin start -p 4000 thin start -p 4001

:D

mingle
  • 1,567
  • 1
  • 16
  • 19
  • That won't help me doing anything like "if this_is_process_1 do this end". Although I could use the -r option to load code for only one of the servers, like `thin start -p 4000 -r code.rb; thin start -p 4001`. – zoli Sep 02 '12 at 00:49
-1

Supposing, that code, taht you posted is source of config/thin-config.yml

To start server with that parameters just do that:

thin start -C config/thin-config.yml

Yml files is the best way to configure server, but if you do not want to use them you can do that:

thin start -P tmp/pids/thin.pid -p 4000 -s 2
user1291365
  • 516
  • 1
  • 4
  • 16