??????μ?Nginx???????
???????????? ???????[ 2013/1/31 11:31:11 ] ????????
?????????????Щ????Nginx????????????????Щ???????????Nginx?????Nginx????????Apache???????????Щ?????????????????ú????????????????????????Ч???С?
?????????Щ??????????????????Apache??????Nginx???????????????????????????PHP??????????????????????Nginx?????????????????????????Nginx????apt-get??yum????make??????????????????????????? ???????Щ?????????Wiki???????????????μ??
???????????????Nginx???????????????????????????????????????????????Nginx???????????????????????????????Щ????????
???????????????????????????????????????????????????Nginx???????????????????? ????????????????????????????????????????????????Щ?????????????????????????????ɡ?
?????????????????????Nginx????????????????е?????????MacOS??Linux??FreeBSD??Solaris??Windows?????Щ????μ?????????????????????Щ?????????????????????polling?????????????Nginx??????????4???????????????????????FreeBSD??????????????????????????????????????????????????????????????????????
??????????????μ???windows???????С? Windows???nginx????????????????????á? Windows????????????????polling?? ????nginx???????????????? ?????????????select???? ?????????Ч?????????????????????????η?????????????????
????????????????? ????????????????????????????????? ?????Shell????? ???su?????л???Nginx??????????? ????????`ulimit -a`?? ??Щ??????Nginx???????ж???????????? ???????????У? “open files”????????????? ??????????????У? ??????? 1024?? ???Nginx???????в??????????????????error log??24?? Too many open files?? ?????????????????????? ???Nginx??????????????????????????????????????Щ????? ????????????????????
?????????????????? ????????ulimit????os???“open files”?? ???????????nginx??????worker_rlimit_nofile ?????????????????
????Nginx ?????????????????????? ????????????Nginx??????????Щ??????????????????????????Nginx??
????Worker Processes????????????Щ??worker_process ??Nginx??????? ?????????????????IP??????????nginx???????????????????? ?????????????е?????? Workers ?????????? ????????????????CPU??????? ??????????????????????>1??workers?????? ??????CPU???????worker?? ?????????2-4??workers?????CPU?? ??CPU?????????Nginx??????????????????????????????????е?????????η????????????????????
???????????????????????????? ???к?????????blocking??????IO??????????????????worker_process????? ??????????????y??в??????????????????waiting time???? ?????????????????????worker_process??????η???????????о???
????Worker Connectionsworker_connections ????????е????? ???????????????????? ????????Ч????????????????????worker????????????????? ???????′????? ?????????????????keep-alive???ò??????????£? ????????????????????????????????????????????????????????????????forced to guess ?????????????????????
???????????1024?? ???????????????????????′?2??????????????????????????????????????512???????????????????????????????????????????????keepalive-timeout??65??????????????????????65?????? ????????????????????75????ο?wiki keepalive_timeout??????????????????????????8??????? ???????????????????????????????????? ???????????????????????2-4??workers?? ?????????????????? ???keep-alive?????????????????????????
?????????????????????????? ?????????????????????????????Nginx?????????????????????????????????????г???????е????????
???????й???worker??????????????????????????????????????????????????worker??????????? 2048?????????????????????????????????????????????????????????workers???????????????????????????
????CPU ?????????CPU?????????????????ζ??????????????????CPU???????????????????CPU??????????????????????????????????????????????????????????С??? ??????????????? CPU ?????????????????????????????????????????????? CPU ????????????????????????????????????????????????????????????????????????????????????
????Keep Alivekeep_alive ?? HTTP?????????? ?????????????????????????????????????????????????????????????? ??????????????????????????Nginxserver??????? ???Nginx????????????е?????? Nginx??????????10??000?????е???????????2??5????棨unbelievable???? ????????????????????????
????????????????????????????????????? ????????????keep alive?????????????????? ??????????????????????????????????????????????????о?????????????????????? Amazon???Щ????????????????????????????????о??????? ????????????????????????????????????
???????keep alive????????????? ?????????????? ?????????????е?HTTP???????????????? ????????Ч??? ??????????keepalive-timeout?????65?? ????10-20?????????????????????????????? Nginx???????????檔
????tcp_nodelay ?? tcp_nopush????????????????????nginx????? ???????nginx??????????????? ?????????????Щ???????????????δ??????綹?????????????Щ???????????????????????? ????????????????????????Щ??????ò???????? ?????????????????????????? ???????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11