Table of Contents
1.阿里云云服务器ecs配置如下4核8G内存 10M带宽
2.php运行环境
3.程序优化
4.测试结果
5.结果诊断
6.求指点
Home Backend Development PHP Tutorial 服务器正式环境性能测试nginx-php 求指点性能提升突破口

服务器正式环境性能测试nginx-php 求指点性能提升突破口

Jun 23, 2016 pm 01:51 PM
performance server formal environment

由于本人身处第三级城市。无法接触到比较牛逼的公司或者环境,以下正是网站环境摸了度娘好几遍,搭建完成,测试下已寻求提升空间。也希望自己能配置出能满足公司需要的网站运行环境,不能因为我这边的瓶颈而阻碍了公司进行,希望各位大能能不吝惜指点下谢谢。

1.阿里云云服务器ecs配置如下4核8G内存 10M带宽

2.php运行环境

Tengine-2.0.3  +php-fpm*4

一个nginx主进程 一个server主站 

5个php-fpm进程 (4个负载均衡 1个备用)

3.程序优化

js/css 压缩压面缓存功能已做,可正式运行开启该功能 

首次请求页面2个css 4-5个js 2个必须js随页面同步请求,其他js基本异步加载 再次请求304 or 200 form cache处理 公共js基本200 formcache /304
页面静态缓存已做视情况可开启


4.测试结果

服务器并发量 压力测试并发100通过 200出现少量404错误 压力测试环境由于无法获取seeion 导致城市无法获取区域缓存无法调取,生产80%的无效数据查询

sigine 测试结果如下:
ransactions:                   15000 hits 请求数量
Availability:                 100.00 % 成功率
Elapsed time:                 206.74 secs 耗时
Data transferred:              67.64 MB 总请求量
Response time:                  3.02 secs  平均耗时
Transaction rate:              72.55 trans/sec
Throughput:                     0.33 MB/sec 
Concurrency:                  219.33 并发量
Successful transactions:       13577 成功 1000多个404页面都是数据库链接不足导致
Failed transactions:               0 
Longest transaction:           11.61 最长耗时
Shortest transaction:           0.06 最短耗时


内存50% 4核cpu 90% 带宽流量 入网1M 出网800k

5.结果诊断

1.nginx并发处理能力满足,目前1台,后期可视情况增加服务器 负载均衡
2.php-fpm满足,目前单服务器上运行4个php-fpm进程 同个nginx负载均衡 1个备用
3.数据库链接不足(目前最大链接数60/并发数ipo 150)(无效数据查询链接占大多数),ipo不足瓶颈,目前无需升级,待网站用户量上升,可以视情况提升数据库配置(阿里云RDS) 目前最低配置 60/150

4.PV = 并发连接数 * 统计时间 * web服务器数量/ 页面衍生连接次数 / http响应时间 / 因数
(100*3600*12*1/3/1/5=288000)28wPV 提升空间 增加负载均衡服务器数量 缩短衍生链接数,js/css 合并 通用页面缓存等

是否就是平均每天能负担得起至少20wpv?


6.求指点

希望有大能,大哥,大姐指定下:目前的服务器配置和测试结果是否相符?有无其他性能提升空间?或者能否指点下nginx或者其他一些配置上的优化?除了运行环境上的优化,硬件上的配置优化都希望能指点下,谢谢!!!



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1677
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
Windows 10 vs. Windows 11 performance comparison: Which one is better? Windows 10 vs. Windows 11 performance comparison: Which one is better? Mar 28, 2024 am 09:00 AM

Windows 10 vs. Windows 11 performance comparison: Which one is better? With the continuous development and advancement of technology, operating systems are constantly updated and upgraded. As one of the world's largest operating system developers, Microsoft's Windows series of operating systems have always attracted much attention from users. In 2021, Microsoft released the Windows 11 operating system, which triggered widespread discussion and attention. So, what is the difference in performance between Windows 10 and Windows 11? Which

The local running performance of the Embedding service exceeds that of OpenAI Text-Embedding-Ada-002, which is so convenient! The local running performance of the Embedding service exceeds that of OpenAI Text-Embedding-Ada-002, which is so convenient! Apr 15, 2024 am 09:01 AM

Ollama is a super practical tool that allows you to easily run open source models such as Llama2, Mistral, and Gemma locally. In this article, I will introduce how to use Ollama to vectorize text. If you have not installed Ollama locally, you can read this article. In this article we will use the nomic-embed-text[2] model. It is a text encoder that outperforms OpenAI text-embedding-ada-002 and text-embedding-3-small on short context and long context tasks. Start the nomic-embed-text service when you have successfully installed o

PHP array key value flipping: Comparative performance analysis of different methods PHP array key value flipping: Comparative performance analysis of different methods May 03, 2024 pm 09:03 PM

The performance comparison of PHP array key value flipping methods shows that the array_flip() function performs better than the for loop in large arrays (more than 1 million elements) and takes less time. The for loop method of manually flipping key values ​​takes a relatively long time.

Comparing the performance of Win11 and Win10 systems, which one is better? Comparing the performance of Win11 and Win10 systems, which one is better? Mar 27, 2024 pm 05:09 PM

The Windows operating system has always been one of the most widely used operating systems on personal computers, and Windows 10 has long been Microsoft's flagship operating system until recently when Microsoft launched the new Windows 11 system. With the launch of Windows 11 system, people have become interested in the performance differences between Windows 10 and Windows 11 systems. Which one is better between the two? First, let’s take a look at W

Performance comparison of different Java frameworks Performance comparison of different Java frameworks Jun 05, 2024 pm 07:14 PM

Performance comparison of different Java frameworks: REST API request processing: Vert.x is the best, with a request rate of 2 times SpringBoot and 3 times Dropwizard. Database query: SpringBoot's HibernateORM is better than Vert.x and Dropwizard's ORM. Caching operations: Vert.x's Hazelcast client is superior to SpringBoot and Dropwizard's caching mechanisms. Suitable framework: Choose according to application requirements. Vert.x is suitable for high-performance web services, SpringBoot is suitable for data-intensive applications, and Dropwizard is suitable for microservice architecture.

What impact do C++ functions have on program performance? What impact do C++ functions have on program performance? Apr 12, 2024 am 09:39 AM

The impact of functions on C++ program performance includes function call overhead, local variable and object allocation overhead: Function call overhead: including stack frame allocation, parameter transfer and control transfer, which has a significant impact on small functions. Local variable and object allocation overhead: A large number of local variable or object creation and destruction can cause stack overflow and performance degradation.

Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Jul 23, 2024 pm 09:34 PM

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

How to optimize the performance of multi-threaded programs in C++? How to optimize the performance of multi-threaded programs in C++? Jun 05, 2024 pm 02:04 PM

Effective techniques for optimizing C++ multi-threaded performance include limiting the number of threads to avoid resource contention. Use lightweight mutex locks to reduce contention. Optimize the scope of the lock and minimize the waiting time. Use lock-free data structures to improve concurrency. Avoid busy waiting and notify threads of resource availability through events.

See all articles