apache:architecture
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
apache:architecture [2014/09/26 13:34] – [MPM Prefork Architecture] admin | apache:architecture [2016/01/27 04:58] – [optimize load module apache] admin | ||
---|---|---|---|
Line 11: | Line 11: | ||
Config example:< | Config example:< | ||
< | < | ||
- | StartServers | + | StartServers |
- | MinSpareServers | + | MinSpareServers |
- | MaxSpareServers | + | MaxSpareServers |
MaxClients | MaxClients | ||
MaxRequestsPerChild | MaxRequestsPerChild | ||
- | </ | + | </ |
- | </ | + | |
check config: | check config: | ||
- | * check number of httpd process:< | + | * check number of httpd process |
ps -eaf | grep httpd | ps -eaf | grep httpd | ||
</ | </ | ||
+ | root 1629 | ||
+ | apache | ||
+ | apache | ||
+ | apache | ||
+ | apache | ||
+ | apache | ||
+ | apache | ||
+ | </ | ||
+ | * run load test with 20 concurrecy requests to server:< | ||
+ | ab -n 200 -c 20 http:// | ||
+ | </ | ||
+ | ps -eaf | grep httpd | ||
root 1013 | root 1013 | ||
- | apache | + | apache |
- | apache | + | apache |
- | apache | + | apache |
- | apache | + | apache |
- | apache | + | apache |
- | apache | + | apache |
- | apache | + | apache |
- | </code> => 8 processes = StartServers * MinSpareServers | + | apache |
- | | + | apache |
- | ab -n 200 -c 20 http://shop.babies.vn/ | + | apache |
- | </ | + | apache |
+ | apache | ||
+ | </ | ||
===== MPM worker Architecture ===== | ===== MPM worker Architecture ===== | ||
* StartServers: | * StartServers: | ||
Line 170: | Line 183: | ||
apache | apache | ||
</ | </ | ||
- | * pmap -x 6726 | sort -ak +2<code bash> | + | * pmap -x 6726 | sort -nk +2<code bash> |
pmap -x 6812 | sort -nk +2 | pmap -x 6812 | sort -nk +2 | ||
00007fcacac95000 | 00007fcacac95000 | ||
Line 185: | Line 198: | ||
===== Optimize apache and PHP config ===== | ===== Optimize apache and PHP config ===== | ||
==== optimize load module apache ==== | ==== optimize load module apache ==== | ||
- | Config load modules | + | Config |
- | <code bash> | + | |
- | LoadModule authz_host_module modules/ | + | |
- | LoadModule log_config_module modules/ | + | |
- | LoadModule expires_module modules/ | + | |
- | LoadModule deflate_module modules/ | + | |
- | LoadModule headers_module modules/ | + | |
- | LoadModule env_module modules/ | + | |
- | LoadModule setenvif_module modules/ | + | |
- | LoadModule mime_module modules/ | + | |
- | LoadModule autoindex_module modules/ | + | |
- | LoadModule negotiation_module modules/ | + | |
- | LoadModule dir_module modules/ | + | |
- | LoadModule alias_module modules/ | + | |
- | LoadModule rewrite_module modules/ | + | |
- | </ | + | |
- | Explain directives with these modules: | + | |
<code bash> | <code bash> | ||
LoadModule authz_host_module modules/ | LoadModule authz_host_module modules/ | ||
+ | LoadModule access_compat_module modules/ | ||
LoadModule log_config_module modules/ | LoadModule log_config_module modules/ | ||
LoadModule expires_module modules/ | LoadModule expires_module modules/ | ||
Line 219: | Line 216: | ||
</ | </ | ||
==== optimize load module php ==== | ==== optimize load module php ==== | ||
+ | ===== Custom Config for Apache ===== | ||
+ | ==== Config disable warning log from browser ==== | ||
+ | With this config, the log will display in PHP error log but they don't display in browser side\\\ | ||
+ | Update httpd.conf | ||
+ | <code php> | ||
+ | < | ||
+ | php_admin_flag display_errors off | ||
+ | </ | ||
+ | </ | ||
+ |
apache/architecture.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1