{"id":763,"date":"2021-04-02T22:55:47","date_gmt":"2021-04-02T14:55:47","guid":{"rendered":"https:\/\/www.dd-home.top\/?p=763"},"modified":"2021-04-02T23:06:30","modified_gmt":"2021-04-02T15:06:30","slug":"centos-%e6%9c%8d%e5%8a%a1%e5%99%a8nginx%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.dd-home.top\/?p=763","title":{"rendered":"Centos \u670d\u52a1\u5668Nginx\u4f18\u5316"},"content":{"rendered":"<p>1.\u67e5\u770b\u5f53\u524dcentos\u7684cpu \u4fe1\u606f\u53ca\u5185\u5b58\u4fe1\u606f<\/p>\n<p><code>[root@localhost ~]# cat \/proc\/cpuinfo |grep \"name\" |cut -f2 -d: |uniq -c<br \/>\n8  Intel(R) Xeon(R) CPU E7-4809 v4 @ 2.10GHz<br \/>\n[root@localhost ~]# cat \/proc\/cpuinfo | grep \"physical\"| sort |uniq -c<br \/>\n8 address sizes\t: 42 bits physical, 48 bits virtual<br \/>\n4 physical id\t: 0<br \/>\n4 physical id\t: 1<br \/>\n[root@localhost ~]# getconf LONG_BIT<br \/>\n64<br \/>\n[root@localhost ~]# cat \/proc\/cpuinfo<br \/>\nprocessor\t: 0<br \/>\nvendor_id\t: GenuineIntel<br \/>\ncpu family\t: 6<br \/>\nmodel\t\t: 79<br \/>\nmodel name\t: Intel(R) Xeon(R) CPU E7-4809 v4 @ 2.10GHz<br \/>\nstepping\t: 1<br \/>\nmicrocode\t: 0xb00001f<br \/>\ncpu MHz\t\t: 2094.952<br \/>\ncache size\t: 20480 KB<br \/>\nphysical id\t: 0<br \/>\nsiblings\t: 4<br \/>\ncore id\t\t: 0<br \/>\ncpu cores\t: 4<br \/>\napicid\t\t: 0<br \/>\ninitial apicid\t: 0<br \/>\nfpu\t\t: yes<br \/>\nfpu_exception\t: yes<br \/>\ncpuid level\t: 20<br \/>\nwp\t\t: yes<br \/>\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb invpcid_single fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt dtherm arat pln pts<br \/>\nbogomips\t: 4189.90<br \/>\nclflush size\t: 64<br \/>\ncache_alignment\t: 64<br \/>\naddress sizes\t: 42 bits physical, 48 bits virtual<br \/>\npower management:<\/code><\/p>\n<p>2.nginx CPU\u4f18\u5316<\/p>\n<p>\u670d\u52a1\u5668\u56db\u6838\u914d\u7f6e\u5982\u4e0b:<\/p>\n<p><code>worker_processes\u00a0 4;<br \/>\nworker_cpu_affinity 0001 0010 0100 1000;<\/code><\/p>\n<p>\u516b\u6838\u5982\u4e0b\uff1a<\/p>\n<p><code>worker_processes 8;<\/code><br \/>\n<code>worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 1000000;<\/code><\/p>\n<p>\u91cd\u542f\u670d\u52a1:<\/p>\n<p><code>systemctl restart nginx<\/code><\/p>\n<p>\u67e5\u770b\u72b6\u6001<\/p>\n<p><code>systemctl status nginx.service<\/code><\/p>\n<p>3.nginx \u6587\u4ef6\u6570\u4f18\u5316 \u89c1 ulimit\u4f18\u5316<\/p>\n<p><code>worker_rlimit_nofile 65535;<\/code><\/p>\n<p>4.Nginx\u4e8b\u4ef6\u5904\u7406\u6a21\u578b<br \/>\n<code>events {<br \/>\nuse epoll;<br \/>\nworker_connections 65535;<br \/>\nmulti_accept on;<br \/>\n}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u67e5\u770b\u5f53\u524dcentos\u7684cpu \u4fe1\u606f\u53ca\u5185\u5b58\u4fe1\u606f [root@localhost ~]# cat \/proc\/ &hellip; <a href=\"https:\/\/www.dd-home.top\/?p=763\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Centos \u670d\u52a1\u5668Nginx\u4f18\u5316<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-763","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=763"}],"version-history":[{"count":6,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions\/769"}],"wp:attachment":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}