Rack/Rails Settings

Table of Contents

Ruby Rack/Rails Settings

Ruby Path | Run-Time Mode | Max Connections | Environment | Initial Request Timeout | Retry Timeout | Keep Alive Timeout | Response Buffering | Max Idle Time | Back Log | Run On Start Up | Priority | Memory Soft Limit | Memory Hard Limit | Process Soft Limit | Process Hard Limit | 

Rack/Rails Shared Hosting

Enable Shared Hosting | Max Apps Per Account | Max Ruby Processes Per Account | 

Ruby Rack/Rails SettingsGo to top
Description: Default configurations for Ruby Rack/Rails applications.
Ruby PathGo to top
Description: Specifies path to Ruby executable. Generally, it is /usr/bin/ruby or /usr/local/bin/ruby depending on where Ruby has been installed to.
Syntax: Absolute path.
Run-Time ModeGo to top
Description: Specifies which mode Rack/Rails will be running as: "Development", "Production", or "Staging". The default is "Production".
Syntax: Select from drop down list
Max ConnectionsGo to top
Description: Specifies the maximum number of concurrent connections that can be established between the web server and an external application. This setting controls how many requests can be processed concurrently by an external application, however, the real limit also depends on the external application itself. Setting this value higher will not help if the external application is not fast enough or cannot scale to a large number of concurrent requests.
Syntax: Integer number
Tips: [Performance] Setting a high value does not directly translate to higher performance. Setting the limit to a value that will not overload the external application will provide the best performance/throughput.
EnvironmentGo to top
Description: Specifies extra environment variables for the external application.
Syntax: Key=value. Multiple variables can be separated by "ENTER"
Initial Request TimeoutGo to top
Description: Specifies the maximum time in seconds the web server will wait for the external application to respond to the first request over a new established connection. If the web server does not receive any data from the external application within this timeout limit, it will mark this connection as bad. This helps to identify communication problems with external applications as quickly as possible. If some requests take longer to process, increase this limit to avoid 503 error messages.
Syntax: Integer number
Retry TimeoutGo to top
Description: Specifies the period of time that the web server waits before retrying an external application that had a prior communication problem.
Syntax: Integer number
Keep Alive TimeoutGo to top
Description: Specifies the maximum time to keep an idle persistent connection open. When set to "-1", the connection will never timeout. When set to greater than or equal to 0, the connection will be closed after this time in seconds has passed.
Syntax: int
Response BufferingGo to top
Description: Specifies whether to buffer response received from external applications. If a "nph-" (Non-Parsed-Header) script is detected, buffering is turned off for responses with full HTTP headers.
Syntax: Select from drop down list
Max Idle TimeGo to top
Description: Specifies the maximum idle time before an external application is stopped by the server. When set to "-1", the external application will not be stopped by the server. The default value is "-1". This feature allows resources used by idle applications to be freed. It is especially useful in the mass hosting environment when you need to define many applications running in "setuid" mode for the sake of maximum security.
Syntax: Select from radio box
Tips: [Performance] This feature is especially useful in the mass hosting environment. In order to prevent files owned by one virtual host from being accessed by the external application scripts of another virtual host, mass hosting often requires many different applications running at the same time in SetUID mode. Set this Max Idle Time low to prevent these external applications from idling unnecessarily.
Back LogGo to top
Description: Specifies the backlog of the listening socket. Required if Auto Start is enabled.
Syntax: Integer number
Run On Start UpGo to top
Description: Specifies whether to start the external application at server start up. Only applicable to external applications that can manage their own child processes and where Instances value is set to "1". If enabled, external processes will be created at server startup instead of run-time.
Syntax: Select from radio box
Tips: [Performance] If the configured external process has significant startup overhead, like a Rails app, then this option should be enabled to decrease first page response time.
PriorityGo to top
Description: Specifies priority of the external application process. Value ranges from -20 to 20. A lower number means a higher priority. An external application process cannot have a higher priority than the web server. If this priority is set to a lower number than the server's, the server's priority will be used for this value.
Syntax: int
See Also: Server Priority
Memory Soft LimitGo to top
Description: Specifies the memory consumption limit in bytes for an external application process or an external application started by the server.

The main purpose of this limit is to prevent excessive memory usage because of software bugs or intentional attacks, not to impose a limit on normal usage. Make sure to leave enough head room, otherwise your application may fail and 503 error may be returned. It can be set at the server- level or at an individual external application level. The server-level limit will be used if it is not set at the individual application level.

The operating system's default setting will be used if the value is absent at both levels or set to 0.
Syntax: Integer number
Tips: [Attention] Do not over adjust this limit. This may result in 503 errors if your application needs more memory.
Memory Hard LimitGo to top
Description: Much the same as Memory Soft Limit, except the soft limit can be raised up to the hard limit from within a user process. The hard limit can be set at server level or at an individual external application level. The server-level limit will be used if it is not set at an individual application level.

The operating system's default will be used if the value is absent at both levels or set to 0.
Syntax: Integer number
Example: [Attention] Do not over adjust this limit. This may result in 503 errors if your application need more memory.
Process Soft LimitGo to top
Description: Limits the total number of processes that can be created on behalf of a user. All existing processes will be counted against this limit, not just new processes to be started. If the limit is set to 10, and there are more than 10 processes running under one user, then no new process can be started by the web server for that user (through suEXEC).

The main purpose of this limit is to prevent "fork bomb" attacks or excessive usage, not to impose a limit on normal usage. Make sure to leave enough head room. This can be set at the server level or at an individual external application level. The server-level limit will be used if it is not set at an individual application level. The operating system's default setting will be used if this value is 0 or absent at both levels.
Syntax: Integer number
Example: [Attention] All processes run under the same user ID at server level will be counted against this limit. Do not over adjust this limit. Doing so may cause 503 errors if a user needs to create many processes.
Process Hard LimitGo to top
Description: Much the same as Process Soft Limit, except the soft limit can be raised up to the hard limit from within a user process. The hard limit can be set at the server level or at an individual external application level. The server-level limit will be used if it is not set at an individual application level. The operating system's default value will be used if the value is absent at both levels or set to 0.
Syntax: Integer number
Rack/Rails Shared HostingGo to top
Description: LiteSpeed's Rack/Rails Shared Hosting settings allow users using our high performance, highly scalable Ruby LSAPI module to easily control their customers' Ruby usage.

LiteSpeed Rack/Rails hosting solution can deliver the best performance with minimum server resource requirement. In addition, it is compatible with all existing web hosting control panels.

The user-manageable Rack/Rails configuration file (".ls_rails_config") is located in the user's home directory or virtual host root directory. Syntax is as follows:
#RailsApp
RailsApp testApp "/lsws/testrails" "development" 4 1

#RailsAppMap
RailsAppMap testApp "testrails.com" "/"
RailsAppMap testApp "test.testrails.com" "/"

The "App Path" is relative to the user's home directory or the virtual host root directory.

Whenever this file is touched, Rack/Rails applications will be restarted.
Enable Shared HostingGo to top
Description: Specifies whether to enable Rack/Rails shared hosting. The default is "Disabled".
Syntax: Select from radio box
Max Apps Per AccountGo to top
Description: Specifies the maximum number of Rack/Rails applications that can be created per account. The default is "1".
Syntax: Integer number
Tips: [Performance] Rack/Rails applications can take a large amount of system resources. Thus it is not recommended to set this limit too high, otherwise it may affect the performance of whole server if one user abuses it.
Max Ruby Processes Per AccountGo to top
Description: Specifies the maximum number of Ruby processes that can be created per account. The default is "10". If one account runs multiple Rack/Rails applications, the total number of Ruby processes of all applications cannot exceed this limit. Each ruby process will take large amount of system resource, it is not recommended to set a high limit, otherwise, it will affect the performance of whole server if one user abuse it.
Syntax: Integer number
Tips: [Performance] Ruby processes can take a large amount of system resources. Thus it is not recommended to set this limit too high, otherwise it may affect the performance of the whole server if one user abuses it.

STAY CONNECTED