2

We are using PhpRedis as a session handler for PHP sessions. Other than that, we are running a standard Apache/PHP configuration.

Since we are using an external Redis-as-a-service provider, we would like to keep the number of connections low as they dictate the monthly payment.

We are experiencing ever growing number of connections, even at times when the PHP site is completely idle. Connection count is always on the rise and we reach dozens of connections quickly.

Is there a way to limit / pool these connections?

The only probably related solution we found, is to limit the number of workers Apache spawns, but it seems to me like a too harsh of a solution.

We have already tried using persistent=1 in the connection string without any visible change.

Thanks for any tips.

DannyB
  • 143
  • 7

1 Answers1

1

You can actually proxy your Redis connections through a tool like twmproxy or redis-proxy. The proxy will maintain the connections persistently and can queue, route, and limit connections to the Redis servers.

This configuration can also help with issues of High Availability and Load Balancing.

Will
  • 1,127
  • 10
  • 25