M
M
Maxim Khodyrev2013-12-29 09:42:04
PHP
Maxim Khodyrev, 2013-12-29 09:42:04

apache, mysql. Why so many processes and high memory consumption?

Server on CentOS (8 cores, 16 GB RAM), nginx + httpd + mysql + memcached bundle.
The command (number of processes)
pgrep httpd | wc -l
gives 88, although there are clearly fewer users on the site at the same time.
Each httpd process pulls a mysql connection with it, eventually the memory overflows sooner or later and the server crashes.
A couple of times it happened that memcached crashed (1.4.15, is on the same server), there is a suspicion that the bottleneck is mysql and that when memcached crashes, mysql simply cannot cope.
e3fc5d839b9a5006d305296c5ac6578e.jpeg
Specialists, what do you think, where is the bottleneck and what needs to be done to get rid of it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2013-12-29
@bondbig

Well, for starters.
1) Enable server-status (including Extended) and watch.
2) Watch Apache logs
3) Install mytop, watch
4) Enable slow log, study
5) Install atop, iotop, observe
Next, you can install newrelic, study. Well, I hope that there is some kind of historical monitoring? At least munin?

V
Vlad Zhivotnev, 2013-12-29
@inkvizitor68sl

Cron does nothing to start these processes?
What do you think of the visitors? Logically or by eye? If you count RPS, and not an unnecessary number - is it normal?
Does Nginx give all the static itself? Anything extra in apache is not proxied?
Tumblers are generated by some non-Apache, by any chance?
What are the processes doing anyway? What's in strace?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question