Class Puma::Configuration::DSL
In: lib/puma/configuration.rb
Parent: Object

The methods that are available for use inside the config file.

Methods

Public Class methods

Public Instance methods

Start the Puma control rack app on url. This app can be communicated with to control the main server.

Use obj or block as the Rack app. This allows a config file to be the app itself.

Bind the server to url. tcp:// and unix:// are the only accepted protocols.

Daemonize the server into the background. Highly suggest that this be combined with pidfile and stdout_redirect.

The directory to operate out of.

When shutting down, drain the accept socket of pending connections and proces them. This loops over the accept socket until there are no more read events and then stops looking and waits for the requests to finish.

Set the environment in which the Rack‘s app will run.

Code to run before doing a restart. This code should close logfiles, database connections, etc.

This can be called multiple times to add code each time.

*Cluster mode only* Code to run when a worker boots to setup the process before booting the app.

This can be called multiple times to add hooks.

Store the pid of the server in the file at path.

Define the TCP port to bind to. Use bind for more advanced options.

*Cluster mode only* Preload the application before starting the workers and setting up the listen ports. This conflicts with using the phased restart feature, you can‘t use both.

Disable request logging.

Load path as a rackup file.

Command to use to restart puma. This should be just how to load puma itself (ie. ‘ruby -Ilib bin/puma’), not the arguments to puma, as those are the same as the original process.

Use path as the file to store the server info state. This is used by pumactl to query and control the server.

Redirect STDOUT and STDERR to files specified.

Configure min to be the minimum number of threads to use to answer requests and max the maximum.

*Cluster mode only* How many worker processes to run.

[Validate]