Webman Performance
Traditional Framework Request Processing Flow
- nginx/apache receives the request
- nginx/apache forwards the request to php-fpm
- php-fpm initializes the environment, such as creating a list of variables
- 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 to opcode (which can be avoided using opcache)
- php-fpm executes the opcode including steps 8, 9, 10, and 11
- The framework initializes, such as instantiating various classes, including container, controllers, routing, middleware, etc.
- The framework connects to the database and performs permission validation, connects to redis
- The framework executes business logic
- The framework closes database and redis connections
- php-fpm releases resources, destroys all class definitions, instances, and destroys the symbol table, etc.
- php-fpm sequentially calls the RSHUTDOWN method of each extension/module
- php-fpm forwards the result to nginx/apache
- nginx/apache returns the result to the client
Webman's Request Processing Flow
- The framework receives the request
- The framework executes business logic (opcode bytecode)
- The framework returns the result to the client
Indeed, without nginx reverse proxy, the framework only has these 3 steps. This can be said to be the pinnacle of PHP frameworks, allowing Webman to perform several times or even dozens of times better than traditional frameworks.
For more references, see Stress Testing