--
You received this message because you are subscribed to the Google Groups "Google App Engine Ranklist" group.
To post to this group, send email to google-app-en...@googlegroups.com.
To unsubscribe from this group, send email to google-app-engine-r...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-app-engine-ranklist?hl=en.
I batched my updates, which seems to be working pretty well. I can get up to 50 in a single request before I start having memory issues, but fifty seems to be OK for now, I end up getting about 38 player updates right now every minute on average. If it goes much higher I can slap a task queue on the cron job, and when I get to fifty just add a task to continue it.
The log lines look like this:08-14 03:28PM 00.970 /traintasks/setranks 200 4253ms 19410cpu_ms 14024api_cpu_ms 0kb AppEngine-Google; (+http://code.google.com/appengine
I am assuming the high CPU times are becuase of the large amount of work the datastore is doing to get all the entites?
--
You received this message because you are subscribed to the Google Groups "Google App Engine Ranklist" group.
To post to this group, send email to google-app-en...@googlegroups.com.
To unsubscribe from this group, send email to google-app-engine-r...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-app-engine-ranklist?hl=en.
Hi Michael,I'm only guessing, but probably the best way to deal with this is batch your updates. Whenever a scoreboard row changes in score, set a 'dirty' field in it to True; then, separately, have a cron job continually querying for rows with 'dirty' set to true and then running set_scores on the ranker for all of them. That way you get the advantage of having a lot of updates at the same time, and during periods of heavy use you just fall behind a bit instead of failing requests.
Beyond that I think you'd need to get into specifics of the tree structure and whether certain nodes happen to be getting hit more often than the others. For example, if you're calling num_ranked_users (or whatever it's called) a lot, you could consider slapping a memcache on that with an expiry time of 20s so your root node doesn't get hit nearly as often.
It'd be nice if Memcache had a way to atomically add something to a list the way you can do atomic increment and decrement operations. That would make the whole issue very easy to deal with.
Can I put all the calls to different individual players in the same transaction? I thought you would have issues with that.