S
S
serious9112016-05-05 09:54:24
linux
serious911, 2016-05-05 09:54:24

Abnormal load on Apache and MySQL?

Hello.
In general, there is a small server on Ubuntu 14.04 LTS 64 bit, Genuine Intel 2.8 GHz, RAM 1G, 24
GB SSD.
It has a standard set: mysql 5.5.47 + php 5.5.9 + nginx 1.9.11 + apache 2.4.7 + monit + munin.
There are several sites on the server with a total attendance of up to 5-7k per day. Static caching (images, css, js) is configured on all sites + CloudFlare CDN service is used. No third party PHP frameworks/ORMs are used.
Everything seems to work fine, but sometimes there is some kind of abnormal load on Apache and MySQL. At the same time, the total traffic to the server does not grow significantly. At this point, the number of Apache processes, the number of connections to MySQL, the CPU and memory usage are growing sharply. Here are screenshots from the Munin Monitor:
7346b029c2a54c8b969cb426d1aacb8b.png042a1c0af25e4c148692913e8eb58fd7.pnge5766ceb635248bdb09e2ce95f8cca4b.png663b70d2c6184c76bc0fd2597ad35ac1.png802e343893da4055b0dff2008ef650a2.pngbec9cc6128f640989666ca25f43bd69b.png4e90449830114b6a8801ce77a8eddc8a.png5503260325ea4e2ebea152c999b5e205.png
Particularly interesting are the screenshots with the number of Apache processes and the number of MySQL connections. The screenshots also show that at the moment of bursts on the graphs, the number of requests to MySQL does not increase significantly.
In general, I'm already going to move to a more powerful server, but I'm not sure that this will solve the problem. Maybe this is such an attack on Apache?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2016-05-05
@opium

Well, look at the Apache logs at this moment and check which crons are running at this moment

D
Dmitry Shitskov, 2016-05-05
@Zarom

I would look at the apache and nginx logs - it will be clearer where the connections come from, from the same address, to which page, etc. Perhaps it is worth detecting such activity and blocking such unwanted guests for 15 minutes using fail2ban and iptables.
It is possible that the transition from the nginx + apache bundle to the nginx + php-fpm bundle will have a positive effect on performance. (Personal opinion)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question