Apache Worker/prefork
/application/apache/bin/apachectl-l | Sed-n '/worker\|prefork/p '
Worker.c
Server Mpm:worker
./configure--with-mpm=worke//compile-time specified, default is Prefork
Prefork Default
Use multiple child processes, with only one thread per child process
High efficiency, stability, security, more resources than worker consumption
vim/application/apache/conf/extra/httpd-mpm.conf
<ifmodule mpm_prefork_module>
Startservers 10//Service START process number
Minspareservers 10//Minimum Idle quantity
Maxspareservers 15//Maximum idle Quantity
Serverlimit 2000
MaxClients 1000//MAX process concurrency
Maxrequestsperchild 5000//The maximum number of processes processed by the child process 0 = Unlimited
</IfModule>
Ps-ef | grep http| Grep-v grep | WC-L//View concurrent connections
6
worker threads are combined with processes
vim/application/apache/conf/extra/httpd-mpm.conf
<ifmodule mpm_worker_module>
Startservers 2
maxclients Number of client connections//concurrent
Serverlimit 25//Total process Count
Minsparethreads 50
Maxsparethreads 200
Thread Limit
Threadsperchild The number of worker threads per server that lasts//
maxrequestsperchild 0//single subprocess accumulates up to less requests, default 0, unlimited meaning
</IfModule>
maxclient <= serverlimit* Threadsperchild
maxclient %threadsperchild =0
Cat/application/apache/conf/extra/httpd-default.conf
Timeout 300
KeepAlive on
Maxkeepaliverequests 100
KeepAliveTimeout 5
Usecanonicalname OFF
Accessfilename. htaccess
Servertokens full
Serversignature on
Hostnamelookups OFF
Number of concurrent connections
pstree-a | grep http |grep-v grep | Wc-l
110
Apache Web Services anti-theft chain
<directory "/usr/local/apache2/htdocs/cfan/pic/" >
Rewriteengine on
Rewritecond%{http_referer}!^http://website domain name/.*$ [NC]
Rewriterule. *\. (gif|jpg) $/HTTP instead of icon [R,NC]
</Directory>
configuration of Nginx anti-theft chain
Location ~* \. (gif|jpg|png|swf|flv|bmp) $ {
Valid_referers None blocked *.hequan.com Hequan z.com;
if ($invalid_referer) {
#rewrite ^/Http://www.hequan. com/403.html;
return 403;
}
}
This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1770655
Enterprise-level Nginx service Optimization (iii) apache+ anti-theft chain