Author |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Wed 17 Oct '18 3:00 Post subject: Would like to try Apache again |
|
|
Hello, I would like to try Apache server again, I have been using nginx on a Windows Server 2016 so I was wondering what you feel are the best settings on a server that gets 10k hits a day streaming HLS m3u8 streams?
Should I leave the default settings which doesn't enable httpd-mpm.conf or should I enable httpd-mpm.conf and adjust 'worker MPM' to high values? What values should I use;
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
How do I check and see which MPM is enabled? prefork or worker
Thank you |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 17 Oct '18 10:49 Post subject: |
|
|
on Windows there is only mpm_Winnt
On Linux you can see the mpm by
Code: | /usr/sbin/apache2 -V |
|
|
Back to top |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Wed 17 Oct '18 13:12 Post subject: |
|
|
I'm using it with Windows, so should I still enable httpd-mpm.conf instead of just leave the defaults?
if so, then uses values below for high traffic streaming server?
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_winnt_module>
ThreadsPerChild 150000
MaxRequestsPerChild 0
</IfModule> |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 18 Oct '18 9:25 Post subject: |
|
|
MaxRequestsPerChild 0 is a good value
ThreadsPerChild is too high
The default value is 64. ThreadsPerChild on windows defines the number of parallel connections. Also the max value on windows 15000 (15k) while yours is 10 times higher. Do you think you need that much connection to your server at the same time? |
|
Back to top |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Thu 18 Oct '18 13:30 Post subject: |
|
|
I didn't mean to put 150K I meant the max at 15K
So maybe I'm confused then on what ThreadsPerChild actually means, so my the scenario could be 15K unique users accessing the server at the same time streaming hls streams from it, so constantly accessing/pulling files.
if ThreadsPerChild = 1 does that mean only 1 user(child) can be connected streaming files only?
Is ONE "ThreadsPerChild" thread handling 1 user(child) at a time? or can ONE ThreadsPerChild handle more that ONE user at a time.
Thank you |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 18 Oct '18 15:01 Post subject: |
|
|
winnt mpm works mostly like event mpm.
On windows you have one parent process that listens on the ports. E.g. 80 and 443. There is a second process / child process that creates the threads. The threads handle the request. One thread can handle only one request at the time like with event mpm.
Code: |
http.exe (parent)
http.exe (child)
- thread 1
- thread 2
- ...
- thread n
|
|
|
Back to top |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Thu 18 Oct '18 15:30 Post subject: |
|
|
Okay thanks, so if I have a max of 5K users accessing the server at one time streaming file after file in a row from it then I will need ThreadsPerChild=5000, correct? so we can't have multiple child processes? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 18 Oct '18 16:27 Post subject: |
|
|
No you can't have mutiple child processes on windows. Event mpm on Linux offers a hybrid model of one parent with multiple childeren and n threads per child.
maybe ThreadsPerChild=5100 to be safe. However I recommend to run tests with ab.exe / ebs.exe from a different computer with concurrent connections and see how your website on your apache config performce. I noticed that often I can have a lower number of of Threads cause some requests are very short in time e.g. a css file, then the thread is free again.
Also the server-status page with ExtendedStatus on will help you to be more clear about the resources. Often a fast CPU and a fast SSD can do the trick more than adding more resources to apache. |
|
Back to top |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Thu 18 Oct '18 18:47 Post subject: |
|
|
Okay, thanks for the info.
Now all I have to do is figure out how to use ab.exe / ebs.exe and ExtendedStatus
Thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
matrixebiz
Joined: 27 Sep 2017 Posts: 26
|
Posted: Thu 18 Oct '18 20:31 Post subject: |
|
|
Thanks for the info. I check it out. |
|
Back to top |
|