{"id":331,"date":"2023-04-23T16:11:13","date_gmt":"2023-04-23T08:11:13","guid":{"rendered":"http:\/\/idc.birk.cn\/?p=331"},"modified":"2023-04-23T16:11:13","modified_gmt":"2023-04-23T08:11:13","slug":"%e5%ae%9d%e5%a1%94%e5%ae%89%e8%a3%85php%e5%90%8e%e5%86%85%e5%ad%98%e5%88%a9%e7%94%a8%e7%8e%87%e8%bf%87%e9%ab%98%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/idc.birk.cn\/?p=331","title":{"rendered":"\u5b9d\u5854\u5b89\u88c5php\u540e\u5185\u5b58\u5229\u7528\u7387\u8fc7\u9ad8\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p>\u5b9d\u5854\u7ed9\u5927\u5bb6\u63d0\u4f9b\u4e86\u975e\u5e38\u4fbf\u5229\u7684\u5efa\u7ad9\u4e0e\u7ba1\u7406\u529f\u80fd\uff0c\u4f46\u662f\u90e8\u5206\u4e3b\u673a\u7684\u5185\u5b58\u89c4\u5219\u53ef\u80fd\u504f\u4f4e\uff0c\u53ef\u80fd\u51fa\u73b0\u5728\u5b89\u88c5php\u540e\u5185\u5b58\u5229\u7528\u7387\u5f88\u9ad8\u7684\u95ee\u9898\u3002\u9996\u5148\u672c\u6587\u9488\u5bf9php\u7684\u914d\u7f6e\u8fdb\u884c\u4e86\u76f8\u5173\u63a2\u7d22\u3002<\/p>\n<p>\u9996\u5148\uff0c\u67e5\u770bphp\u8fdb\u7a0b\u6570\u91cf\uff0c\u4f7f\u7528\u547d\u4ee4ps -aux|grep php<\/p>\n<p>[root@C2023 ~]# ps -aux|grep php<br \/>\nwww 7816 0.0 1.0 311672 10376 ? S 4\u670807 2:42 php-fpm: pool www<br \/>\nwww 7822 0.0 2.9 313444 29924 ? S 4\u670807 2:34 php-fpm: pool www<br \/>\nwww 7823 0.0 4.6 308456 46708 ? S 4\u670807 2:31 php-fpm: pool www<br \/>\nwww 7826 0.0 4.5 306648 45960 ? S 4\u670807 2:25 php-fpm: pool www<br \/>\nwww 7827 0.0 3.0 298200 31116 ? S 4\u670807 2:30 php-fpm: pool www<br \/>\nwww 7828 0.0 5.2 317256 53456 ? S 4\u670807 2:30 php-fpm: pool www<br \/>\nwww 7829 0.0 1.1 282872 11548 ? S 4\u670807 2:32 php-fpm: pool www<br \/>\nwww 7832 0.0 3.4 298652 34620 ? S 4\u670807 2:23 php-fpm: pool www<br \/>\nwww 7833 0.0 3.6 290272 37424 ? S 4\u670807 2:22 php-fpm: pool www<br \/>\nroot 12665 0.0 0.0 249720 68 ? Ss 2\u670823 4:59 php-fpm: master process (\/www\/server\/php\/74\/etc\/php-fpm.conf)<br \/>\nwww 12666 0.0 0.0 249720 4 ? S 2\u670823 0:00 php-fpm: pool www<br \/>\nwww 12667 0.0 0.0 249720 4 ? S 2\u670823 0:00 php-fpm: pool www<br \/>\nwww 12668 0.0 0.0 249720 4 ? S 2\u670823 0:00 php-fpm: pool www<br \/>\nwww 12669 0.0 0.0 249720 4 ? S 2\u670823 0:00 php-fpm: pool www<br \/>\nwww 12670 0.0 0.0 249720 4 ? S 2\u670823 0:00 php-fpm: pool www<br \/>\nroot 12671 0.0 0.1 249720 1168 ? Ss 2\u670823 4:58 php-fpm: master process (\/www\/server\/php\/74\/etc\/php-fpm.conf)<br \/>\nwww 20088 0.0 0.3 297260 4008 ? S 3\u670829 3:42 php-fpm: pool www<br \/>\nwww 20335 0.0 2.2 313648 22784 ? S 3\u670829 3:03 php-fpm: pool www<br \/>\nwww 20481 0.0 3.5 292216 36308 ? S 3\u670829 3:29 php-fpm: pool www<br \/>\nwww 20501 0.0 3.6 291420 36964 ? S 3\u670829 3:01 php-fpm: pool www<br \/>\nwww 20635 0.0 3.3 302168 33492 ? S 3\u670829 3:03 php-fpm: pool www<br \/>\nwww 20803 0.0 3.7 301664 38532 ? S 3\u670829 3:00 php-fpm: pool www<br \/>\nwww 20880 0.0 3.5 289588 36456 ? S 3\u670829 3:12 php-fpm: pool www<br \/>\nwww 20945 0.0 4.1 307968 42436 ? S 3\u670829 3:14 php-fpm: pool www<br \/>\nwww 20979 0.0 3.9 291724 39596 ? S 3\u670829 3:04 php-fpm: pool www<br \/>\nwww 21047 0.0 4.9 300224 49904 ? S 3\u670829 3:07 php-fpm: pool www<br \/>\nroot 21409 0.0 0.0 112828 984 pts\/0 R+ 15:37 0:00 grep --color=auto php<br \/>\nwww 27093 0.0 5.2 317236 53712 ? S 2\u670828 16:18 php-fpm: pool www<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u8fdb\u7a0b\u6570\u91cf\u975e\u5e38\u4e4b\u591a\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7top\u547d\u4ee4\u67e5\u770bphp\u5360\u7528\u7684\u5185\u5b58\uff0c\u8f93\u5165top\u547d\u4ee4\u540e\u6309M\u540e\u67e5\u770b\u5185\u5b58\u6392\u5e8f<\/p>\n<p>top - 16:05:56 up 68 days, 4:40, 2 users, load average: 0.78, 0.65, 0.39<br \/>\nTasks: 117 total, 1 running, 116 sleeping, 0 stopped, 0 zombie<br \/>\n%Cpu(s): 2.7 us, 3.3 sy, 0.0 ni, 94.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st<br \/>\nKiB Mem : 1014660 total, 384576 free, 358464 used, 271620 buff\/cache<br \/>\nKiB Swap: 1048572 total, 540912 free, 507660 used. 513244 avail Mem<\/p>\n<p>PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND<br \/>\n24953 www 20 0 304012 66864 7064 S 0.0 6.6 0:12.24 php-fpm<br \/>\n24954 www 20 0 306352 66472 6524 S 0.0 6.6 0:12.84 php-fpm<br \/>\n24952 www 20 0 304012 64248 6572 S 0.0 6.3 0:11.63 php-fpm<br \/>\n2007 mysql 20 0 859620 32552 4056 S 0.7 3.2 50:13.72 mysqld<br \/>\n13520 www 20 0 162668 26708 852 S 0.0 2.6 0:00.50 nginx<br \/>\n24424 root 20 0 1258240 13716 784 S 0.0 1.4 7:13.22 dockerd<br \/>\n12271 root 20 0 1003536 10132 1980 S 0.0 1.0 3:31.89 snapd<br \/>\n22756 root 20 0 938304 9948 3784 S 0.0 1.0 84:01.35 BT-Task<br \/>\n998 root 20 0 1100476 7628 1068 S 0.0 0.8 52:05.39 containerd<br \/>\n24951 root 20 0 249696 5452 1608 S 0.0 0.5 0:00.08 php-fpm<br \/>\n13831 root 20 0 156740 5116 3816 S 0.0 0.5 0:00.00 sshd<br \/>\n27119 root 20 0 699516 4780 516 S 0.0 0.5 0:07.26 oneav<br \/>\n13521 www 20 0 131820 3340 264 S 0.0 0.3 0:00.04 nginx<br \/>\n29487 root 20 0 131948 3048 200 S 0.0 0.3 0:00.17 nginx<br \/>\n13832 sshd 20 0 117328 2904 1768 S 0.0 0.3 0:00.00 sshd<br \/>\n22658 root 20 0 918196 2648 984 S 0.0 0.3 3:04.36 BT-Panel<br \/>\n13405 root 20 0 162092 2276 1612 R 0.3 0.2 0:00.05 top<br \/>\n1 root 20 0 125680 2244 1240 S 0.0 0.2 12:13.14 systemd<br \/>\n11055 root 20 0 116876 2212 1212 S 0.0 0.2 0:00.17 bash<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u6392\u540d\u524d\u51e0\u7684\u5185\u5b58\u5360\u7528\u90fd\u662fphp-fpm\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u9488\u5bf9php\u9650\u5236\u8fdb\u7a0b\u6570\u91cf\uff0c\u5bf9\u4e8e\u5c0f\u7ad9\u70b9\u6765\u8bf4\uff0c\u8fdb\u7a0b\u6570\u91cf\u4e0d\u9700\u8981\u592a\u9ad8\uff0c\u6211\u4eec\u8fd9\u91cc\u8bbe\u7f6e\u6700\u5927\u8fdb\u7a0b\u6570\u91cf\u4e3a10.<\/p>\n<p>\u6253\u5f00\/www\/server\/php\/74\/etc\/php-fpm.conf\u53ef\u4ee5\u770b\u5230\u4e0b\u9762\u51e0\u4e2a\u914d\u7f6e\uff0c\u6211\u4eec\u4fee\u6539\u6210\u5982\u4e0b\u7684\u914d\u7f6e\u53c2\u6570\u4ee5\u540e\u4f7f\u7528\/etc\/init.d\/php-fpm-74 reload\u91cd\u65b0\u52a0\u8f7d\u65b0\u914d\u7f6e<\/p>\n<p>pm.max_children = 10<br \/>\npm.start_servers = 3<br \/>\npm.min_spare_servers = 1<br \/>\npm.max_spare_servers = 5<\/p>\n<p>\u8fd9\u6837\u4f7f\u7528free -m\u67e5\u770b\u5185\u5b58\u5229\u7528\u662f\u5426\u6709\u51cf\u5c11\uff0cps -aux|grep php\u7684\u8fdb\u7a0b\u6570\u91cf\u4e5f\u5927\u5927\u51cf\u5c11\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9d\u5854\u7ed9\u5927\u5bb6\u63d0\u4f9b\u4e86\u975e\u5e38\u4fbf\u5229\u7684\u5efa\u7ad9\u4e0e\u7ba1\u7406\u529f\u80fd\uff0c\u4f46\u662f\u90e8\u5206\u4e3b\u673a\u7684\u5185\u5b58\u89c4\u5219\u53ef\u80fd\u504f\u4f4e\uff0c\u53ef\u80fd\u51fa\u73b0\u5728\u5b89\u88c5php\u540e\u5185\u5b58\u5229\u7528\u7387\u5f88\u9ad8\u7684\u95ee\u9898\u3002\u9996\u5148\u672c\u6587\u9488\u5bf9php\u7684\u914d\u7f6e\u8fdb\u884c\u4e86\u76f8\u5173\u63a2\u7d22\u3002 \u9996\u5148\uff0c\u67e5\u770bphp\u8fdb\u7a0b\u6570\u91cf\uff0c\u4f7f\u7528\u547d\u4ee4ps -aux|grep php [root@ [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,21],"tags":[47],"topic":[42],"class_list":["post-331","post","type-post","status-publish","format-standard","hentry","category-linux","category-21","tag-47","topic-42"],"_links":{"self":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=331"}],"version-history":[{"count":1,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":332,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions\/332"}],"wp:attachment":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}