Webman Performance

Traditional Framework Request Processing Flow

  1. nginx/apache receives the request
  2. nginx/apache forwards the request to php-fpm
  3. php-fpm initializes the environment, such as creating a list of variables
  4. php-fpm calls the RINIT of various extensions/modules
  5. php-fpm reads the php file from the disk (which can be avoided using opcache)
  6. php-fpm performs lexical analysis, syntax analysis, and compiles to opcode (which can be avoided using opcache)
  7. php-fpm executes the opcode including steps 8, 9, 10, and 11
  8. The framework initializes, such as instantiating various classes, including container, controllers, routing, middleware, etc.
  9. The framework connects to the database and performs permission validation, connects to redis
  10. The framework executes business logic
  11. The framework closes database and redis connections
  12. php-fpm releases resources, destroys all class definitions, instances, and destroys the symbol table, etc.
  13. php-fpm sequentially calls the RSHUTDOWN method of each extension/module
  14. php-fpm forwards the result to nginx/apache
  15. nginx/apache returns the result to the client

Webman's Request Processing Flow

  1. The framework receives the request
  2. The framework executes business logic (opcode bytecode)
  3. 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