KB / Web Programming / CGI, PHP, and Databases / MySQL / Conueries
From DreamHost
"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!
Contents |
[edit] Parent Article
[edit] What does that "ratio" mean on the mysql usage page?
The ratio column gives you the number of queries divided by 25 times the number of connects (queries / (connects * 25)), and is an indicator of whether you're using a disproportionate number of database connections.
A value of 1 is ideal (meaning 1 connect for every 25 queries). Ratios less than one mean you're using less than 25 queries per connection, an indication of either poor connection management or a particularly simple database. Generally, the higher the ratio, the better your database connection optimization (which is a good thing)
[edit] What does that "conueries" mean on the mysql usage page?
The conueries (conjuntion of "connects" and "queries") column shows the sum of your connections times 25 and your queries ((connections * 25) + queries).
[edit] How do I check how many conueries I've used?
Simply go to the Status > Mysql Usage area of the Web Panel and you'll see a summary for all your domains.
That page also shows you your MySQL disk usage, as well as detailed information on number of connections and number of selects on a daily basis. It also projects what your total "conuery" usage will be for the billing cycle and if that would result in any extra charges.
[edit] How many conueries am I allowed per month?
There are no longer any hard limits on conueries for any of our plans!
We still track them, but unless you're in the top .01% of our database users, you'll never need to worry about conuery usage again!
We reserve the right to have ultra-heavy users curtail their database usage (or switch to a dedicated server), but honestly unless you've got a crazy (and crazily inefficient) database-driven site that gets thousands and thousands of visitors a day, don't sweat it!
If we do contact you about heavy conuery usage, we're very nice about it and will very likely be able to work something out we can all live with!
[edit] Why do connections count so much towards conueries?
Database connections use far more system resources than the average database query does. Because of this, we want to encourage people to make as few connections as possible with their code. So we "penalize" each connection by making it worth so many conueries. You can do a lot of things to cut down the number of connections you make with your code - it all depends on your particular application.
One of our customers averages over 1300 queries per connection! Thanks to the design of his code, his "conueries" are basically just queries.
Another customer averages just one query per connection. What they've done is basically turn their "conueries" into 25 times their queries. This uses up the monthly allotment of conueries a lot faster than necessary, so you should try to keep those connections open as long as possible. It'll also make your site faster in the process.
Remember, it's possible, through the use of peristent connections, to not have to make a new connection to your database even on a new page load!
Keep in mind that if PHP is running as CGI (PHP-CGI) and not as an Apache module, you will not be able to use persistent connections.
See: What's the difference between PHP-CGI and PHP as an Apache module?

