webman Performance
Traditional Framework Request Processing Flow
- Nginx/Apache receives the request.
- Nginx/Apache passes the request to php-fpm.
- Php-fpm initializes the environment, such as creating a variable list.
- Php-fpm calls the RINIT of various extensions/modules.
- Php-fpm reads the PHP file from the disk (which can be avoided using opcache).
- Php-fpm performs lexical analysis, syntax analysis, and compiles into opcode (which can be avoided using opcache).
- Php-fpm executes the opcode, including 8, 9, 10, 11.
- The framework initializes, such as instantiating various classes, including containers, controllers, routes, middleware, etc.
- The framework connects to the database, performs authorization, and connects to Redis.
- The framework executes the business logic.
- The framework closes the database and Redis connections.
- Php-fpm releases resources, destroys all class definitions and instances, and destroys the symbol table, etc.
- Php-fpm sequentially calls the RSHUTDOWN methods of various extensions/modules.
- Php-fpm forwards the result to Nginx/Apache.
- Nginx/Apache returns the result to the client.
webman Request Processing Flow
- The framework receives the request.
- The framework executes the business logic.
- The framework returns the result to the client.
That's right, in the case of no Nginx reverse proxy, the framework only has these 3 steps. It can be said that this is the ultimate for a PHP framework, which makes webman's performance several times or even tens of times better than traditional frameworks.
For more information, refer to Stress Testing.