Lnmp stress testing in CentOS

Source: Internet
Author: User

I recently set up an lnmp on my desktop. I want to press the lnmp to see how it works.

Nginx is only a static web server with high concurrency. Therefore, the performance bottleneck of lnmp lies in the processing capacity of php, that is, php-fpm.

Hardware

 
  1. Cpu amd Phenom (tm) II X4 945

  2. Memory 4 GB x 4

  3. Hard drive west green disk 7200 rpm

  4. Nic realtek 8169 Gigabit adaptive

Software Version

 
  1. Nginx 1.4.0

  2. Mysql 5.5.31

  3. Php 5.4.14

The re-compiled rpm package has

 
  1. Nginx

  2. Mysql

  3. Php

  4. Php-pecl-zendopcache

  5. Libevent

Lnmp optimization methods mainly include:

12345678 Kernel Parameter file handle count php cache nginx compilation nginx pagespeednginx cache nginx compression nginx CPU binding 

Use autoscaling to simulate 300 to 1000 concurrency. Each concurrency lasts for 2 minutes, and then the concurrency increases by 100. Each connection has five requests.

Command

 
  1. Autoscaling -- single_host -- host1 192.168.1.101 -- port1 80 -- uri1/phpinfo. php -- low_rate 300 -- high_rate 1000 -- rate_step 100 -- num_call 5 -- const_test_time 120 -- timeout 2 -- file result. tsv

Result

Connection count request speed req/s connection speed conn/s total number of connections limit 

Result Analysis,

When concurrency started at 300, php's processing capability gradually increased, reaching its highest peak of 390.8req/s at 800, and then gradually declined. It can be seen that php's overall processing request capability was around 380 per second, theoretically, the total traffic is about 380 million (32832000x60x60x24 = ).

Based on the 80% principle, 20% of requests are completed in 20% of the time period, 4.8 of the time is 6.5 million hours, and the number of requests that can be tolerated is 380 (4.8x60x60x6566400 = ), the actual total traffic is 8.2 million (6566400/0. 8 = 8208000 ).

According to Daniel Zhang's blog, he can achieve 700req/s (theoretically equivalent to 6 million daily visits), but he compiles the whole process, and here I use rpm for the whole process, only some core software packages are re-compiled by srpm, and the hardware is just a common desktop.

In short, there is still a lot of optimization space to continue!

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.