How to rotate users better than randomizing?
-
Our host has limits on how many queries each USER can make on each db, so we got round it for a while by using (in wp-config.php)
$auser = array( ‘one’,’two’,’three’,’four’,’five’,’six’ );
$user = $auser[ rand(0,5) ];
define(‘DB_USER’, $user); // Your MySQL usernameThis worked for a while, but as the blog gets busier still, of course what happens it that it will randomize it back to a user who’s quota is “filled” for that hour.
Is there any way of “rotating” rather than randomizing? In other words, when the problem happens, the error_log will show similar to:
[07-Jan-2009 03:30:02] WordPress database error MySQL server has gone away for query SELECT * FROM wp_users WHERE ID = 9738 LIMIT 1 made by get_userdata
This means the user insert/read quota has been exhausted – if the log was read each time, if that error occured, increment the user and try again.
Is this possible? Thanks!
- The topic ‘How to rotate users better than randomizing?’ is closed to new replies.