You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 7.3 introduced the FPM ini config directive request_terminate_timeout_track_finished. I think the Performance Tuning of the Yii 2 def guide should suggest turning it on.
The timeout for serving a single request after which the worker process will be killed. This option should be used when the 'max_execution_time' ini option does not stop script execution for some reason. A value of '0' means 'Off'. Available units: s(econds)(default), m(inutes), h(ours), or d(ays). Default value: 0.
request_terminate_timeout_track_finished bool
The timeout set by request_terminate_timeout is not engaged after a fastcgi_finish_request or when application has finished and internal shutdown functions are being called. This directive will enable timeout limit to be applied unconditionally even in such cases. Default value: no. Since PHP 7.3.0.
Yii's session, error handler and logging components (which are by convention defaults in Yii apps) all register shutdown functions.
So if an FPM request to a Yii app gets stuck after finishing then the request_terminate_timeout will not kill the FPM worker and it will hang indefinitely. Iiuc, PHP devs considered this a bug in FPM and introduced request_terminate_timeout_track_finished as the fix. But it is off by default.
The text was updated successfully, but these errors were encountered:
PHP 7.3 introduced the FPM ini config directive
request_terminate_timeout_track_finished
. I think the Performance Tuning of the Yii 2 def guide should suggest turning it on.I quote PHP Manual below and there's a discussion of why this config was needed here.
Yii's session, error handler and logging components (which are by convention defaults in Yii apps) all register shutdown functions.
So if an FPM request to a Yii app gets stuck after finishing then the request_terminate_timeout will not kill the FPM worker and it will hang indefinitely. Iiuc, PHP devs considered this a bug in FPM and introduced
request_terminate_timeout_track_finished
as the fix. But it is off by default.The text was updated successfully, but these errors were encountered: