[Flask] Redis max connections

Corey Boyle coreybrett at gmail.com
Fri Sep 25 15:35:18 CEST 2015


Just wanted to share this.

I found that by creating my Redis client in its own module and importing it
as needed, that when gunicorn is started, only one client gets created. I
was thinking it would create a client for each worker, but that doesn't
seem to be the case. So I think I can set my max connections based on total
allowed divided by number of servers. I did this by adding "print ('client
id= ',id(client))" inside the redis function that runs the most in my code.
The printed ID was always the same.

I would to hear from anyone who has dealt with Redis & Flask.

On Thu, Sep 24, 2015 at 4:39 PM, Corey Boyle <coreybrett at gmail.com> wrote:

> When running a Flask app via Gunicorn with gevent, how should I calculate
> the max connections setting for redispy?
>
> I am limited to 30 connections, and I'm running with WEB_CONCURRENCY set
> to 8.
>
> ~Sent from my Nexus 5
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20150925/fb99672a/attachment.html>


More information about the Flask mailing list