VPS & Dedicated Hosting: Site Performance Essentials & Tips
This article will explain how-to prevent your server from freezing up, including ways to fix common site performance problems on a VPS or Dedicated Server.
Before you start, measure your site's current speed at PageSpeedGrader; just take note of the provided 'Seconds to load'.
- Unsupported Suggestions
- P.S. How do you check what happened in the past?
- P.P.S. Search what others have done
Write down the original time.
- Tune your CMS site (WordPress, Joomla, etc.)
- Temporarily deactivate ALL Plugins/Modules/Addons.
- Retime your site once more at PageSpeedGrader.
- Write it down.
- Install a Plugin/Module/Addon that does "caching":
- Reactivate one of the other plugins/modules. Retime it with PageSpeedGrader and write it down.
- Disable that previous plugin/module and then enable the next one. Retime it with PageSpeedGrader and write it down.
- Keep on doing that to determine which plugin is causing slowness to your site's performance. You'll usually find one that takes significantly more time than the others. In rare cases, it's a combination of two. Then find a replacement plugin/module that isn't so resource-intensive as the faulty one.
- On WordPress, do the same series of time measurements with any Widgets.
- PHP FastCGI(fcgi) Handler
- Login to your WHM.
- Go to Configure PHP & Suexec (You can also use the search box at the upper left of WHM).
- Then change the "Handler" to "fcgi" and click the submit button.
- Use a CDN (Content Delivery Network)
Cloudflare is our recommended CDN. To know more about Cloudflare, click here. It's free for all http:// sites.
- Once activated, time it once more at PageSpeedGrader.
Please understand that the recommendations below are outside the scope of our support. If you have further questions about them, you'll need to do your personal research online.
We will continue to help by pointing you in the right direction; by giving you the many pieces of information that we have found to be helpful. Additionally, some of the further resources online amongst many are forums.cpanel.net, dev.mysql.com/doc/, and httpd.apache.org.
- Use a PHP cache module such as Xcache or eAccelerator
You may want to research them before trying it out:
Try this at a time when you can most afford for your website to be down, just in case you'll run into a problem.
- Via your WHM, search for EasyApache and select it.
- Give it time to load up.
- At the bottom of the Step 1 page, click "Start customizing based on profile."
- On Steps 2 and 3, click "Next Step." You don't have to do anything else other than click "Next Step" on each.
- On Step 4, Short Options -> tick the checkbox for the one that you want -- for example, "Xcache for PHP" -> scroll down, and click Save & Build.
- After it's turned on, time it at again at PageSpeedGrader.
- Tune the MySQL database server settings in /etc/my.cnf. You can edit this file via SFTP using any SFTP program, like Filezilla (Username root and port 22).
Some places to learn about my.cnf optimization are:
- Time your site again at PageSpeedGrader.
- Tune the Apache webserver.
- One idea is using ApacheBuddy
- Try the various MPM modules listed in Easy Apache -> Exhaustive Options. There are "More Info" links next to each module.
- Load test your site using Siege or ab - Apache HTTP server benchmarking tool. Load testing will help you discover how many connections you can handle.
- Time it again.
- Buy additional RAM or CPU cores.
Check the website and server logs:
The last log can be downloaded with an SFTP program, like Filezilla, using the username of root and port 22.
Also, the `sar` shell command is good for history.
This command can be run via SSH from your main cPanel username or as root.
sar -r is also good for looking at RAM usage history.
You can see what others are doing to optimize their servers at cPanel forums: Optimization.
cPanel forums: Troubleshooting high server loads on Linux servers is only one of many examples that can be found on the Optimization forum.