tuning apache2 mod_wdgi + TG 2.1.3 + Postgres

28 views
Skip to first unread message

NiL

unread,
Dec 2, 2011, 8:25:56 AM12/2/11
to turbo...@googlegroups.com
Hi list,

in apache conf I have

WSGIDaemonProcess myapp threads=10 processes=20 display-name=%{GROUP}

in myapp/config/app_cfg.py

I don't have anything specific so

class QueuePool(Pool):
    """A Pool that imposes a limit on the number of open connections."""

    def __init__(self, creator, pool_size=5, max_overflow=10, timeout=30,
                 **kw):
                
applies. I read in sqla's strategies that this is the default

when I stress the app with jmeter (250 connections on 30 seconds), I quickly have

OperationalError: (OperationalError) FATAL: too many clients already connected

in apache/error.log and that comes from Postgres.
(in postgres.conf max_connections is 200)

So what I'd like to understand is how to evaluate the max number of connection that my app will open to the dbms

tx

NIL

Alessandro Molina

unread,
Dec 2, 2011, 8:35:45 AM12/2/11
to turbo...@googlegroups.com
Each process of your application will open up to 15 connections (5 +
10 for momentary bursts) to the DB Server and will close them when
"pool_recycle" timeout triggers.

> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/eCA4NILT94EJ.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.

Christoph Zwerschke

unread,
Dec 2, 2011, 8:37:08 AM12/2/11
to turbo...@googlegroups.com
Am 02.12.2011 14:25, schrieb NiL:
> So what I'd like to understand is how to evaluate the max number of
> connection that my app will open to the dbms

Each process will have its own pool of connections, each pool has a
maximum of pool_size + max_overflow connections.

So in your case, you have up to 20 * (5 + 10) = 300 connections which is
greater than max_connections allows.

-- Christoph

NiL

unread,
Dec 2, 2011, 9:01:22 AM12/2/11
to turbo...@googlegroups.com
thank you very much !
I'll try to tune now (of course it's not that easy, I have several other process that binds to PG)
Reply all
Reply to author
Forward
0 new messages