Which Linux distribution to choose for web hosting Apache PHP sites?

0 like 0 dislike
6 views
Basically we have to host the audio recording of conferences.
The traffic is not very large (4000 visitors per month in GA), but of materials about TB.
For this case there is a CMS developed by us, who knows how these records are to lose the right way to look for etc.
Requirements: PHP 7, Apache, MySQL.

I took on a OVH dedicated server (32GB RAM, 8cores), it came at Hyper-V and Ubuntu 18.04 VM (8GB RAM, 3cores).
And it slows down. And it seems from over the network. One of the symptoms is sometimes the site opens quickly and sometimes the first page waiting for 10-20 seconds!
Until understood, saw me hanging a bunch of connections in the CLOSE_WAIT state:
root@ub18s:/home/slavik# netstat-tupn | grep CLOSE_WAIT
tcp 1 103452 142.44.185.104:443 213.180.203.53:58602 CLOSE_WAIT 30305/apache2
tcp 1 99258 142.44.185.104:443 213.180.203.53:39694 CLOSE_WAIT 30937/apache2
tcp 1 29358 142.44.185.104:443 37.9.113.126:41087 CLOSE_WAIT 32766/apache2
tcp 1 114636 142.44.185.104:443 213.180.203.53:54569 CLOSE_WAIT 30338/apache2
...
And this is not good. And about this is the questions on StackOverflow, but the solutions I found - like the problem of network stack Ubuntu.

Well I tried and tadalail another VM is now CentOS 7 (8GB, 3 cores).
All working class, fast, a backlog CLOSE_WAIT present.
But in CentOS is constantly hanging single process kswapd0, which loads one core to 100%. It seems to be associated with swapping memory. Also tried all different settings - not overpowered, too similar to the issue of the OS kernel.
Though it shouldn't be displayed - nothing ever seems slow, but somehow unpleasant.

Now I think to try Debian? 9.6?
Or is there some configuration that people advise?

P. S. Put a 9.6 Debian + Nginx + PHP-FPM. Here for about a month works. Very stable.
by | 6 views

4 Answers

0 like 0 dislike
Why do you need Hyper-V? Overhead expenses of the blue.

The distribution is not critical, in fact. The network stack is the same, only some default settings vary, but they may and can change.

But the problem you have, most likely, not in CLOSE_WAIT, all the same, and not in the networking stack, and that all Apache processes are busy processing existing requests, i.e., the return on your audio data. And it would be better to do it not using Apache at all.
by
0 like 0 dislike
What's the difference if Apache or Nginx, if the problem is at the kernel level of the OS?


If you think that the problem is on the kernel level of the OS, then all distributions of Linux - the kernel of Linux.
There is no reason to change distro, to deal with your problem on the current distribution.
by
0 like 0 dislike
Now I think to try Debian? 9.6?
It is necessary not to try and fix the problem. To change Ubuntu to Debian (or Vice versa) is the flea.
by
0 like 0 dislike
Specifically in my practice, faced a problem in module apache remoteip, but this is a very specific case was. Saw your issue report tab in the Network browser. There is a parameter TTFB, which may indirectly indicate which side of the issue. Sometimes apache thinks for a long time, when the cut frequency of the processor, but it is more important for hosting. Well, the php runtime does not hurt to measure.
by
110,608 questions
257,186 answers
0 comments
28,665 users