When Swoole is on heavy load and heavy requests I kept getting this Log:
[2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
[2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
[2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
[2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
[2021-01-24 16:07:39 *33835.4] NOTICE finish (ERRNO 1005): session#21025 does not exists
[2021-01-24 16:07:39 *33835.4] NOTICE finish (ERRNO 1005): session#21025 does not exists
[2021-01-24 16:07:39 *33835.4] NOTICE end (ERRNO 1005): session[21025] is closed
Or
[2021-01-23 14:07:22 *5300.3] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10002] is closed
[2021-01-23 14:07:22 *5300.3] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10042] is closed
[2021-01-23 14:08:21 *5326.29] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10508] is closed
[2021-01-23 14:18:15 *5333.36] NOTICE finish (ERRNO 1005): session#12755 does not exists
[2021-01-23 14:18:15 *5333.36] NOTICE end (ERRNO 1005): session[12755] is closed
In example I send total 500k requests with 1k concurrent requests, it logs this errors and hangs !
And suddenly it hangs !
My server is Centos 7, 8 gigabytes of RAM and 4 cores of CPU.
Swoole is running with 40 workers, + 30 Master-Worker and 8 Reactor.
Even in production this happens too.
Can some one help me or explain me why this happens and maybe how can I solve it?
Thanks.
Advertisement
Answer
Ok I have found where is the problem. Actually it’s not a bug in Swoole or my application. It’s a notice log that can get disabled with log_level property of Swoole server configuration. This happens when a Client closes swoole tab or browser (Closes client connection), so it gets disconnected so Swoole cannot retrieve users session and logs this notice. Also if you are using bench marking tools like Apache ab or WRK, If a problem occurs, These testers will terminate all other requests and stop whole testing. So sessions get closed and logs written again.