×


Methods to reduce server load

Are you trying to reduce server load?

This guide is for you.


The load average tries to measure the number of active processes at any time. 

As a measure of CPU utilization, the load average is simplistic, poorly defined, but far from useless. 

High load averages usually mean that the system is being used heavily and the response time is correspondingly slow.

All of us want our sites to be up round the clock. However, a major concern is the load speed of the website.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Ubuntu Server queries.

In this context, we shall look into effective methods to reduce the server load.


More about Server load ?

As we all know, the load speed of websites mainly depends on the constant load that the server is maintained.

A downfall is that we can't monitor the server load at all times.

However, to know the server load, we can use the below command:

# uptime
8:14am up 270 days, 13:23, 2 users, load average: 3.79, 4.15, 4.39

Since our Support Experts see a lot of load issues on a daily basis, here are few steps to follow to decrease the load in the server.


What causes high load in the Server?

Few common things that cause high server load are as follows:


1. Memory shortage issues with the server.


2. MySQL queries are more on the server:

[root@host ~]# mysqladmin proc stat
+——–+——+———–+—-+———+——+——-+——————+
| Id | User | Host | db | Command | Time | State | Info |
+——–+——+———–+—-+———+——+——-+——————+
| 954983 | root | localhost | | Query | 0 | | show processlist |
+——–+——+———–+—-+———+——+——-+——————+
Uptime: 443376 Threads: 1 Questions: 13376805 Slow queries: 15 Opens: 2211 Flush tables: 1 Open tables: 611 Queries per second avg: 30.170

3. If the site is using WordPress with more unwanted plugins and themes.


4. Poor configuration of Apache/MySQL services.


5. Heavy traffic caused by any IP addresses can raise the more number of HTTP connections in the server:

netstat -plan |grep 80|awk ‘{print $5}’ |cut -d: -f1 |sort |uniq -c |sort -n

6. The server load will be high if there are more frozen mails in the queue:

exim -bpr | grep frozen | wc -l


How to reduce server load ?

In order to reduce the server load, our Support Experts suggest the following steps:


1. In case of memory shortage issues, we increase the memory size of virtual RAM.


2. If the MySQL queries are more in the server, we decrease it by optimizing the MySQL.

Executing "mysqladmin proc stat" command, will give us the MySQL user with a number of slow queries running in the server.

We can reduce the MySQL slow queries by optimizing the different values in the MySQL configuration file.


3. From the Apache domlogs of a particular domain, we can find the unwanted plugins and themes causing high server load. To reduce the server load we can disable those plugins and themes.


4. We can improve the standard of MySQL and Apache configuration by optimizing the MySQL and Apache services.


5. We can reduce the network traffic by blocking the IP addresses which is causing more HTTP connections.


6. The load in the server will reduce once if we delete the frozen emails in the Exim queue:

exim -bpr | grep frozen | awk {‘print $3’} | xargs exim -Mrm


[Couldn't reduce server load? We'd be happy to help you further. ]


Conclusion

This article covers tips to reduce server load. The load speed of websites mainly depends on the constant load that the server is maintained. 

Load expresses how many processes are waiting in the queue to access the computer processor. This is calculated for a certain period of time, and the smaller the number the better. 


Tips To optimize and speed up your server:

1. Enable caching.

2. Setup a fast reverse proxy.

3. Choose the right application server.

4. Fine tune your web server.

5. Turn on HTTP/2.

6. Defragment your database tables & optimize server settings.

7. Fix your DNS query speed.

8. Trim down your site's critical rendering path.


Why is your Website server slow?

The cause of slow servers usually lays with the web host. 

You could be having a slow site because you are hosted on a free web hosting. 

You are on a low quality hosting service with poor support. 

Or your site needs a higher spec hosting account with more resources eg a VPS.

A large volume of unoptimized images is usually the most common reason behind website slowness. 

High-resolution images can consume lots of bandwidth while loading. 

Uploading larger sized images and then scaling them down can unnecessarily increase the size of your web page – causing your website to load slowly.