In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the stress testing of Apache and the summary of common knowledge of web performance optimization. The notes are compiled from the popular book "Building a High performance web site". Friends who need it can refer to it.
What is bandwidth?
Misunderstandings: "the speed of data moving in the line", "the speed of data transmission"
By bandwidth, we refer to the transmission speed of data, such as a 100-megabit Nic, which means that the maximum fa transmission speed of the Nic is 100Mbps, that is, the Nic can send up to 100Mb data in one second. Related factors:
The ability of the data transmitting device to transmit the binary signal to the line, also known as the signal transmission frequency, and the ability of the data receiving device at the other end to receive the binary signal, including the degree of support of the line to the transmission frequency
The parallelism of data transmission media is equivalent to the concept of bus width of computer system.
Habit and agreement
B: bit unit bit
B: byte unit Byte
1KB = 1024B
1kb = 1000b
The conversion between M and K is the same as above
What is throughput?
Throughput (Throughput) refers to the number of requests processed by the web server per unit time (in reqs/s)
Generally speaking, we are more concerned about the upper limit of the server's concurrent processing capacity, that is, the maximum throughput.
About stress testing
Several prerequisites for throughput-based stress testing:
The number of concurrent users; (the number of users who send requests to the server at the same time)
Total number of requests
Request resource description
Several important indicators:
Request waiting time
Average request waiting time for users (mainly measures the server's quality of service to a single user in the case of a certain number of concurrent users)
Server average requester care time (measure the overall service quality of the server)
Stress testing tools: ab, LoadRunner, Jmeter included with Apache
Server system load
$cat / proc/loadavg
0.58 1.19 0.64 1/92 8306
Here the three numbers of 0.58 1.19 0.64 represent the system load calculated by the system in the last 1 minute, 5 minutes and 15 minutes respectively.
1 represents the number of processes in the current running queue, 92 represents the total number of processes at this time, and 8306 represents the last process ID created so far
Introduction to the use of Apache ab
In "Building a high-performance web site", we talked about using ab, a stress testing tool that comes with apache, to test the performance of Server. We searched for relevant knowledge and sorted it out as follows:
Ab, whose full name is ApacheBench, is a gadget that comes with Apache. Http://www.bbqmw.net/ is specially used for HTTP Server's benchmark testing and can simulate multiple concurrent requests at the same time. Here is a practical example to introduce the use of ab:
[xiekeli@localhost ~] $ab-n 1000-c 50 http://www.abc.com/a.php / / generate 1000 http requests, and the number of concurrent users each time: 50
This is ApacheBench, Version 2.0.40-dev apache-2.0Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright 2006 The Apache Software Foundation Http://www.apache.org/ Benchmarking www.abc.com (be patient) Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsFinished 1000 requests Server Software: Apache / / platform under test Apache Server Hostname: www.abc.com / / server hostname Server Port: 80 Document Path: / a.phpDocument Length: 231bytes / / document size Concurrency Level: 50 / / concurrency Time taken for tests: 12.818547 secondsComplete requests: 1000 / / number of completed requests Failed requests : 0 / / number of failed requests Write errors: 0Non-2xx responses: 1001Total transferred: 438438 bytes / / Network traffic in the entire scenario HTML transferred: 231231 bytes / / HTML content transmission in the entire scenario Requests per second: 78.01 [# / sec] (mean) / / throughput That is, the number of requests processed per second (mean in parentheses indicates an average) Time per request: 640.927 [ms] (mean) / / response time of each request (mean in parentheses indicates that this is an average Time per request: 12.819 [ms] (mean, across all concurrent requests) / / response time of each request (as described in parentheses below) Is the average by all concurrency) Transfer rate: 33.39 [Kbytes/sec] received / / average traffic per second on the network, which can help eliminate the problem of excessive network traffic leading to longer response time Connection Times (ms) / / decomposition of time spent on the network The specific algorithm for each item of data is not very clear min mean [+ /-sd] median maxConnect: 186307 598.1 9188Processing: 188,271 289.6 219.9 1923Waiting: 188,245,213 1416Total: 376,579,427 9380 / / response of all requests in the entire scenario. In the scenario, there is a response time for each request, in which 50% of the users' response time is less than 1093 milliseconds, 60% of the users' response time is less than 1247 milliseconds, and the maximum response time is less than 7785 milliseconds. Because for concurrent requests, cpu does not actually process concurrent requests at the same time, but rotates them one by one according to the time slices obtained by each request So basically the first Time per request time is approximately equal to the second Time per request time multiplied by the number of concurrent requests Percentage of the requests served within a certain time (ms) 50% 42766% 43075% 43180% 43390% 45195% 163098% 338299% 3429100% 9380 (longest request)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.