⬆️ ⬇️

Available on server load

And so, the purpose of this topic: the visualization of the site load on one ordinary server.

image

The article will be an example of one site and one server try to look at the basic steps to reduce the load on the server.





Website: Wordpress with daily traffic according to GA

image



North: with two Intel® Xeon (TM) CPUs 2.80GHz with 4GB of RAM onboard.

')

History: A couple of years ago, an idea arose to create a small website for one local network of our city, as time went on, attendance grew and the provider asked to move to its hardware due to the large consumption of resources, the provider is ready to host the hardware.

So the usual ATX system builder with a p4 3000c processor and 1 GB of memory was assembled.

On the server there was ubuntu Dekstopnaya Pravda :) and quietly peacefully the site developed enough resources for everything, but when the site had over 3000 posts, the database grew to a gigabyte (then there was WP 2.3) and I had to transfer the database to another server, the server was found, had one processor 2.8 and memory gig, he took the burden of the database. as time went on, and in the evenings the server with the database simply stood at 100% load, while site traffic was around 700-900 unique per day.

Then there was a terrible state of emergency and I lost all the data with fresh backups, and the old one didn’t make much sense. (Yes, yes, the backup should be correct!) So life began with a clean slate, along the way I wondered about optimization and reducing the load.

Thus, Ubuntu 8.04 LTS was installed, Apache2 was hidden behind nginx, the content of the site carried almost the same statics: pictures, videos, flash drives. (About 80,000 files) Nginx gave stats with a bang without spending much money.



Next was the "tuning" of the database I will try to tell about it in a separate topic. :)



Along the way, was bought on ebay server for $ 127 shipping to Siberia + $ 100

image



Attendance grew, the database grew -> the load grew and there were less and less free resources.

At that moment she looked like this. CPU and Memory.

image

image



Next was connected eAccelerator

image

image

there is a sharp decrease in memory consumption.

Next on the benefits of wordpress caching plugins.

We include the Hyper Cache plugin, although it is now included in the distribution, but I could be wrong.



image

image

The CPU load noticeably drops.

Turn on WP Super Cache plugin

image

image

Especially the difference is not noticed :)



Now a little about the test method. In fact, the test was conducted in the reverse order, since The system is rebuilt and works fine. take turns once a day at about the same time turning off one element ...

The test was carried out for 4 days.



I would also like to hurt the performance of MYSQL and Wordpres as a whole. For now, I can say that Wodrpress generates 70-100 requests to the database for downloading the 1st page, for which there is a separate hello for this CMS and the creators of plug-ins who did not pass the “database” course.

Source: https://habr.com/ru/post/73926/



All Articles