- Joined
- Oct 10, 2017
- Messages
- 49
- Points
- 8
Optimizing WordPress for Better Performance in Cpanel Hosting is very important as WordPress is simply put rather heavy in terms of PHP built sites. enhancement SEO and speed of wordpress site to the two main key factors :
Optimizing for WordPress Shared Hosting :
The first step in WordPress optimization is choosing a good web host to compare to the budget as well as Pakistan Web Server Shared Hosting Plans
Tweak Settings
Optimized Apache
A hand tip to improve overall performance on your site without updating hardware is to optimize Apache correctly. There are many things you can alter to improve your performance, however, WHM is quite limiting when wanting to do so. You can alter the following settings at the in the Apache Global configurations. Located at:
Home >> Service Configuration >> Apache Configuration >> Global Configuration
Keep-Alive
When set to “on”, Keep-Alive enables a persistent connection between your server and the user, providing long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases, this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. To enable Keep-Alive connections in Apache 1.2 and later, set KeepAlive On.
MaxKeepAliveRequests
This directive is used to define the number of requests allowed per connection when KeepAlive is enabled. When the value of this option is set to “0”, unlimited requests will be allowed on the server. For server performance, it’s recommended to allow unlimited requests.
KeepAliveTimeout
This directive is used to define how much time, in seconds, Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the “Timeout” directive applies. The value of “10” seconds is a good average for server performance. This value should be kept low as the socket will be idle for extended periods otherwise.
MaxClients
This directive is used to define the limit on the number of child processes that will be created to serve requests. The default means that up to 512 HTTP requests can be handled concurrently. This is an important tuning parameter regarding the performance of the Apache web server. For a high load operation, a value of “512” is recommended. For standard use, you can set the value to “256”.
MinSpareServers
This directive is used to define the minimum number of idle child server processes that should be created. An idle process is one which is not handling a request. If there are fewer than “MinSpareServers” idle, then the parent process creates new children at a maximum rate of 1 per second. The idle value is 10 MaxSpareServer: This directive is used to define the maximum number of idle child server processes that should be created. If there are more than “MaxSpareServers” idle child processes, then the parent process will kill off the excess processes and these extra processes will be terminated.The idle value is 15.
MaxRequestsPerChild
This option is used to define the number of requests that an individual child server process will handle. Set this directive to “0” to get the maximum performance and scalability for the server.
HostnameLookups
When set to “Off”, this directive will disable DNS lookups. It’s recommended to set this option to “Off” in order to avoid latency with every request. This will also save the network traffic time and improve the performance of your Apache web server.
For security, it is also a good idea to disable directory listings. You can do this by scrolling to the Directory options on the Global configuration page. There you will be able to disable indexing.
Optimize MySQL
When using a dynamic environment, it can be very beneficial to correctly configure your SQL settings. Replace your existing my.cnf file to the following.
[mysqld]
local-infile=0
max_allowed_packet = 1M
max_connections = 300
max_user_connections = 35
wait_timeout=40
connect_timeout=10
[mysqldump]
quick max_allowed_packet = 16M
InnoDB
To reduce RAM usage, you should also convert your InnoDB tables to MyISAM. RAM is a very important factor to worry about when running in a virtual environment. InnoDB uses a high amount of RAM and is recommended you avert using it. This might impact load times slightly, but it also allows the converted database tables to be accessed with a much lower memory footprint. You can change these formats with any SQL UI such as PHPMyAdmin.
Performance Schema
For MySQL 5.6.6+, disable performance_schema. This is turned on by default and tends to use a lot of RAM!
To disable performance_schema:
Optimize WordPress Configuration
Then you can look at optimizing plugins. Are plugins coded inefficiently? Do they repeat unnecessary database queries? WordPress has its own caching system, so generally speaking, using functions like get_option(), update_option() and so on will be faster than writing SQL.
Additional caching features include minification, caching of feeds, Gzipping, Content Delivery Network (CDN) support, and much more.
Caching your pages is one of the most effective ways of improving your page loading times, with many plugins promising an improvement of at least ten times. Popular caching plugins include WP Super Cache, W3 Total Cache and WP Fastest Cache. All three plugins are available free.
Don’t have the time to optimize WordPress? Don’t really know what you’re doing?
Feel free to contact me for providing best services on cpanel and wordpress
- Web hosting optimization:
- Web site optimization
Optimizing for WordPress Shared Hosting :
The first step in WordPress optimization is choosing a good web host to compare to the budget as well as Pakistan Web Server Shared Hosting Plans
- Cpanel Hosting Optimization :
Enable the Compress All Content : Go to cpanel > Optimize Website > then enable Compress All Content option - Hotlink protection : Cpanel > Hotlink > Enable
- Its a good idea to make sure your DKIM and SPF records under Authentication are valid Active
- Use of CloudFlare , Litespeed , or Varnish Casha in server side
Tweak Settings
- Updating Use pigz from Off to On.
- Updating Bandwidth limit check from On to Off
- Updating Allow cPanel & WHM to determine the best value for your MySQL max_allowed_packet configuration from On to Off
- Updating Allow cPanel & WHM to determine the best value for your MySQL open_files_limit configuration from On to Off.
- Updating Critical load threshold from “10” to # of CPUs (autodetect).
- Apache non-SSL IP/port 127.0.0.1:8080
Optimized Apache
A hand tip to improve overall performance on your site without updating hardware is to optimize Apache correctly. There are many things you can alter to improve your performance, however, WHM is quite limiting when wanting to do so. You can alter the following settings at the in the Apache Global configurations. Located at:
Home >> Service Configuration >> Apache Configuration >> Global Configuration
Keep-Alive
When set to “on”, Keep-Alive enables a persistent connection between your server and the user, providing long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases, this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. To enable Keep-Alive connections in Apache 1.2 and later, set KeepAlive On.
MaxKeepAliveRequests
This directive is used to define the number of requests allowed per connection when KeepAlive is enabled. When the value of this option is set to “0”, unlimited requests will be allowed on the server. For server performance, it’s recommended to allow unlimited requests.
KeepAliveTimeout
This directive is used to define how much time, in seconds, Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the “Timeout” directive applies. The value of “10” seconds is a good average for server performance. This value should be kept low as the socket will be idle for extended periods otherwise.
MaxClients
This directive is used to define the limit on the number of child processes that will be created to serve requests. The default means that up to 512 HTTP requests can be handled concurrently. This is an important tuning parameter regarding the performance of the Apache web server. For a high load operation, a value of “512” is recommended. For standard use, you can set the value to “256”.
MinSpareServers
This directive is used to define the minimum number of idle child server processes that should be created. An idle process is one which is not handling a request. If there are fewer than “MinSpareServers” idle, then the parent process creates new children at a maximum rate of 1 per second. The idle value is 10 MaxSpareServer: This directive is used to define the maximum number of idle child server processes that should be created. If there are more than “MaxSpareServers” idle child processes, then the parent process will kill off the excess processes and these extra processes will be terminated.The idle value is 15.
MaxRequestsPerChild
This option is used to define the number of requests that an individual child server process will handle. Set this directive to “0” to get the maximum performance and scalability for the server.
HostnameLookups
When set to “Off”, this directive will disable DNS lookups. It’s recommended to set this option to “Off” in order to avoid latency with every request. This will also save the network traffic time and improve the performance of your Apache web server.
For security, it is also a good idea to disable directory listings. You can do this by scrolling to the Directory options on the Global configuration page. There you will be able to disable indexing.
Optimize MySQL
When using a dynamic environment, it can be very beneficial to correctly configure your SQL settings. Replace your existing my.cnf file to the following.
[mysqld]
local-infile=0
max_allowed_packet = 1M
max_connections = 300
max_user_connections = 35
wait_timeout=40
connect_timeout=10
[mysqldump]
quick max_allowed_packet = 16M
InnoDB
To reduce RAM usage, you should also convert your InnoDB tables to MyISAM. RAM is a very important factor to worry about when running in a virtual environment. InnoDB uses a high amount of RAM and is recommended you avert using it. This might impact load times slightly, but it also allows the converted database tables to be accessed with a much lower memory footprint. You can change these formats with any SQL UI such as PHPMyAdmin.
Performance Schema
For MySQL 5.6.6+, disable performance_schema. This is turned on by default and tends to use a lot of RAM!
To disable performance_schema:
- Open my.cnf (typically @ /etc/my.cnf) via SSH or VPS admin panel >> add the following line just under [mysqld] >> performance_schema=0
- Save/close my.cnf and restart mysql service.
Optimize WordPress Configuration
- Optimize your Images
- Minimizing Plugins
Then you can look at optimizing plugins. Are plugins coded inefficiently? Do they repeat unnecessary database queries? WordPress has its own caching system, so generally speaking, using functions like get_option(), update_option() and so on will be faster than writing SQL.
- Theme optimization.
- Caching and Browser Caching Plugin
Additional caching features include minification, caching of feeds, Gzipping, Content Delivery Network (CDN) support, and much more.
Caching your pages is one of the most effective ways of improving your page loading times, with many plugins promising an improvement of at least ten times. Popular caching plugins include WP Super Cache, W3 Total Cache and WP Fastest Cache. All three plugins are available free.
Don’t have the time to optimize WordPress? Don’t really know what you’re doing?
Feel free to contact me for providing best services on cpanel and wordpress