Home >PHP Framework >Swoole >How to hot update swoole
With the iterative update of swoole version, it has become stable enough. It is used by major companies such as Alibaba, Tencent, YY, etc., and is also used by many friends in the gaming circle. These friends often mention a question, Every time the code is updated, the service needs to be stopped and then restarted to update the code. However, this approach is relatively crude.
In fact, swoole provides the reload feature and fully supports hot updates of code.
Before introducing swoole's reload, let's briefly talk about how the web method takes effect immediately after changing the file:
A few Concept: (Recommended Learning: Swoole Video Tutorial )
## 1) SAPI: It can be simply understood as a unified interface of the PHP engine, so that PHP can interact with external programs to interact 2) Four key calls in the life cycle of php: MINT -> RINT -> RSHUTDOWN -> MSHUTDOWN3) fpm: fastcgi process managerStep 4: Execute the RSHUTDOWN method, Step 5: If you want to stop fpm, MSHUTDOWN will be executed.
fpm processes each request by repeatedly executing steps 2~4.
The above is the detailed content of How to hot update swoole. For more information, please follow other related articles on the PHP Chinese website!