我尝试设置多个瘦服务器(在Windows上运行rails),根据我读过正确语法的所有文档:thin start -s5
或thin start --server 5
。这些都不起作用,我尝试了thin -h
并获得了所有可用的命令,其中没有一个(-s / --server
)没有出现在列表中。
我正在使用名为Doc Brown的薄1.6.2
修改
瘦 - 帮助输出:
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
答案 0 :(得分:2)
帮助输出缺少群集选项,其中可以添加服务器数量作为选项:
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)
考虑到这一点,有两个选项可以解决这个问题:
<强>更新强>
https://github.com/macournoyer/thin/blob/master/lib/thin/runner.rb#L89
unless Thin.win? # Daemonizing not supported on Windows
更新2 另一个可能对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