???? ?? ????? NGINX ??? ?????? ??, ???, ??, ??, ?? ? ??? 6 ?? ???? ???????. 1. Worker_Processes? CPU ?? ?? ???? ?? ??? ????? ?? Worker_Connection (4096)? ??????. 2. ??? ?? ????? ?? ? TCP ?? ?? (? : SomaxConn, TCP_TW_REUSE)? ???? Epoll ??? ??? ??????. 3. ??? I/O? ??? ?? ?? ???? ?? ?? ?? ? Open_File_Cache? ??????. 4. ???? ???? ?? ??? GZIP ?? (?? 1-3)? ??????. 5. ?? ??? ??? ??? ?? ??? ? ??? ???? ?? ???? ????. 6. ???? ?? ??? ? CDN? ?? ?? ????? ??????. ????? ???? ??? ??? ?? ??? ???? ????? ?????? ???? ???? ???? ???????.
???? ?? ????? NGINX? ??? ? (?? ? ?? ?? ?? ?? ?? ?? ??) ??? ??? ???? ????. ???? ???? ?? ??? ???? ?????? ????? ???? ?? Nginx ??? ?? ???? ?? ???????.

???? ?? ???? ????? ?? ???? ???? ??? ??? ????.
1. Nginx ??? ???? ? ?? ??
Nginx? ??? ??? ??? ????? ?????. CPU ??? ?????? :

- CPU ?? ?? ?????
worker_processes
??????.Worker_Processes Auto;
- ??? ?
worker_connections
?? :??? { Worker_Connections 4096; }
4 ?? ??? × 4096 ?? = 16,384 NGINX ???? ? ?? ?? (?? ??).
netstat
??ss -s
? ????????.
? ? :
worker_rlimit_nofile
???? "?? ?? ?? ??"??? ??? ??? ? ?? ????? ??? ?????.
2. ?? ? ??? ??? ???????
Nginx? OS? ???? ?? ? ????. ???? ?????? :
?? ????? ??? ????? (
/etc/security/limits.conf
) :NGINX ??? NOFILE 65536 nginx ?? nofile 65536
?? ??? (
/etc/sysctl.conf
) ??? TCP ?? ?? : :net.core.somaxconn = 65535 net.ipv4.tcp_max_syn_backlog = 65535 net.ipv4.tcp_tw_reuse = 1 net.ipv4.ip_local_port_range = 1024 65535
sysctl -p
? ??????.epoll
(Linux) ??? :??? { epoll ??; multi_accept on; }
3. ?? ??? ? ?? ???
- ??? ?? ?? ?????? ?? ?? ??? ??????.
?? / ?? / { 1y? ?????. add_header ?? ?? "??, ??"; }
-
open_file_cache
???? ??? I/O? ????.Open_File_Cache Max = 100000 ??? = 20s; Open_File_CACHE_VALID 30S; open_file_cache_min_uses 2; Open_File_Cache_Errors on;
4. GZIP ?? (??? ????)
??? ???? ???? ????? CPU? ??? ?? ???. ?? :
gzip on; gzip_min_length 1024; gzip_comp_level 3; # ???? ?? ?? # ?? 1–3 (CPU ? ?? ???? ??) gzip_types text/plain text/css application/json application/javaScript;
5. ???? ? ??? ????? ?????
- ?? ??? ?? ??? ?? ???? :
?? / ?? / { access_log off; }
- ??? ? ?? ?? :
access_log /var/log/nginx/access.log main buffer = 32k flush = 1m;
6. ???? ??? (??? ??)
-
upstream
???? ?? Nginx ???? (?? ?)?? ??? ??????.?? ??? { ?? _conn; ?? app1 : 8080; ?? app2 : 8080; }
- ?? ???? CDN? ???? nginx? ??? ????????.
?? ? : ab
, wrk
?? hey
? ?? ??? ???? ???? ???? ?? ?? ??? ??????. ?? ???? ???????.
-
nginx_status
(stub_status
? ?? ???) - CPU, ??? ? ???? I/O
- 5xx ?? ? ?? ?? ??
NGINX ???? ??? ?? ?? ??? OS, ????, ? ? ??? ? ?? ??? ???? ????. ?? ?? ???? ??? ?? ?? ??? ???? ??????.
? ??? ???? ?? NGINX ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Nginx? "ToomyopenFiles"??? ???? ????? ??? ?? ????? ?? ????? ??? ???? ?????. ???? ??? ????. 1. Linux ???? ??? ? ?? ??? ???? nginx? ?? ?? ??? ????? /etc/security/limits.conf?? ?? ???? ?????. 2. ?? ???? ????? nginx? worker_connection ?? ???? ??? ? ??? ??????. 3. ??? ?? ?? ???? ??? ?????. fs.file-max, /etc/sysctl.conf edit ? ?? ??? ??????. 4. ?? ? ??? ???? ????? Open_L ??? ?? ???? ?? ?? ??? ????.

?? Nginx ?? ??? ????? /etc/nginx/nginx.conf (ubuntu/debian, centos/rhel), /usr/local/etc/nginx/nginx.conf (Macoshomebrew) ?? ?? ?? ?? ?? ?? conf ????? ????. nginx-t, ps-ef | grepnginx? ???? ? ?? ??? ??? ?? ?? ??? ??? ??? ????? ??/-namenginx.conf ? locatenginx.conf? ???? ??? ?????. ?? ?? ???? ?? ??, ??? ?? ? HTTP ??? ???? ???? ??? ??? ??????.

????? HTTP ???? HTTPS ????? ????? "?? ???"??? ?????. ???? ??? ????. 1. ? ????? ?? ? ??? ??? ????? ??? ??? ?? ?? ??? ??? ??? ?? ??? ??????. 2. ??? ??? https ?? ?? ??? ??? http : //? https : //?? ????? //example.com/path/toto/resource.js ??? ??????. 3. CMS ?? ???????? ??? ?????? ??? ???? HTTP ??? ??? ???? SQL ??? ??????. 4. ??? ???? ??? ??? ?? ????? ???? ?? ??? ??? ???? HTTPS? ????? ?????.

GZIP ??? ????? ? ??? ??? ??? ????? ????? ??? ???? ? ????. 1. Apache ??? .htaccess ??? ??? ???? mod_deflate ??? ????? ??? ???????. 2.nginx? ??? ?? ??? ???? Gzipon? ???? ?? ??, ?? ?? ? ?? ??? ???????. 3. ??? ??? ? ??? ?? ?? ???? ??? ??? ?? ??? ??? ??? ? ????. ???? ?? ??? ???? ?? ?? ?? ?? ?? ?? ? MIME ?? ??????????.

stub_status ??? nginx? ??? ?? ?? ??? ?????. ?????, ???? ??? ?????. 1. ?? ?? ??? ?; 2. ?? ? ??? ? ?, ? ?? ?? ? ? ? ?? ?; 3. ??, ???? ???? ?? ?. ??? ??? ????? Nginx-V ??? ??-with-http_status_module ?? ??? ????? ??? ? ????. ????? ?? ?? ??? ?? ????? ??????. ????? ?? ??? ?? ??? ???? ??? ??? ???????. ?????, ??? ??? ?? Nginx ???? ?????? ?? ???? ???????. ???? ??? ?? ???? ?? ????. ??? ?? ???? ????? ??? ? ??? ??? ? ???? ???? ?? ? ? ????.

Nginx? HTTP/2 ?? HTTP/3 ??? ??????? ?? ??? ???? ???? ???????. HTTP/2? Nginx1.9.5, OpenSSL1.0.2 ? HTTPS ??? ??????. add-with-http_v2_module ?? ?? ?? ?? ?? ???? 443SSLHTTP2; ???? ???; HTTP/3? quic? ??????, ??? ?? BoringsSL ?? OpenSSLquic ???? ???? UDP ?? ??? ????? Nginx-Quic? ?? ?? ??? ?????. ?? ? ???? ??? ALPN? ????? ??, ??? ???, ??? ?? ? ??? ??? ?????. ?? ??? ???? ?? ????.

"?? ? ???"??? ???? ?? ???? ?? ???? ?? ?? ?? IP ??? ????? ?????. ???? ??? ??? ????. 1. ??? ????? ?? ????. 2. ?? ???? ??? ????? (? : ?? 80? ???? Apache? ?? Nginx? ???? ??). 3. ?? ?? ??? ?? ??? ???? ????. ?? ? ??? ?? ??? ??? ? ????. Sudolsof-I : 80 ?? SudolnetStat-Tulpn | grep : 80 Linux/MacOS; Windows?? NetStat-ano | FindStr : 80? ???? PID? ??????. ???? ??? ????. 1. ?? ?? ?? (? : SUDOS

A/B ???? NGINX? Split_Clients ??? ?? ?? ? ? ???, ?? ??? ?? ??? ?? ?? ??? ?? ??? ???? ?????. ?? ??? ??? ????. 1. Split_Clients ??? ???? 50%A ? 50%B? ?? HTTP ??? ??? ? ??? ?????. 2. $ cookie_jsessionid, $ remote_addr ?? $ arg_uid? ?? ??? ?? ?? ???? ??? ???? ??? ??? ????? ?????????. 3. ?? ?? ?? ??? IF ??? ?? ?? ???? ??????. 4. ??? ?? ?? ??? ?? ??? ??? ???? ??? ?????. 5. ???? ??? ? ??? ?? ??
