On Fri, Dec 5, 2008 at 00:32, Justin Mecham <[EMAIL PROTECTED]> wrote:
> > I'm guessing several thousand calls for the player object per minute, > at a minimum. And if each of those creates a write operation, it seems > to me that'd be a big batch of avoidable disk paging. > > Every time you access the player object, you get it from the cache, which is fine. Every time you update the object, you should typically first update the cached object, then write the changes to the DB. If you have lots of small updates and you can stand to lose some of them, you can put a timestamp on the cached object that tells you when you last wrote changes to the DB. That way, every time you do a small update you check the timestamp, if it's less than whatever threshold you choose, you just update the cached object, but if it's larger, you update the timestamp as well, and write the changes to disk. /Henrik
