我生产环境下的两台Nginx + PHP5(FastCGI)服务器,跑多个一般复杂的纯PHP动态程序,从Nginx的日志可以统计出,单台Nginx + PHP5(FastCGI)服务器跑PHP动态程序的处理能力已经超过“700次请求/秒”,相当于每天可以承受6000万(700*60*60*24=60480000)的访问量:

  服务器①:DELL PowerEdge 1950(两颗 Intel(R) Xeon(R) 双核CPU 5120 @ 1.86GHz,4GB内存)

  服务器②:DELL PowerEdge 1950(一颗 Intel(R) Xeon(R) 双核CPU 5140 @ 2.33GHz,4GB内存)

  Web服务器:CentOS Linux 4.4 + Nginx 0.5.35 + PHP 5.2.6RC2(300 FastCGI Procees, unix-domain socket, with XCache)

  PHP程序内容:大量Memcached读写、少量MySQL读操作、大量文件队列写操作,然后计算,生成供<script type="text/javascript" src="http://www.domain.com/abc.php?u=1"></script>方式调用的JS代码或XML数据。

  网卡流量:1.5M~3M/秒

  请求数统计方式:从Nginx访问日志中,统计每分钟的第15秒共有多少条日志记录。
引用
grep "25/Mar/2008:15:01:15" /data1/logs/nginx.log | wc -l


  点击在新窗口中浏览此图片

  服务器的系统负载也不算高:

  点击在新窗口中浏览此图片

  总结:
  1、Nginx的处理能力超强,这块不是瓶颈。影响动态程序处理能力的因素主要在于PHP(FastCGI)。PHP(FastCGI)模式适用于执行时间较短的PHP程序,一般复杂的PHP程序执行时间应该在100ms以内,例如我的博客首页执行时间为38ms左右。假设一个PHP程序的执行时间为100ms,那么一个PHP(FastCGI)进程每秒可以处理完毕10个请求,300个FastCGI进程理论上每秒可以处理3000个请求。但是,在生产环境下,还将受到内存、系统负载等多方面的影响,例如300个PHP(FastCGI)进程需要占用2.4GB左右的内存,每秒处理超过1000个请求时,系统负载会飚升到100以上。因此,FastCGI的进程不是越多越好,而是够用就好。

  2、使用PHP的XCache、APC等加速模块会提供速度10倍左右,降低系统负载50倍以上。

  3、修改了spawn-fcgi,使它能够支持250个以上的FastCGI进程。

  4、如果PHP直接对MySQL进行大量读写操作,速度是达不到“700 request/sec”的,PHP与MySQL之间需要一个中间层,这是关键的技术。

  5、CPU的数量(多核算多个CPU,cat /proc/cpuinfo |grep -c processor)越多,系统负载越低,每秒能处理的请求数也越多。

  6、使用PHP 5.2.6RC2,因为它修正了PHP 5.2.5的“zend_mm_heap corrupted”错误BUG。PHP 5.2.5(FastCGI)在高并发请求情况下,经常会出现该错误。

  7、有空我将写一篇针对CentOS Linux环境Nginx + PHP5(FastCGI)安装、配置的最新博文。

Tags: , , , , , ,



技术大类 » Web服务器 | 评论(102) | 引用(0) | 阅读(145218)
xujie777 Email
2012-5-18 16:25
coach outlet has become a popular shopping experience for consumers around the world, and a desirable distribution channel for manufacturer's and retailers.Getting your hands on coach outlet store online can be a hefty investment of hundreds of dollars.But do not despair,the Coach Outlet store could be the answer to your prayers.coach outlet online is your smart choice when you want to get the discount Coach accessory. You can find the exact Coach Bags and other accessory you want at a low price that's right for you. My dear friends, let the coach outlet online pave your way into the world of high fashion with their ultimate fashion factory.
xujie123
2012-5-21 11:16
Our online store offers you discounted Designer louis vuitton replica wallet at present. You could find them in desirable quality and price. If you don't mind high class louis vuitton uk, have a good time here.louis vuitton Store Online Handbags can also bring great accuracy as well as practical applicability and fashionable.Have you ever dreamed of being as charming as Madonna? Have you ever thought of becoming an envy of all your friends? If so, come to louis vuitton outlet.<br/>
xujie555
2012-5-21 13:40
coach factory outlet uses graceful accessories to match the classical logo of coach, which is the best combination of coach. The handmade coach products?can make you more charming and graceful.coach factory online provides people many coach goods. If you wish to snatch the coach handbag, then this best method is made for that you like for coach discount.coach factory outlet online is a fashion brand to ensure its quality. With designer coach shoulder bags, you will always attract people's attention. The bags will emphasize your personal style and taste.<br/>
xujie333
2012-5-21 15:01
coach outlet online Store guarantee that all the coach handbags offered are own high quality. In addition , all of them are sold at an unexpected low price.If you want to purchase, just visit their website.coach factory outlet is really sizzling kinds of shopping way for you. With the usage of the replica designer coach bags, you can surely be able to change your individual looks in a stunning manner.Coach bags on sale from the coach outlet are cheap or discount prices that you certainly will stand out from the crowd on your next camping trip!<br/>
Cheap Coach Bags Email Homepage
2012-7-14 17:36
The most typical spots that individuals go to any time Coach Outlet
coach88888888 Email
2012-8-13 17:47
If you desire to go to Coach Factory Outlet, but have no idea in which to go, you can research online. It is no doubt that there is drastically information and details about it for the reference.Coach Factory Online are loved by many people, when you walk in the street, you could see many people take coach styles.hat experts claim Coach Outlet Online shopping is in the changes they are available in.Coach Outlet will send you a coupon in the post to use in their upon only after you type a achieve. The Coach bags are customarily somewhat many than the ones in the stores.
Bottega Veneta Clutch Email Homepage
2012-8-24 15:00
but incredible providers have gotten to break downwards these obstructions Louis Vuitton Handbags
Coach Email Homepage
2012-11-3 14:47
"The Coach Outletengines that will likely power the J-31 we do know a bit mor.Coach Outlet  Those engines were actually revealed at the Zhuhai showCoach Outlet in 2008," Fisher said referring to an annual China air show. He beCoach Outletlieves the new J-31 engine is undergoing preliminary
ysq Homepage
2012-12-5 09:18
突破口在nginx入口处,关键在php-cgi消耗cpu和ram,解决这两个问题基本就好了,mysql只是php的小帮凶。
磨延城 Email Homepage
2013-10-21 20:54
磨途歌学习了
django Email Homepage
2013-11-30 19:42
Uggs Sale the ideal idea Coach Outlet Online  enough time to search for many of reduction Ugg boot. Like big portions? If you began ready your apartment, Coach Outlet  it's always best to consider the most effective way direct to the stage it could be to utilise your inventory throughout Coach Factory Outlet  concern, or maybe you basically won't destination stuff not enough.we're anti- whitening tray because Coach Outlet Online  i will be enjoy just get germ dog breeders
ADSF
2013-12-31 15:56
买轴承就到:www.jkzhoucheng.cn
夜无眠 Email
2015-11-13 21:36
windows   上的fastcgi是单线程的,比较蛋疼,应付不了高并发
chanchal
2021-6-18 21:19
Canon.Com ijsetup will manual you https://sites.google.com/view/ijstart-ijstartcanon/ to Install Canon printer brand new updated drivers, for Canon printer setup you could additionally visit.NBC application is available for a huge range of devices that include TVs, streaming media players, gaming consoles, Blu-ray players, and more. You can watch NBC on all these devices if they have updated software. To watch this you need to enter the device’s activation code at https://sites.google.com/view/nbc-com-activatee/ and that’s it. In this article, we will discover the installation and activation process for NBC.espn known for providing entertainment and sports channels to its audience and it serves the best available content. You can also watch the live streaming channels with https://sites.google.com/view/espncpmactivate/ anytime anywhere.In this article, you will get the easiest way to activate your Capital One card online by visiting the official capital one credit card activation online portal at href="https://sites.google.com/view/capitalone-coms-activate/ and https://sites.google.com/view/walmart-capitalone-activate/: When you apply for your WALMART Capitalone credit or debit card, after the completion of process of card you’ll receive the card via post. But that card will not be ready for use. to use this card you first have to activate the card.
chanchal
2021-6-18 21:19
How to activate TNT Drama on your device via https://sites.google.com/view/tntdramaa-com-activate/ TNT Drama allows the users to watch their favorite TV channel shows on one platform.Students, faculty and staff have access to a https://sites.google.com/view/microsoft-office-download/ for free for personal use on your computer, smartphone or tablet.Once, you will finish your ProtonMail account setup then you can use your https://sites.google.com/view/proton-mail-login/ credentials to start sending and receiving emails over the ProtonMail app/website. So, with no further delay let’s head to the steps to create a new account for ProtonMail Login. "covid-19"If you have recently installed the latest https://sites.google.com/all-printer-driver.com/epson-printer-drivers/ Update via Apple's Software Update tool or from the Apple Corp. website, then you may need to refresh your Epson printer driver installation. The latest printer driver update provides updated driver software to many Epson printer models.All the printers require a proper driver installation. Some users due to lack of knowledge of technicalities don't know how to Download https://sites.google.com/a/all-printer-driver.com/brother/.
chanchal
2021-6-18 21:20
Activate your HGTV GO channel at the https://sites.google.com/view/watchhgtv-com-activate/ page for different streaming devices by following the information provided in this guide.PayPal is an efficient service, as long as you always make sure to have a cushion of money in your account. Not having enough cash in your https://sites.google.com/view/paypalc0mlogin/ balance can lead to late payments or prevent you from making quick transactions to other accounts.Click Download or Get to install it.Open the channel.Copy the activation code displayed.Go to https://sites.google.com/view/wetvcomactivate/.Enter the activation code.Select your TV provider.Log in with your TV provider.Open Google Play Store in your smart TV. Install the Bravo TV program. Open the Bravo TV program. Copy the activation code. Go to https://sites.google.com/view/bravo-tv-com-link/ from web browser and enter the activation code. You are ready to start streaming.You realize that on history.com you can watch your number one program? The principal thing you need to visit the https://sites.google.com/view/historycom-activate/ web initiation page utilizing internet browser. At that point you should experience the Activation cycle with your TV makers’ membership appeared on the screen. When the arrangement has succeeded, the PC or any gadget would now be able to be streamed on the web.
chanchal
2021-6-18 21:20
https://sites.google.com/view/tbs-activate/ on roku – Tbs.com Activate Roku Player · Firstly, you need to explore to the Roku channel store and look through the rundown of stations under ...How do I get my Download IJ Scan Utility Windows 10 Scanner Software? Download https://sites.google.com/all-printer-driver.com/ij-scan-utility/canon-ij-scan-utility-windows-10 is an application that allows you to scan photos, documents, etc easily. You can complete from scanning to saving at one time by simply clicking the corresponding icon in the IJ Scan Utility main screen.Sign in to your espn account. A espn account gives you access to an amazing selection of movies, TV shows, music and more from the https://sites.google.com/barenot.com/espn-com-activate Channel Store.f you want to watch all your favorite NBC shows on multiple devices around the house and want to learn how to use the https://sites.google.com/barenot.com/nbc-com-activate/ code, then keep reading on to learn more!To activate ESET software follow the provided steps.You first need to go to https://sites.google.com/view/esetcom-usactivate/.Put in your ESET activation key.Choose the correct country.Enter your first and last name.Provide the enterprise’s name if you want.Provide the email address.
chanchal
2021-6-18 21:21
Go to https://sites.google.com/view/xfinitycomauthorizenow/ from any other device such as mobile phone, tablet or desktop. From the web browser, enter the six-digit xfinity stream authorized code provided to the Roku device.Find Etrade Log In Results Quickly On Info.com. Discover Info On Finance Companiwa. Search multiple engines for https://sites.google.com/view/etradeloginnow/.You will need to use the https://sites.google.com/view/etradeloginnow/etrade-login/ page to access your stock trading portfolio account online when you are ready to buy or sell stocks at ETRADE.com​ ...Get your office setup from https://sites.google.com/a/25activate.com/enter/. If your version of Ms Office setup came with your PC, you can download or order a latest version from https://sites.google.com/a/25activate.com/enter/ofice-setup You can also set up an office with a 25-digit activation code.
chanchal
2021-6-18 21:21
Once you successfully purchase Ms. Office Equipment, you will get an https://sites.google.com/a/25activate.com/enter/blog ,in which you must enter the key.Mcafee antivirus acts as a shield of the device. It protects against viruses, malware, online threats etc. You can download, install and activate https://sites.google.com/a/25activate.com/totalprotection/ with activation code.mcafee antivirus provides protection from viruses, hackers, spyware and more harmful websites. If you want to protect your devices against harmful data, download mcafee antivirus by visiting the https://sites.google.com/a/25activate.com/totalprotection/blog website.The Amazon My TV Code program requires the customer to have an Amazon account and a streaming device or TV. Amazon Prime Video is available on almost all streaming devices like Roku, Amazon Fire TV, Chromecast. All you have to do is go to https://sites.google.com/amazoncom-mytv.com/signin/home/ and activate https://sites.google.com/site/amazoncommytvactivationkey/ with the help of Amazon's activation code.
分页: 3/6 第一页 上页 1 2 3 4 5 6 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]