FAQ

Page Discussion Edit History

NginxJa

Nginx銇劇鏂欍仹鍒╃敤銇с亶銈嬨偑銉笺儣銉炽偨銉笺偣銇儚銈ゃ儜銉曘偐銉笺優銉炽偣HTTP銈点兗銉愪笖銇ゃ儶銉愩兗銈广儣銉偔銈枫仹銆両MAP/POP3銇儣銉偔銈枫偟銉笺儛銇ㄣ仐銇︺倐鍕曚綔銇椼伨銇欍Igor Sysoev銇倛銇c仸2002骞淬伀闁嬬櫤銇屽銇俱倞銆2004骞淬伀鏈鍒濄伄銉愩兗銈搞儳銉炽亴鍏枊銇曘倢銇俱仐銇熴備粖銇с伅涓栫晫涓伄銉夈儭銈ゃ兂銇亰銈堛仢12.18% (22.2M)銇甒eb銈点偆銉堛倰Nginx銇岀鍍嶃仌銇涖仸銇勩伨銇欍

Nginx銇仢銇珮銇勩儜銉曘偐銉笺優銉炽偣銇ㄥ畨瀹氭с佽眾瀵屻仾姗熻兘銆佽ō瀹氥伄瀹规槗銇曘佹秷璨汇儶銈姐兗銈广伄浣庛仌銇х煡銈夈倢銇︺亜銇俱仚銆

Nginx銇C10K鍟忛銇彇銈婄祫銈銇广亸闁嬬櫤銇曘倢銇熶竴鎻°倞銇偟銉笺儛銇亞銇°伄涓銇ゃ仹銇欍傚緭鏉ャ伄銈点兗銉愩仺銇暟銇倞銆丯ginx銇儶銈偍銈广儓銇嚘鐞嗐倰銈广儸銉冦儔銇緷瀛樸仐銇︺亜銇俱仜銈撱傘仢銇唬銈忋倞銇倐銇c仺銈广偙銉笺儵銉栥儷銇紙闈炲悓鏈熴伄锛夈偆銉欍兂銉堥鍕曘偄銉笺偔銉嗐偗銉併儯銈掍娇鐢ㄣ仐銇︺亜銇俱仚銆傘亾銇偄銉笺偔銉嗐偗銉併儯銇儭銉€儶浣跨敤閲忋亴灏戙仾銇勩仩銇戙仹銇亸銆佹渶銈傞噸瑕併仾浜嬨仺銇椼仸銆佺鍍嶆檪銇儭銉€儶浣跨敤閲忋亴浜堟脯鍙兘銇с亗銈嬨仺銇勩亞銇撱仺銇с仚銆
鍚屾檪銉偗銈ㄣ偣銉堟暟銇1涓囥儶銈偍銈广儓銈傘仾銇嬨仯銇熴仺銇椼仸銈傘丯ginx銇儚銈ゃ儜銉曘偐銉笺優銉炽偣銈勩儭銉€儶娑堣不閲忋伄灏戙仾銇曘伄鎭╂伒銈掑彈銇戙倠浜嬨伅銇с亶銈嬨仹銇椼倗銇嗐侼ginx 銇皬瑕忔ā銇 VPS 銇嬨倝澶ц妯°仾銈点兗銉愩亱銈夈仾銈嬨偗銉┿偣銈裤伨銇у蹇溿仚銈嬫嫛寮垫с倰鍌欍亪銇︺亜銇俱仚銆

Nginx銇WordPressHuluGithubOhlohSourceForgeWhitePagesTorrentReactor 銇ㄣ亜銇c仧鐭ュ悕搴︺伄楂樸亜銈点偆銉堛倰绋煎儘銇曘仜銇︺亜銇俱仚銆

Contents

Nginx 1.2.0 銇屻儶銉兗銈广仌銈屻伨銇椼仧

1.2.x 瀹夊畾鐗堛伄鏈鍒濄伄銉愩兗銈搞儳銉炽亴銉儶銉笺偣銇曘倢銇俱仐銇熴

1.2.0 銇伅涓嬭銇倛銇嗐仾 1.1.x 銉栥儵銉炽儊銇ч枊鐧恒仌銈屻仧妲樸呫仾鏂般仐銇勬鑳姐亴鍙栥倞杈笺伨銈屻仸銇勩伨銇:

  • 涓婃祦銈点兗銉愩伕銇 keepalive 鎺ョ稓銈掋偟銉濄兗銉堛仐銇俱仚 (HTTP 1.1)
  • 銈儯銉冦偡銉炽偘銇屾湁鍔广仾鍫村悎銇佷笂娴併偟銉笺儛銇搞伄瑜囨暟銇悓鏅傘儶銈偍銈广儓銈掔当鍚堛仐銇俱仚
  • 瑜囨暟銇儶銈偍銈广儓銇娿倛銇虫帴缍氬埗闄愩伄鍚屾檪浣跨敤銈掋偟銉濄兗銉堛仐銇俱仚
  • 闀锋檪闁撴帴缍氥仌銈屻仸銇勩倠銉偗銈ㄣ偣銉堛伄銉忋兂銉夈儶銉炽偘銇仼妲樸呫仾鐗规畩銈便兗銈广伀銇娿亜銇︺併儭銉€儶娑堣不銈掍綆娓涖仐銇俱仚

瑭炽仐銇忋伅瀹屽叏銇 澶夋洿灞ユ 銈掑弬鐓с仐銇︺亸銇犮仌銇勩

Nginx 銇 300涓囥儔銉伄璩囬噾瑾块仈銇垚鍔熴仐銆併偟銉炽儠銉┿兂銈枫偣銈炽伀鏈儴銈掗枊瑷簣瀹

銈兗銉椼兂銈姐兗銈广伄Web銈点兗銉愰枊鐧虹ぞ NGINX 銇屻偡銉兗銈篈銆嶆姇璩囥儵銈︺兂銉夈仹300涓囥儔銉伄璩囬噾瑾块仈銇垚鍔熴仐銇俱仐銇熴 鐝惧湪銆丯GINX 銇偆銉炽偪銉笺儘銉冦儓涓娿仹4000涓囦互涓娿倐銇儔銉°偆銉炽佷笘鐣屼腑銇ф渶銈傚繖銇椼亜1000銇偊銈с儢銈点偆銉堛伄銇嗐仭20%浠ヤ笂銈掔鍍嶃仌銇涖仸銇勩伨銇欍 銇撱伄涓伀銇丗acebook, Zappos, Groupon, LivingSocial, Hulu, TechCrunch, Dropbox, WordPress 銇ㄣ亜銇c仧钁楀悕銈点偆銉堛倐鍚伨銈屻伨銇欍

BV銈儯銉斻偪銉伄 Thomas Gieselmann 銇銇倛銇嗐伀瑾炪仯銇︺亜銇俱仚: 銆屾垜銆呫亴鎶曡硣銇椼仧浼佹キ銇亜銇忋仱銇嬨伅銆乄eb 銉椼儵銉冦儓銉曘偐銉笺儬銈 NGINX 銇Щ琛屻仚銈嬨亾銇ㄣ仹閲嶈銇偣銈便兗銉兂銈板晱椤屻倰瑙f焙銇欍倠銇撱仺銇屻仹銇嶃仧銆傘 銆孨GINX銇偆銉炽偪銉笺儘銉冦儓涓娿伄鏈澶с伄銈点偆銉堛倰閫忛亷鐨勩亱銇ゆ湁鍔广伀鎴愰暦銇曘仜銈嬨仩銈嶃亞銆傘

瑷樹簨鍏ㄦ枃銈掕銈


Nginx-book-packt.png

Nginx 銇浉绫嶃亴鍑虹増銇曘倢銇俱仐銇!

Clement Nedelcu 銇嫳瑾炪仹鏇搞亱銈屻仧鏈鍒濄伄 Nginx 鏈倰鍩风瓎銇椼伨銇椼仧銆侼ginx 銇儉銈︺兂銉兗銉夈仺銈ゃ兂銈广儓銉笺儷銇嬨倝銆 銉€偢銉ャ兗銉倰浣裤仯銇熻ō瀹氭柟娉曘仾銇┿仌銇俱仏銇俱仾銉堛償銉冦偗銇仱銇勩仸瑙︺倢銈夈倢銇︺亜銇俱仚銆傘伨銇熴併仚銇с伀鍒╃敤銇椼仸銇勩倠Web銈点兗銉愩倰 Nginx 銇疆銇嶆彌銇堛倠銇熴倎銇偣銉嗐儍銉椼儛銈ゃ偣銉嗐儍銉椼伄銉併儱銉笺儓銉偄銉倐鎻愪緵銇曘倢銇︺亜銇俱仚銆傘偝銉°兂銉堛倰娣汇亪銇熻ō瀹氫緥銈勩 銉€偢銉ャ兗銉倰娣便亸鎺樸倞涓嬨亽銇熻鏄庛仾銇┿倰浜ゃ亪銇︺丯ginx 銇屽倷銇堛倠銉戙儠銈┿兗銉炪兂銈广倰寮曘亶鍑恒仚銇熴倎銇銇岃В瑾仌銈屻仸銇勩伨銇欍

Nginx鏈伄鏃ユ湰瑾炵増銇屽嚭鐗堛仌銈屻伨銇椼仧!

銈€偣銈兗銉汇儭銉囥偅銈€儻銉笺偗銈广倛銈婃棩鏈獮缈昏ǔ鐗 銆銉忋偆銉戙儠銈┿兗銉炪兂銈笻TTP銈点兗銉 Nginx鍏ラ杸銆嶃亴鐧哄2銇曘倢銇︺亜銇俱仚銆

A while back, we changed our frontend IMAP/POP proxy from perdition to nginx... [and] we鈥檝e now switched over to using nginx for our frontend web proxy as well... The net result of all this is that each frontend proxy server currently maintains over 10,000 simultaneous IMAP, POP, Web & SMTP connections (including many SSL ones) using only about 10% of the available CPU.

-- FastMail.fm blog


銇撱伄wiki銇с伅銈ゃ兂銈广儓銉笺儷銇ㄨō瀹氥併偄銉夈偑銉炽伀闁€仚銈嬫儏鍫便仺Tips銈掋伨銇ㄣ倎銇︺亜銇俱仚銆傛皸杌姐伀鍙傚姞銇椼仸銇忋仩銇曘亜锛