Skip to main content

Configure Thin

Sometimes the Ruby agent pushes the application over the timeout threshold and that prevents the server from startup. This can be prevented by server configuration.

Thin is lightweight web server, supporting clusters and providing options to set timeouts and wait time. Thin accepts CLI commands or adding a config.yml file in which you can set all the settings you need.

Timeouts

The wait option is the maximum wait time for the server to be restarted within a cluster.

The timeout option is the maximum number of seconds for incoming data to arrive before the connection is dropped.

Forking

Thin supports clusters and you can run several server instances on different ports.

These are the available options:

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
-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)

There is also an experimental tuning option that can be run alongside clusters:

--threaded                   Call the Rack application in threads [experimental]

See also