?????Web????????????????CPU
???????????? ???????[ 2015/4/20 10:46:29 ] ????????WEB???? ??? CPU ????
????1.prefork MPM????????????
????prefork??Apache????????????????????????????????????á????????????????????????????????????????fork???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????httpd???????????????棬???????????????????????????????????????????????????????“???????”??????????С??????????????????????????????????????????????????????в???Keep-alive????????????Щ?????“???”???????????????????????????prefork??????????????????
??????????????????????????????顣?????????????????????????????磬????????mod_php????PHP?????Apache??????飬???????????????
???????????????????ú????檔
????2.worker MPM?????????????????
????worker??????prefork???????????????????????????????fork?????????????????????????????????????Щ???????а??????????????????????????????????1????????????????????????????????????????????????????????????????????Щ??????????????£????????prefork?????棬?????и???????????
???????????????н??Keep-alive???????“???”??????????????????????????????
??????Щ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Apache????“??????”????????????????????????Apache????????????????????????
?????????????????????????????????????????????μ???????“?????”????????????????????μ?“???????”??????????????????????????“?????”??????????????????????Web???????????????磬mod_php??????PHP???????????????“?????”???????????????????á?
????????????????棬??????±??????
??????????????????????????????????????????CPU???????
????3.event MPM???????????????????????Epoll
?????????Apache?б???μ????????????汾??Apache 2.4.10???????????????????????worker?????????????????????????keep-alive?????£????????????????????????event MPM?У???????????????????????Щkeep-alive????????????????????????????????????????????????????????????????????????“???”?????????????????????????????????μ??????????????????????“?е?”??????????????????????????£????????????Щ??
????event MPM???????Щ????????????????Ч??????????worker?????????????????????????°?Apache??????????飬????????event MPM?????????event MPM???Linux????Linux 2.6+????EPoll?????????????á?Apache?????????????????ó????У?event MPM?????????
????4.???????????Nginx???Web??????
???????Apache????????????????????????????????????????????????????????????????Apache???????????????Web?????????????????????飬???????????Web????Nginx????????????Web??????????????????Apache???????Nginx??????????????????N???????????????????????Apache?????????/?????????????????????Nginx??????????????????????/?????????????????????
????????????QPS???????????Nginx??????3????Apache?????????????PHP?????????QPS??Nginx??????????????FastCGI??????PHP-FPM??????????PHP?????????????????????????Apache?????PHP??????????????饗?°??Apache????FastCGI????PHP????????Nginx??????????Apache??
????5.sendfile??????
????Apache??Nginx?????Web??????????sendfile?????sendfile????????????“?????????”??????????????????????????????????á??????????????????????????Why???????????????????????????????Linux????????????洢?????????
???????????£?????????????????????????????????????д????????????豸??????????硢????????м????????????“?м???”?????????豸??????????д??
??????
???·???
??????????????????
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