1

I'm trying to setup multiple thin servers (running rails on windows), according to all the documentation that i've read the correct syntax is: thin start -s5 or thin start --server 5 . None of these work, i tried thin -h and got all the available commands, none of them (-s / --server) is not appearing in the list.

I am using thin 1.6.2 codename Doc Brown

Edit

thin -help output:

Server options:
    -a, --address HOST               bind to HOST address (default: 0.0.0.0)
    -p, --port PORT                  use PORT (default: 3000)
    -S, --socket FILE                bind to unix domain socket
    -y, --swiftiply [KEY]            Run using swiftiply
    -A, --adapter NAME               Rack adapter to use (default: autodetect)
                                     (rack, rails, ramaze, merb, file)
    -R, --rackup FILE                Load a Rack config file instead of Rack ada
pter
    -c, --chdir DIR                  Change to dir before starting
        --stats PATH                 Mount the Stats adapter under PATH

SSL options:
        --ssl                        Enables SSL
        --ssl-key-file PATH          Path to private key
        --ssl-cert-file PATH         Path to certificate

Adapter options:
    -e, --environment ENV            Framework environment (default: development
)
        --prefix PATH                Mount the app under PATH (start with /)

Tuning options:
    -b, --backend CLASS              Backend to use, full classname
    -t, --timeout SEC                Request or command timeout in sec (default:
 30)
    -f, --force                      Force the execution of the command
        --max-persistent-conns NUM   Maximum number of persistent connections
                                     (default: 100)
        --threaded                   Call the Rack application in threads [exper
imental]
        --threadpool-size NUM        Sets the size of the EventMachine threadpoo
l.
                                     (default: 20)

Common options:
    -r, --require FILE               require the library
    -q, --quiet                      Silence all logging
    -D, --debug                      Enable debug logging
    -V, --trace                      Set tracing on (log raw request/response)
    -h, --help                       Show this message
    -v, --version                    Show version
  • That should be an option. What does `thin --help` say? – tadman Apr 01 '14 at 14:43
  • What operating system are you using? I see the "Cluster options" and "Daemon options" sections but apparently you don't. Sometimes certain features aren't supported on Windows due to the way that process model is very difficult to work with. – tadman Apr 01 '14 at 15:02

1 Answers1

2

Help output is missing the Cluster options where the number of servers can be added as option:

Cluster options:
    -s, --servers NUM                Number of servers to start
    -o, --only NUM                   Send command to only one server of the cluster
    -C, --config FILE                Load options from config file
        --all [DIR]                  Send command to each config files in DIR
    -O, --onebyone                   Restart the cluster one by one (only works with restart command)
    -w, --wait NUM                   Maximum wait time for server to be started in seconds (use with -O)

considering this there are 2 options that gives you this issue:

  1. Windows does not support it
  2. Outdated gem version

update

https://github.com/macournoyer/thin/blob/master/lib/thin/runner.rb#L89

 unless Thin.win? # Daemonizing not supported on Windows

update 2 another option that might help on windows:

Starting multiple instances of Thin Server on Windows with a batch script

read help start and try this

start /b thin start
and read again help start and play with other options
Community
  • 1
  • 1
rmagnum2002
  • 11,341
  • 8
  • 49
  • 86
  • 1.6.2 is the current version. – tadman Apr 01 '14 at 15:03
  • mine is 1.6.1, and I have cluster options on Ubuntu, so probably it has to do with windows platform. – rmagnum2002 Apr 01 '14 at 15:04
  • Ok, so now i know i can't run multiple thin servers. The question is (i'm new to rails, so maybe it will sound a bit silly) - how bad would it be to run a single server? I tried using helicon zoo for this app but the performance was terrible. I moved to thin and it's running very fast. Is this acceptable to run single server of thin or is it a big no no? –  Apr 01 '14 at 15:14
  • @user3484702 depends on your app needs, you might try passenger too or unicorn on nginx but I am not sure how they will perform on windows platform. I have an app now that runs on single server and it's ok, it's thin by the way on linux.. can't say too much about windows platforms. – rmagnum2002 Apr 01 '14 at 16:01