plugin-QueuedTracking icon indicating copy to clipboard operation
plugin-QueuedTracking copied to clipboard

Use persistent connections to redis instance

Open iprok opened this issue 8 years ago • 3 comments

Please make an option to use persistent connection to redis: https://github.com/phpredis/phpredis#pconnect-popen .

It's much faster then raw "connect" (and sometimes then unix socket!) and the only change to implement is to change "connect" to "pconnect" in your code when connecting to redis instance.

We've done it in our installation when we begin to get too many redis connections. Everything goes fine.

iprok avatar Apr 13 '17 08:04 iprok

Thanks for the suggestion. Pull request welcome!

mattab avatar Jun 21 '17 02:06 mattab

@iprok , can you please confirm if this has been performance tested? Seems the downside of this is more number of open connections in the Redis Server side, which I believe can be handled with the timeout setting.

Thanks in advance.

siva538 avatar Sep 26 '18 07:09 siva538

We have implemented twemproxy / nutcracker in our environment with great success. For this to work we had to modify https://github.com/matomo-org/plugin-QueuedTracking/blob/master/Queue/Backend/Redis.php#L260-L262 to not selecting as DB, as this is not a supported command in twemproxy.

toredash avatar May 07 '19 09:05 toredash