| Author |  | 
| flatcircle 
 
 
 Joined: 27 Jun 2006
 Posts: 79
 
 
 | 
|  Posted: Wed 01 Sep '10 20:55    Post subject: ThreadsPerChild - MaxRequestsPerChild settings |   |  
| 
 |  
| Hello 
 I'm puzzled about those 2 directives.
 
 Can I stick to the default settings for Apache MPM winnt:
 
 ThreadsPerChild 64
 MaxRequestsPerChild 0
 
 Or can I adjust these (and how) to tweak performance?
 I have changed ThreadsPerChild to 256 but I noticed no change in apache performance. Is a higher value better or not?
 
 Regards.
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Tue 14 Sep '10 23:47    Post subject: |   |  
| 
 |  
| The ThreadsPerChild is the number of simultaneous connection apache can handle. That is in most cases not the bottleneck. Often is the the OS. If not windows server the number of connection are limited. Or the limitation if a slow harddisk or not enough RAM. 
 MaxRequestsPerChild is the number of request the child process do until apache restarts. If you don't have crashes you should keep it to 0 (zero) which means it runs infinite.
 
 One of the questions in my mind is: how many simultaneous connection does your apache handle? Do you serv only static content or dynamic?
 |  | 
| Back to top |  | 
| flatcircle 
 
 
 Joined: 27 Jun 2006
 Posts: 79
 
 
 | 
|  Posted: Wed 15 Sep '10 16:01    Post subject: |   |  
| 
 |  
| I'm testing the latest build (Apache 2.2.16) from this site. 
 I saw that those 2 directives aren't even in httpd.conf so the default is used:
 
 MaxRequestsPerChild 0
 ThreadsPerChild 64
 
 I serve a lot of dynamic content. Is there any difference in the directives above when serving static content?
 
 Regards.
 |  | 
| Back to top |  | 
| glsmith Moderator
 
  
 Joined: 16 Oct 2007
 Posts: 2268
 Location: Sun Diego, USA
 
 | 
|  Posted: Wed 15 Sep '10 18:42    Post subject: |   |  
| 
 |  
| true, defaults are used. they are in conf/extra/httpd-default.conf I've never needed to change them so can't really answer that.
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Wed 15 Sep '10 22:00    Post subject: |   |  
| 
 |  
| Increase ThreadsPerChild can help if you have a server OS and a lot of connection. For dynamic content you need a fast CPU with a lot of cores and a lot of RAM   
 Well to inscrease the speed it is recommend to serve the static content e.g. pictures / javascript / css from another subdomain. Cause the browser opens only 2 connections to a single domain.
 |  | 
| Back to top |  | 
| Kanashii 
 
  
 Joined: 17 Jul 2006
 Posts: 155
 Location: Porando
 
 | 
|  Posted: Thu 16 Sep '10 15:46    Post subject: |   |  
| 
 |  
| My CFG max is 1920 
 <IfModule mpm_winnt.c>
 ThreadsPerChild 1920
 MaxRequestsPerChild  0
 </IfModule>
 
 No need server edition for windows need only Tweak TCP and some cfg
   
 TCP stack can be change that in nmap show like FreeBSD
 
 netsh interface tcp set global rss=disabled autotuninglevel=disabled
 netsh interface ipv4 set subinterface "Internet" mtu=1402 store=persistent
 netsh interface tcp set global ecncapability=enabled
 netsh int tcp set global rss=enabled
 netsh int tcp set heuristics disabled
 netsh int tcp set global congestionprovider=ctcp
 fsutil behavior query disabledeletenotify
 
 sc.exe config "AudioSrv" start= disabled
 sc.exe config "wscsvc" start= disabled
 sc.exe config "CscService" start= disabled
 sc.exe config "WinDefend" start= disabled
 
 
 bcdedit /set {default} recoveryenabled No
 fsutil behavior query disabledeletenotify
 chkntfs/t:4
 powercfg.exe /hibernate off
 
 
 [REGISTRY]
 
 Windows Registry Editor Version 5.00
 
 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
 "TcpMaxPortsExhausted"=dword:00000005
 "SynAttackProtect"=dword:00000001
 "KeepAliveTime"=dword:00007530
 "TcpMaxHalfOpen"=dword:00000190
 "TcpTimedWaitDelay"=dword:0000005a
 "MaxUserPort"=dword:0000fffe
 "TcpNumConnections"=dword:00fffffe
 
 
  	  | Quote: |  	  | Cause the browser opens only 2 connections to a single domain. | 
 Firefox is about 8 and chrome has more
 
 network.http.max-persistent-connections-per-server" 8
 
 For example map.google.com every image its on cnd
 
 For small web page 8 is enough
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Thu 16 Sep '10 17:11    Post subject: |   |  
| 
 |  
| What are these services you disable? I can identify only Windows Defennder and Windows Audio. |  | 
| Back to top |  | 
| Kanashii 
 
  
 Joined: 17 Jul 2006
 Posts: 155
 Location: Porando
 
 | 
|  Posted: Thu 16 Sep '10 19:01    Post subject: |   |  
| 
 |  
| sc.exe config "AudioSrv" start= disabled 
 Windows Audio
 
 sc.exe config "wscsvc" start= disabled
 
 Security center
 
 sc.exe config "CscService" start= disabled
 
 Windows Offline Files Service
 
 sc.exe config "WinDefend" start= disabled
 
 Windows defender
 |  | 
| Back to top |  |