[ckan-dev] DB connection pooling

Emanuele Tajariol etj at geo-solutions.it
Fri Jan 31 13:53:49 UTC 2014


Hi list,

in a CKAN instance I am working on, I found a problem dealing with database 
disconnections (the DB is shut down every night for maintenance).
I guess that connection pooling would help mitigating the disconnections 
issue.

Referencing to this page
 http://docs.sqlalchemy.org/en/rel_0_7/core/pooling.html
I can see that SQLAlchemy offers quite a few parameters for configuring a 
connection pool when the engine is created.

Looking at how SQLAlchemy is initialized here
   https://github.com/ckan/ckan/blob/master/ckan/config/middleware.py#L344
it seems that in CKAN you can only configure SQLAlchemy with the connection URL 
(which is of course mandatory), but other parameters can not be specified. 

Am I missing any piece of code where the pool is instanced and configured?

If not, the idea is to open a pull request for a patch that reads optional 
properties from the ini file (e.g.: 
- sqlalchemy.pool_recycle
- sqlalchemy.pool_size
- sqlalchemy.max_overflow
- sqlalchemy.pool_timeout , ...)
and pass them as params to the sqlalchemy engine.

Any pointer to anything I'm missing?


   Thanks,
   Emanuele

-- 
==
Our support, Your Success! 
Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Emanuele Tajariol
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:    +39 0584 1660272
mob:   +39  380 2116282 

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------



More information about the ckan-dev mailing list