How to reduce the load on the CPU and database Print

  • 0

As site traffic increases, the load on CPU and MySQL increases

To avoid blocking a subscription due to violation of restrictions
There are several methods.


1. Enable caching.


Caching time depends on what kind of site you have. If the speed of adding and updating information does not play a significant role (for example, for business card sites), you can set it to 30-90 minutes.

 

2. Reduce the number of queries to the database.

Each included component, module, plugin or extension is an additional query to the database. Especially if it’s related to any content. Crookedly written modules can make dozens of queries to the database. For example, the “recent records” module can make not just 1 query to the database, but as many records as are displayed.

In this case, you need to remove the module, look for another one, reduce the number of requests


Block overly active bots.

You need to go to /your_site/access_log and see who is there and what is there. If we find bots that are too active and of no use, we block them.

To do this, go to .htaccess and add the following lines:

RewriteCond %{HTTP_USER_AGENT} bot_name[OR]
bot_name is the name of the bot.


Was this answer helpful?

« Back