General Community > Off-Topic

Too many connections - site crash

<< < (2/2)

thorn:
Hello,

can you fetch some mysql-settings from your db, just to check whether the settings are ok.
Please add a page from type CODE, and copy&paste this code into it

--- Code: ---echo "Variables<br>";
$query = $database->query("SHOW VARIABLES WHERE Variable_Name RLIKE
 '(table_cache|max_connections|max_user_connections|open_files_limit|connect_timeout|^version.*)'");
if($query->numRows() > 0) {
  while($res = $query->fetchRow()) {
    echo "{$res[0]} = {$res[1]}<br>";
  }
}
echo "<br>Status<br>";
$query = $database->query("SHOW STATUS WHERE Variable_Name RLIKE
'(Max_used_connections|^Open_.*)'");
if($query->numRows() > 0) {
  while($res = $query->fetchRow()) {
    echo "{$res[0]} = {$res[1]}<br>";
  }
}

--- End code ---

Since mysql 5.1, it's possible to set 'quotas' per user (max_connections, max_user_connection s, max_updates, max_questions in mysql.user).
See http://dev.mysql.com/doc/refman/5.1/en/user-resources.html
Maybe your hoster make use of this?

thorn.

Pmaurer:
Variables
connect_timeout = 10
max_connections = 600
max_user_connection s = 60
open_files_limit = 33378
table_cache = 16384
version = 5.0.45-community-log
version_comment = MySQL Community Edition (GPL)
version_compile_mac hine = x86_64
version_compile_os = unknown-linux-gnu

Status
Max_used_connection s = 17
Open_files = 9393
Open_streams = 0
Open_tables = 5437

thorn:
Hello,

looks fine at all, ... but i'am not a db-professional.

Do you use persistent connection (pconnect) in Coppermine or xmb? --> deactivate

thorn.

Pmaurer:
no, i'm pretty sure i'm not using pconnect for either of those.... :?

maverik:
have a look:

http://www.howtogeek.com/howto/linux/using-a-mysql-performance-tuning-analyzer-script/

http://www.day32.com/MySQL/

or german:

http://serversupportforum.de/forum/sql/14308-mysql-performance-tuning-mit-tuning-primer-sh-script.html



greets maverik

Navigation

[0] Message Index

[*] Previous page

Go to full version