OpenLiteSpeed (OLS) can be optimized for better performance by modifying its configuration files. This method provides greater control over server settings but requires careful handling to avoid misconfigurations.
Important: Before making any changes, always create a backup of your configuration files to prevent data loss or unexpected issues.
Accessing Configuration Files
You can configure your OLS server by editing the configuration files directly via CLI. The main OpenLiteSpeed configuration file is typically located at: /usr/local/lsws/conf/httpd_config.conf
. You’ll need root or sudo privileges to edit this file.
sudo nano /usr/local/lsws/conf/httpd_config.conf
You can use your preferred text editor (e.g., Nano, vim), or if you are using RunCloud, you can edit it directly by clicking “LiteSpeed” in the left menu and scrolling down to the “LiteSpeed Server Config“ section.

Key Configuration Sections and Parameters
The httpd_config.conf
file is structured using a hierarchical format. We’ll focus on the sections most relevant to performance tuning, specifically connection handling and resource limits. Search and locate the following directives in your configuration file:
maxConnections
: This parameter defines the maximum number of concurrent connections the listener will accept. This should be set appropriately for your expected traffic and server resources. Increasing this value allows more simultaneous connections but also consumes more memory.softLimit
: This defines a soft limit on the number of processes, and can be considered a warning level. When the number of processes reaches this limit, OpenLiteSpeed may start taking actions, such as queuing requests or refusing new connections (depending on other configurations). It’s a way to gracefully handle load spikes.hardLimit
: Defines the absolute maximum number of processes. Once this limit is reached, new processes will not be created. This prevents the external application from overwhelming the server.
Tuning Strategy
You can adjust many configurations in this configuration file, which can get overwhelming. Here’s how you can tweak these settings effectively:
- Understand Your Traffic: Monitor your server’s typical and peak load. Use tools such as top, htop, and RunCloud’s monitoring features to see how many connections and processes are being used.
- Set
hardLimit
First: Determine the absolute maximum number of processes (e.g., PHP processes or overall connections) your server can handle without becoming unstable. This depends on your RAM, CPU, and the complexity of your applications. Set the hardLimit to this value – this is your safety net. - Set
softLimit
Lower: Set the softLimit to a value lower than the hardLimit. This provides a buffer zone. A good starting point is 80-90% of the hardLimit. When the softLimit is reached, you can configure OpenLiteSpeed to take actions (see below). - Set Max Connections Set max connections for each extprocessor instance; this value should be equal to the hardLimit.
- Monitor and Adjust: Carefully monitor your server’s performance after making changes. Watch for errors, slowdowns, and resource usage. Adjust the limits up or down as needed.
Restarting OpenLiteSpeed
After modifying the configuration file, you must restart OpenLiteSpeed for the changes to take effect. To save and restart the OLS service, click the “Update Config” button in the RunCloud dashboard.

If you are modifying the configuration via CLI, then you can run the following command:
sudo systemctl restart lsws
For more information, refer to the official OpenLiteSpeed documentation, which provides in-depth explanations of all configuration options.
If you have any other questions or need help – please feel free to get in touch with our 24/7 support team. We’re here to help!