D
D
DmitryKoterov2011-11-01 00:02:32
PHP
DmitryKoterov, 2011-11-01 00:02:32

Impact of nice and Load Average on web server performance?

Here's what's been bothering me lately: there is a machine on which it spins:
- a web server (php-fpm) with nice=0;
- and a few dozen more non-critical real-time demons with nice=10;
- total processes on the machine - about 400 (in total for all openvz virtual machines).
Demons do most of the work. The disk is not loaded. At the same time, the Load Average on the machine is around 12 (8 cores). If the demons are disabled, then LA will be about 1. The rest of the processes (which are not demons and not the site) do almost no load at all, there is also a lot of free memory.
Question: How realistic are these daemons to interfere with the return of the site by the web server? How much do they slow it down (and do they slow it down)? In theory, processes with nice=10 should not interfere with processes with nice=0. But there is a feeling that the machine is still overloaded at the same time, the site is running slower than it could.
Can you comment?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DmitryKoterov, 2011-11-04
@DmitryKoterov

In general, they took out the site on a separate machine. And you know, he accelerated a lot. It turned out that the site itself, when there are no other processes around, makes LA only around 0.8.
So the answer to the question, can processes with nice=10 in Linux affect a web server with nice=0 when there is a lot of free memory, the disk is not loaded, the total processes on the machine are about 400, and the CPU idle is about 40% - Definitely YES, they can.

L
Lampus, 2011-11-01
@Lampus

In order to understand how nice affects the operation of a particular process in Linux, you need to understand how the process scheduler works. nice only affects the so-called static priority of a process. The problem here is that Linux uses dynamic process scheduling. That is, for each process, the allocated time quantum is considered individually. In extreme cases, processes can be divided into two types: processor-limited and I/O-limited. Depending on which group the scheduler assigned the process to, it is given one or another time slice. If the process does not count much, but is waiting for more I / O, then it is considered interactive and it is given a smaller time quantum, but a higher priority. If the process is actively using the processor, but it is almost not worth waiting, then it is considered limited by processor performance, therefore it is given a lower priority, but a large time quantum. Thus, the nice parameter only moves the priority that the scheduler calculated left-right (more precisely, the resulting task priority is a function of static and dynamic priorities). The work of the scheduler is very well described by Robert Love in the book “Developing the Linux Kernel”, but in the old editions the work of the scheduler, which is no longer relevant for modern kernels, is described. If you're really interested, check out this document: that the resulting task priority is a function of static and dynamic priorities). The work of the scheduler is very well described by Robert Love in the book “Developing the Linux Kernel”, but in the old editions the work of the scheduler, which is no longer relevant for modern kernels, is described. If you're really interested, check out this document: that the resulting task priority is a function of static and dynamic priorities). The work of the scheduler is very well described by Robert Love in the book “Developing the Linux Kernel”, but in the old editions the work of the scheduler, which is no longer relevant for modern kernels, is described. If you're really interested, check out this document:www.ibm.com/developerworks/en/library/l-cfs/index.html

A
Andrey Shaydurov, 2011-11-01
@GearHead

what do you have with the operator? is it enough to spare? I once had problems with the performance of web frontends with nice=-15 due to the fact that daemons running not as daemons (+ in STAT) periodically ate up a significant part of the memory at the most active moments and forced the frontends to swap.

M
Maxim, 2011-11-01
@maxout

Daemons give your load to the processor or to the disk, because of which LA grows when they work? The conclusions here will apparently be obvious, if the load is on the percentage, then the demons should not affect php, and if on the disk, then they slow down the entire server, regardless of the nays.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question