How to optimize and speed up your server by more than 20%
Many people think that a hardware upgrade is the best way to speed up a server. It seems intuitive that more memory, or CPU can deliver better performance. But, hardware upgrades are only a temporary fix, if the server’s services are not optimized.
A vast majority of online applications are hosted using a web server front-end and database servers in the back-end. Over time, these services tend to cause CPU, memory and I/O bottlenecks, that lead to poor performance or even server crashes.
At Bobcares, the first line of defense against such performance issues is 24/7 server monitoring and rescue.
Our experts monitor customer servers round the clock. When we detect an anomaly, like slow website speed, we immediately login to the server, kill abusive processes, and prevent a server crash.
But waiting for an issue to happen, and jumping in to rescue is not the best way to keep a server stable. That is why we do regular Preventive Sever Maintenance.
Every couple of weeks, or when we detect an abnormal value in server metrics, we audit the server performance. We check why the load average, or memory usage has gone up, track it down to an abusive process, and tweak the server settings, so that the bottleneck is removed.
[ Making your server stable doesn’t have to be hard, or costly. Click here to keep your server rock solid (plans starting at $25/month). ]
3 steps to speed up your server
For websites, we’ve seen performance bottlenecks in 3 main places – the website code, the web server and the database server. So, no optimization is complete unless it fixes clogs in all these three areas.
Here’s a generic overview of how to optimize website, web server and database server:
Step 1 – Make your website lean and mean
We help maintain websites of several small to large online businesses. Many of these sites use Content Management Systems (CMS) like WordPress, Magento, Joomla, etc.
Unless maintained carefully, these CMS applications tend to accumulate needless bulk via additional themes, plugins and media. Here are a few things we do on a regular basis to cut down bloat, and keep our customer sites trim and fit.
Delete un-used themes, plugins and add-ons
Themes and plugins are a great way to extend a site’s functionality. However, we’ve seen many poorly coded plugins and themes that delays page load speed by more than 10 seconds.
We support many websites that use Content Management Systems like WordPress. During our periodic performance audits, we review plugins and themes on these sites to make sure that there’s no performance impact.
Many a times we’ve seen duplicate plugins, poorly coded themes, and external script calls dragging down the website. In these situations, we help the webmaster tweak the plugin, or recommend a faster alternative that doesn’t impose a performance penalty.
When website owners signup for our Server Management Services, one of the things we test at the outset is the number of elements in a single web page. If a page uses more than 30 files, we work with the webmaster to cut it down to as low as 20.
Optimize images and defer its loading
While an average CSS file have a size of 5 KB, even a small image can be as big as 50 KB. Many webmasters do not think of images as a bandwidth hogger, and do not reduce their size.
Image optimization is one of the basic things we do in the customer sites we maintain. By choosing the right image format (such as JPG), reducing the resolution, and color density, we’re often able to reduce the size of even a banner image to less than 50 KB.
On top of it, we customize the website to defer image loading only when a visitor scrolls to the image location in the page. This makes sure that the initial page load is not blocked by the image download.
A majority of website files are text files such as HTML, CSS and JS. These files can be compressed to less than a 10th of their size, which will result in faster file download speed, and thereby faster page loads.
We maintain websites for small to large online businesses. We periodically audit the page load speeds of these sites, and page compression efficiency is one of things we check.
In some sites that have abrupt traffic spikes (such as during marketing campaigns), compression could cause a performance impact. This is because compressing a page requires server CPU. In such sites, we use statically compressed CSS and JS files, so that CPU usage is saved.
[ You don’t have to be a server expert to keep your site fast and stable. Click here to keep your servers lightning fast. Our Server Maintenance plans start at $25/month. ]
Step 2 – Optimize your web server
Most webmasters go with the default settings when they setup a web server. But, there are a whole lot of things you can do to make the web server lightning fast.
When website owners signup for our Server Management Services, we implement a slew of server optimizations that result in over 3 times improvement in page load speed. Some of them are listed here:
Choose the right web server
Almost all Linux hosting providers use Apache as their web server. So, many webmasters assume that Apache is the only solution out there.
We maintain several high traffic web sites. In these sites, we were able to improve page load speeds by switching Apache with Nginx or OpenLiteSpeed that can better handle large number of simultaneous connections.
That being said, page load speed won’t magically improve just by switching your server. It still needs to be customized to match your site traffic and resource usage of your pages. That is why we audit server performance at least once every 2 weeks, and fine tune the settings to keep the server blazing fast.
Optimize web server settings
As a website grows, more site features are added, and site traffic increases. Both these result in heavy resource usage, and lead to performance bottlenecks.
Such performance issues can happen at any time, which is why we monitor our customer servers 24/7. When we detect a slow page load time, or a resource usage spike, we immediately login to the server, kill the load spike, and tweak the server settings so as to prevent a similar issue in the future.
Here are a few common settings we tweak to speed up Apache webservers:
- Timeout – This setting determines how long Apache will wait for a vistor to send a request. In busy servers, we set it up to 120 seconds, but it is best to keep this value as low as possible to prevent resource wastage.
- KeepAlive – When “KeepAlive” is set to “On”, Apache uses a single connection to transfer all the files to load a page. This saves time in establishing a new connection for each file.
- MaxKeepAliveRequests – This setting determines how many files can be transferred via a KeepAlive connection. Unless there’s a reason not to (like resource constrains), this setting can be set to “0”, that is, “unlimited”.
- KeepAliveTimeout – This setting makes sure that a KeepAlive connection is not abused. It says how long should Apache wait for a new request before it resets the connection. In heavily loaded servers, we’ve found 10 secs to be a good limit.
- MaxClients – This setting tells Apache how many visitors can be served simultaneously. In busy servers (such as shared servers), we’ve found 512 to be a good value. However, note that setting it too high will cause resource wastage, and setting it too low will result in lost visitors.
- MinSpareServers & MaxSpareServers – Apache keeps a few “workers” on stand-by to handle a sudden surge of requests. If your site is prone to visit spikes, configure these variables. In heavily loaded servers, we’ve found MinSpareServers value of 10 and MaxSpareServers value of 15 to be a good limit.
- HostnameLookups – Apache can try to find out the hostname of every IP that connects to it, but that would be a wastage of resources. To prevent that, set HostnameLookups to “0”.
IMPORTANT – The values recommended for these settings are highly subjective to the volume of traffic received by web servers managed by us. So, we’d advice you to test these settings yourself before applying it on production servers.Bobcares provides Outsourced Web Hosting Support and Outsourced Server Management for online businesses. Our services include 24/7 server support, help desk support, live chat support and phone support.