The session caused by phpAPC cannot save bugs and the solution APC accelerates php scripts significantly. Basically, it can increase the load capacity of the php-fpm server to two times, so in the production environment, we need to use APC to accelerate php scripts as much as possible .? Is this through web? Session caused by B php APC cannot save bugs and solutions
The acceleration effect of APC on php scripts is obvious. Basically, the load capacity of the php-fpm server can be increased to 2 times. Therefore, in the production environment, you need to use APC to accelerate php scripts as much as possible.
?
Is this through web? The pipeline stress test concluded that, in the production environment, after APC is used, the script execution speed is indeed improved (may reach 10-20%)
?
In the production environment, use session_set_save_handler to save the session to the MySQL memory table, and install the APC extension to find that the session cannot be saved. after repeated troubleshooting, the reasons for this problem are as follows:
?
The general environment Session is statically compiled into PHP, so the Session module must be loaded before the APC that is dynamically compiled into PHP. that is to say, during the request closure period, the APC request closes the function, the function will be called before the Session request.
Therefore, when the Session request closes the function call, the Class Table in the execution environment is empty. of course, a fatalerror cannot be found for the Class will be thrown .?
?
-- In essence, the database instance has been destroyed, causing an error that cannot be seen.
?
?
The solution is very simple:
At the end of the php program execution, manually call session_write_close ();
?
You can also call the function defined by register_shutdown_function.
?
However, this problem does not exist if the default file storage session mechanism of php is used.
?
?
?
?