Nginx + PHP to build a super performance WEB server _nginx

Source: Internet
Author: User
Tags server memory
Nginx was developed by Igor Sysoev, the second rambler.ru site for Russian traffic, which has run over 2.5 at the site. Igor releases the source code in the form of a BSD-like license.

In the case of high concurrent connections, Nginx is a good substitute for Apache servers. Nginx can also be used as a 7-tier load-balancing server. According to my test results, Nginx 0.6.31 + PHP 5.2.6 (FastCGI) can withstand more than 30,000 concurrent connections, equivalent to Apache 10 times times the same environment.

In my experience, the server +apache (prefork mode) of 4GB memory generally can only handle 3,000 concurrent connections, because they will consume more than 3GB of memory and have to reserve 1GB of memory for the system. I used to have two Apache servers, because the maxclients set in the configuration file is 4000, and when the number of Apache concurrent connections reaches 3800, the server memory and swap space are full and crash.

And this Nginx 0.6.31 + PHP 5.2.6 (FastCGI) server in the 30,000 concurrent connection, the 10 open Nginx process consumes 150M of memory (15m*10=150m), the open 64 php-cgi process consumes 1280M memory (20m*64 =1280m), combined with the memory consumed by the system itself, consumes less than 2GB of memory. If the server memory is small, you can simply turn on 25 php-cgi processes so that the total amount of memory consumed by php-cgi is 500M.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.