[SQLObject] load balancing and SQLObject cache
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Егор С. <eg...@co...> - 2011-07-19 03:59:37
|
I have a web application with two load-balanced webservers and a separate postgres database server. When SQLObject instance is updated, the update is processed randomly through either of the servers. Sometimes user does the update on one server, and immediately opens object for reading on another. So, if caching is on, it looks like database is not getting updated. If I turn caching off by setting sqlmeta.cacheValues to False, then call to each and every property issues a separate SQL select, and this slows everything down a lot. What would be the right approach to minimize number of selects on a single webpage? Keeping cache on, but calling object.expire(), object.another.expire() after referencing any properties? Trying to lower cullFrequency parameter of cache? Thank you. |