Re: FATAL: sorry, too many clients already

[email protected]
Newsgroups gmane.comp.python.webware
Message-ID <[email protected]>
Where do I call closeDB in db.py
http://www.google.com/codesearch?hl=en&lr=&q=lang%3Apython+DBUtils+close&btnG=Search


On 1/6/07, Christoph Zwerschke <[email protected]> wrote:
>
> > I m still getting the too many clients error, now my postgresql
> > max _connections is 256
> > and shared_buffers = 2048
> >
> > and this is how pg and dbutils
> >  from DBUtils.PooledDB import PooledDB
> >     web.config._hasPooling = True
>
> Ok, only now I understand that you are using DBUtils with web.py. You
> did not mention it in the beginning. I haven't tried out web.py yet, but
> it seems the default configuration is unlimited pool size. You should
> change that and set mincached and maxmached parameters, probably in the
> web.config.db_parameters (you may have to ask about web.py specifics on
> their google group).
>
> Anyway, normally you should not hit that limit unless you are really
> handling so much concurrent users, since the pool only grows if
> connections are not given back to it. So the real problem may be that
> you are not returning your used connections back to the pool. You do
> that by simply calling the close method of your connection immediately
> after usage (see http://www.w4py.org/DBUtils/Docs/UsersGuide.html#id2).
> Also, (if possible) avoid opening database connections for anonymous
> users, and use the database only once they logged in, in order to limit
> the number of concurrent database connections.
>
> -- Christoph
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Webware-discuss mailing list
> Webware-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Webware-discuss mailing list
Webware-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/webware-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.