I
I
iandriyanov2012-04-19 10:42:41
linux
iandriyanov, 2012-04-19 10:42:41

Apache2 prefork - Indian control?

I ask everyone who has encountered or once got into a situation like mine:
- Gentoo_x64 server
- Apache_mpm_prefork
Regularly kills all memory and exceeds LA. It's impossible to track adequately at all, instantly LA3 > LA9 and that's it! Iron reset only helps.
- How to track?
- How or how to limit the capabilities of the Indian, for example, if the process is more than 1 gig, so that the system brings down such a process?
- Tell me software for recording system counters, for example, spying on processes that eat memory (Process name, time)
Many thanks to everyone. I'm already tired of fighting with instability and crutches. Any possible information will be glad.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Vitaly Peretyatko, 2012-04-19
@viperet

As already mentioned above - set a limit on the number of Apache workers, but before Apache - nginx. Set it up so that it is he who gives all the statics, only dynamics is allowed to the Apache.

B
Boris Syomov, 2012-04-19
@kotomyava

It is trite to set the maximum number of "children", according to your resources.
If the processes themselves grow in you, which is unlikely, you need to look for the cause, because. this is not normal, and it is necessary not to make crutches, but to solve the problem.
Regarding monitoring and processes by resources / availability / health, and their launch / restart / alerts, see monit, but this should not be done instead of solving the problem, but as a “just in case” option to increase reliability.

N
Nastradamus, 2012-04-19
@Nastradamus

Set MaxRequestsPerChild to 1 and see what happens. Then raise to 10 or higher (depending on the situation), if it helps.
The fact is that the size of the worker is equal to the size of the largest task ever performed by it. And this size does not decrease when working out subsequent tasks up to killing by MaxRequestsPerChild.

B
bdmalex, 2012-04-19
@bdmalex

In my opinion, it is worth looking towards scripts that consume a lot of memory and optimize them

A
AnViar, 2012-04-19
@AnViar

Track: write your own scripts or use ready-made ones, for example
Limit: the most direct way to limit a process by memory is virtualization. Consider openvz, xen, kvm. You can also play around with limits.conf at the user level.

B
BasilioCat, 2012-04-22
@BasilioCat

Maybe you don't need Apache at all? Python/Django and Ruby/Rails work great as FastCGI servers, requests to which can be forwarded directly from Nginx. PHP-FPM - and even more so. Perl/CGI and Perl/mod_perl are rarely used now, yes, you can't do without Apache. Although there are more lightweight servers for simple CGI. If you do not have mass hosting for clients, but several sites for yourself, perhaps one nginx will be enough

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question