Benchmark testing tool: ab
Benchmark testing tools (ab)
What is ab? win: If there is an apache development environment locally, then ab is in the bin directory under the apache directory by default. You can see it by opening the bin directory Type the following code directly (note to switch the directory where ab is located)
Wait for ab to run it yourself and get the following results
Enter the following command to get the ab help document, which explains the usage and the meaning of command options respectively
ab帮助文档的输出
英文看不懂,附上中文解释,网上抄的,我没试过
Generally use -n, -c, -t -t. The following means 10 concurrent visits in 20 seconds
Code complexity Browser parsing Web server configuration Geolocation and network issuesIf the web server is stored overseas, then we access the overseas website locally. As you can imagine, we pass through the router nodes, server nodes, and then through the optical cable under the Pacific Ocean, and then access the web server. After processing by the web server , continue with the submarine optical cable, and jump back to each server and routing node. This will definitely affect the test results (my suggestion is to conduct ab testing directly on the server) Response file sizeIf a 3MB page is sent, the server network card will split the 3MB data into a single small data packet. During the transmission process, if only one data packet is damaged or lost, all data packets will be resent, so the sent packet The smaller the better, and at the same time, the smaller the data transfer, the faster it is transferred to the user's machine. code complexityThe complexity of the code means complex processing of business logic, as well as file calls, database access, remote API interface calls, etc., which will affect the processing time Browser parsingEach browser has its own way of processing js, css, and html. Just think about the difference between IE8 and below and chrome Web server settingsAfter the general Web server is installed, simple settings can be used to implement Web services (out of the box). However, such settings do not maximize the performance of the Web server. Senior engineers are required to configure the server to maximize performance. Here are simple and practical Keep-Alive instructions. The function of Keep-Alive is that the web server opens a specific number of connections and keeps these connections open so that it can quickly process incoming requests, so that it does not open a connection for each incoming request and then process the request. , Reduce the number of processes on the server that process requests, thereby increasing the number of concurrencies.Use -k in ab for testing, such as the following sentence
Copy code
Testing tools
|

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.
