logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Would like to try Apache again
Author
matrixebiz



Joined: 27 Sep 2017
Posts: 26

PostPosted: Wed 17 Oct '18 3:00    Post subject: Would like to try Apache again Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 17 Oct '18 10:49    Post subject: Reply with quote

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

PostPosted: Wed 17 Oct '18 13:12    Post subject: Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Oct '18 9:25    Post subject: Reply with quote

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

PostPosted: Thu 18 Oct '18 13:30    Post subject: Reply with quote

I didn't mean to put 150K I meant the max at 15K Smile

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Oct '18 15:01    Post subject: Reply with quote

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

PostPosted: Thu 18 Oct '18 15:30    Post subject: Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Oct '18 16:27    Post subject: Reply with quote

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

PostPosted: Thu 18 Oct '18 18:47    Post subject: Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Oct '18 20:05    Post subject: Reply with quote

Whoops, it is abs.exe not ebs...

ab is for apache bench
and
abs is for apache bench ssl Wink

for both see https://httpd.apache.org/docs/2.4/programs/ab.html

For status see https://httpd.apache.org/docs/current/mod/mod_status.html

Questions left to this? Please ask again or open a new topic for a new question.
Back to top
matrixebiz



Joined: 27 Sep 2017
Posts: 26

PostPosted: Thu 18 Oct '18 20:31    Post subject: Reply with quote

Thanks for the info. I check it out.
Back to top


Reply to topic   Topic: Would like to try Apache again View previous topic :: View next topic
Post new topic   Forum Index -> Apache