xiven.com stating the blatantly obvious since 2002

So now, what is a conuery?

As noted earlier, our database access for Voidwars has been shooting through the roof with the number of queries reaching never before seen heights. Here's that graph:

Graph showing number of queries against time.  The graph clearly shows a steady and marked increase in the number of queries.

Database access with our web hosts is measured in conueries:

Conueries is a term we at DreamHost came up with to measure MySQL database usage. The word is a combination of connections and queries, as that is what the unit is derived from! Basically, the number of MySQL queries you have in a month, plus 25 times the number of connections you have is your total conueries for a month!

Trouble is, if we go over a certain amount per month, we get charged extra. Which is bad, especially when you're running a free game (amazingly, bandwidth is not a problem for us yet since we're only sending about 100MB of data per day).

We're already using persistent connections which reduces the number of database connections (the things worth 25x a query) that we make, by a very large amount. Now the problem is purely the number of database queries.

We're using JOINs wherever possible (ie. a lot) to reduce the number of queries needed and to improve general efficiency of the code, but it's not enough.

The reason for the large increase is almost certainly due to the rapid increase in the number of players that we had recently (until the game reached maximum capacity of 90). The main problem lies in the ticker. The ticker is a piece of code that executes once every 3 minutes and performs all actions in the game (executing ship orders, calculating resources mined/spent, increasing populations, calculating combat). It has been optimised in the past, but it would seem that it needs more work.

Not to worry though, we've spotted some places where we can improve things and GwieF will soon have it running much more efficiently for us (well we can't all work on it at once ;)). If it becomes necessary though, we may have to decrease the speed of the ticker (eg. make it once every 6 minutes). That wouldn't exactly be the end of the world.

Posted: 2003-01-24 16:37:22 UTC by Xiven | Cross-references (0) | Comments (2)

Cross-references

None

Comments

  • Basil Crow (2003-01-30 19:02:51 UTC)

    Why not just switch to another host that has a better system? iPowerWeb doesn't charge for "conqueries," for example. . . .

  • Xiven (Registered) (2003-01-31 02:29:45 UTC)

    This is why:

    "Q. Does iPowerWeb support Crons?"

    "A. If you are need to schedule scripts to run at specific times as in creating server side cron jobs, your iPowerWeb account will not be able to support this feature."

    There are very few hosts who will allow you to run a relatively complex script once every 3 minutes.