High load when many persistent Redis clients reconnect simultaneously to Swoole\Redis\Server #5979
mirataollahi
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am running a custom Redis-compatible server using Swoole\Redis\Server.
This server is used as a replacement for a real Redis server. Clients connect using the standard PHP Redis extension with persistent connections (PHP-FPM child processes keep the connections alive).
Under normal conditions, the server works correctly and responds very fast.
However, when the number of persistent client connections grows to around ~20000 connections, and at a certain peak moment many clients disconnect and reconnect at the same time, the Swoole server experiences very heavy load and connection pressure.
Now my server handle all persist connection commmands like PING , ECHO ,CLIENT and ....
My goals are:
Prevent massive simultaneous reconnect storms.
Keep client connections stable instead of having all clients reconnect at the same time.
Reduce server load during reconnect spikes.
I would like to know:
What is the recommended way to handle a large number of persistent Redis clients with Swoole\Redis\Server?
Are there Swoole configuration options or OS tuning parameters that can reduce reconnect spikes?
Is there a way to perform or smooth client reconnect behavior at the server level?
Environment:
PHP version: 8.2.30
Swoole version: 6.1.4
Server type: Swoole\Redis\Server
Clients: PHP Redis extension using persistent connections under PHP-FPM
OS: Linux 6.14.0-37-generic
Beta Was this translation helpful? Give feedback.
All reactions