In the Thin website: http://code.macournoyer.com/thin/usage/ it says that you can start multiple servers using:
thin start --servers 3
You would start more than one instante of thin if you may have concurrent requests to process. To manage concurrent requests (Simultaneous connections) you need a cluster of "thin".
Yes, you can easily see this:
let's try a single-server thin
 thin start -R fart.ru
 Thin web server (v1.5.0 codename Knife)
 Maximum connections set to 1024
 Listening on 0.0.0.0:3000, CTRL+C to stop
check:
 netstat -an | grep 300
 tcp4       0      0  *.3000                 *.*                    LISTEN     
ok, we have a thin listening on one port.
now let's try a --servers 3
 thin start -R fart.ru --servers 3
 Starting server on 0.0.0.0:3000 ... 
 Starting server on 0.0.0.0:3001 ... 
 Starting server on 0.0.0.0:3002 ... 
check:
 netstat -an | grep 300
 tcp4       0      0  *.3002                 *.*                    LISTEN     
 tcp4       0      0  *.3001                 *.*                    LISTEN     
 tcp4       0      0  *.3000                 *.*                    LISTEN    
voilà you have 3 port listening.
 ps -ef | grep thin 
reports 3 processes running, each one can manage a concurrent request.
Ultimately to concurrently process requests you have to start a cluster of thin and reverse proxy your virtual host then load balance the request on the various thin you've started.
This blogpost can make the point: Scaling Rails with Apache 2, mod_proxy_balancer and Thin Clusters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With