M
M
Maxim Grekhov2014-06-29 01:22:07
linux
Maxim Grekhov, 2014-06-29 01:22:07

Why web servers hang on Linux?

Hello. I'm doing performance testing of web servers on ubuntu server running in virtual box. I load the servers with requests and can not achieve stable operation in any way. Hang-ups occur from time to time. The system does not get up - no, on the contrary, the processor load drops to 0 and the server simply does not process requests. It takes about 5 seconds and the server in a hurry starts to process everything that has accumulated. This is all visible on the graph of the program that I use to create the load (LoadUI).
473ff1b19adb4ac0944df3f45307e214.png
At first I used apache2, now I'm testing with nginx (the virtual machine was created with 0 installation of another copy of ubuntu server) - the result is the same, unstable work. What could be the problem?
I give virtual machines 1 core (i7) and 1 gigabyte of RAM (all not used).
Update 1:
In a comment on the first answer, I explained that "lags" directly depend on nginx's keepalive_timeout. I don't understand what causes such overhead.
Update 2 :
It turned out that the problem was in the program for testing, it did not respond well to keep alive. Installed JMeter, it is at least less user friendly, but it works more stable.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nazar Mokrinsky, 2014-06-29
@Sterk

Perhaps because of the keep-alive, the limit of active connections is simply exhausted?
You can try the tips from this article: https://stackoverflow.com/questions/410616/increas...

A
Alexey Cheremisin, 2014-06-29
@leahch

Maybe the problem is in the host on which the virtual machines are spinning? It's not Windows by any chance?

S
Sergey Petrikov, 2014-06-29
@RicoX

It looks like the problem is in the hypervisor, try the same thing on another. It is also interesting what exactly is happening at this moment on the virtual machine itself, the conclusions of atop, iotop at this moment would be seen.

N
neol, 2014-06-29
@neol

I guess it goes something like this:
- the client sends an HTTP1.1 request
- nginx opens a keep-alive connection and returns a response
- the client closes the connection
- nginx keeps the connection open until the keepalive_timeout expires
- when the number of open connections reaches some values ​​(can be calculated using netstat), nginx stops processing requests.
Check the value of worker_connections/worker_processes, it might be them. Well, or something from the system limits.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question