Andauernde Datenbankaussetzer

gingi

New Member
Hallo Leute!

Ich habe einen Root-Server bei 1&1. Anfang des Jahres machte ich ein Update von Suze Version 9.3, Ples 8.0 auf Suse 10.3 mit Plesk 8.6.

Soweit lief auch alles gut. Nur seit dem Update habe ich permanente Datenbank-Abstürze, die imer mehr wurden. Mit der Zeit wurde das immer schlimmer und jetzt ist es so, wenn ich den Server neu starte, dass die Datenbank gerade mal ein paar Minuten läuft und dann kommt wieder die Fehlermeldung "Error establishing a database connection". Dies betrifft alle Domains die auf dem Server laufen und eine Datenbank benötigen. Manchmal findet die Datenbank mit dem Reloud einer Webseite die Verbindung wieder, bis sie dann kurze Zeit später wieder total auflegt.

Ich muß immer den Server neu starten, um für einige Zeit die Domains wieder zum Laufen zu bringen. Ein Restart über Putty hat überhaupt keine Auswirkung und die Datenbank wird nicht neu gestartet. Fakt ist damit, es ist ein MYSQL-Server Problem.

Leider bin ich keine Server-Experte, auch der Support von 1&1 konnte mir nicht weiterhelfen. Ein Freund, der für mich das immer erledigte ist leider nicht mehr kontaktierbar. Darum wende ich mich an Euch.

Leider bekomme ich keine andere Fehlermeldung wie die oben ewähnte, außer beim in einem Unterverzeiochnis installierten Counter

Error number: 2002
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)

Ich weis überhaupt nicht wo dabei ich ansetzten sollte. Vielleicht könnt ihr mir helfen?
 
MySQL hat noch eigene Logfiles. Entweder unter /var/lib/mysql/ oder /var/log/mysql*.
Wenn die Datenbank durch einen Reload der Webseite mal wieder kommt, dann ist der Fehler evtl. ein zu kleiner Wert für MaxConnections. Alternativ könnte es auch eine defekte Datenbank-Tabelle sein.

Logge Dich auf der Konsole per Putty in die Datenbank ein:
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow`
Und beobachte mit "show processlist;" den MySQL-Server.
(Alternative: mytop)

Zusätzlich lädst Du das tuning-primer-Script (siehe MySQL: Tuning vom feinsten - huschi.net ) und postest hier die gesamte Ausgabe. (Aber bitte nicht direkt nach einem Neustart des Servers.)

huschi.
 
Last edited by a moderator:
Vielen Dank für die Hilfe Huschi!

hier mal was er auswirft bei der "show processlist;"
Code:
mysql> sxxxxxxx:~ # mysql -uadmin -p`cat /etc/psa/.psa.shadow`
    -> Welcome to the MySQL monitor.  Commands end with ; or \g.
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    6
Current database: *** NONE ***

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's15228311:~
Welcome to the MySQL monitor.  Commands end with' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or' at line 1
    -> Your MySQL connection id is 11
    -> Server version: 5.0.67-Max SUSE MySQL RPM
    ->
    -> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    ->
    -> mysql> show processlist;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.
Your MySQL connection id is 11
Server version: 5.0.67-Max SUSE MySQL RPM

Type' at line 1
mysql> +----+-------+-----------+------+---------+------+-------+------------------+
    -> | Id | User  | Host      | db   | Command | Time | State | Info             |
    -> +----+-------+-----------+------+---------+------+-------+------------------+
    -> | 11 | admin | localhost | NULL | Query   |    0 | NULL  | show processlist |
    -> +----+-------+-----------+------+---------+------+-------+------------------+
    -> 1 row in set (0.00 sec)
    ->
    -> mysql> show processlist;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+----+-------+-----------+------+---------+------+-------+------------------+
| ' at line 1
mysql> +----+-------+-----------+------+---------+------+-------+------------------+
    -> | Id | User  | Host      | db   | Command | Time | State | Info             |
    -> +----+-------+-----------+------+---------+------+-------+------------------+
    -> | 11 | admin | localhost | NULL | Query   |    0 | NULL  | show processlist |
    -> +----+-------+-----------+------+---------+------+-------+------------------+
    -> 1 row in set (0.00 sec)
    ->
    -> mysql>
und hier das tuning-primer-Script
Code:
mysqld is alive

        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.67-Max x86_64

/usr/bin/tuning-primer.sh: line 389: bc: command not found
/usr/bin/tuning-primer.sh: line 390: bc: command not found
/usr/bin/tuning-primer.sh: line 391: bc: command not found
/usr/bin/tuning-primer.sh: line 392: bc: command not found
/usr/bin/tuning-primer.sh: line 393: bc: command not found
/usr/bin/tuning-primer.sh: line 394: bc: command not found
Uptime =  days  hrs  min  sec
Avg. qps = 2
Total Questions = 276
Threads Connected = 1

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
[url=http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html]MySQL :: MySQL 5.0 Reference Manual :: 5.1.3 Server System Variables[/url]
Visit [url=http://www.mysql.com/products/enterprise/advisors.html]MySQL :: MySQL Enterprise Advisors[/url]
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 297 that take longer than 10 sec. to complete
Your long_query_time may be too high, I typically set this under 5 sec.

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See [url=http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html]MySQL :: MySQL 5.0 Reference Manual :: 6.3 Point-in-Time Recovery[/url]

WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 1
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 1
Historic max_used_connections = 2
The number of used connections is 2% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

MEMORY USAGE
/usr/bin/tuning-primer.sh: line 1205: bc: command not found
/usr/bin/tuning-primer.sh: line 1206: bc: command not found
/usr/bin/tuning-primer.sh: line 1230: bc: command not found
/usr/bin/tuning-primer.sh: line 1233: bc: command not found
/usr/bin/tuning-primer.sh: line 1234: bc: command not found
/usr/bin/tuning-primer.sh: line 1236: bc: command not found
/usr/bin/tuning-primer.sh: line 1238: [: -gt: unary operator expected
/usr/bin/tuning-primer.sh: line 351: [: max_memoryHR: integer expression expecte                                                                             d
/usr/bin/tuning-primer.sh: line 357: [: max_memoryHR: integer expression expecte                                                                             d
/usr/bin/tuning-primer.sh: line 363: [: max_memoryHR: integer expression expecte                                                                             d
/usr/bin/tuning-primer.sh: line 370: export: `=max_memoryHR': not a valid identi                                                                             fier
Max Memory Ever Allocated :  bytes
/usr/bin/tuning-primer.sh: line 351: [: per_thread_buffersHR: integer expression                                                                              expected
/usr/bin/tuning-primer.sh: line 357: [: per_thread_buffersHR: integer expression                                                                              expected
/usr/bin/tuning-primer.sh: line 363: [: per_thread_buffersHR: integer expression                                                                              expected
/usr/bin/tuning-primer.sh: line 370: export: `=per_thread_buffersHR': not a vali                                                                             d identifier
Configured Max Per-thread Buffers :  bytes
/usr/bin/tuning-primer.sh: line 351: [: global_buffersHR: integer expression exp                                                                             ected
/usr/bin/tuning-primer.sh: line 357: [: global_buffersHR: integer expression exp                                                                             ected
/usr/bin/tuning-primer.sh: line 363: [: global_buffersHR: integer expression exp                                                                             ected
/usr/bin/tuning-primer.sh: line 370: export: `=global_buffersHR': not a valid id                                                                             entifier
Configured Max Global Buffers :  bytes
/usr/bin/tuning-primer.sh: line 351: [: total_memoryHR: integer expression expec                                                                             ted
/usr/bin/tuning-primer.sh: line 357: [: total_memoryHR: integer expression expec                                                                             ted
/usr/bin/tuning-primer.sh: line 363: [: total_memoryHR: integer expression expec                                                                             ted
/usr/bin/tuning-primer.sh: line 370: export: `=total_memoryHR': not a valid iden                                                                             tifier
Configured Max Memory Limit :  bytes
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Physical Memory :  M
Max memory limit seem to be within acceptable norms

KEY BUFFER
12697 * 1024 / 16777216 * 100
/usr/bin/tuning-primer.sh: line 647: bc: command not found
/usr/bin/tuning-primer.sh: line 648: bc: command not found
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current MyISAM index space =  M
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current key_buffer_size =  M
Key cache miss rate is 1 : 74
Key buffer free ratio =  %
/usr/bin/tuning-primer.sh: line 681: [: -le: unary operator expected
/usr/bin/tuning-primer.sh: line 685: [: -le: unary operator expected
/usr/bin/tuning-primer.sh: line 689: [: -le: unary operator expected
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size

SORT OPERATIONS
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current sort_buffer_size =  K
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current read_rnd_buffer_size =  K
Sort buffer seems to be fine

JOINS
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current join_buffer_size =  K
You have had 1 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 1024 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 64 tables
You have a total of 832 tables
You have 64 open tables.
Current table_cache hit rate is 7%, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current max_heap_table_size =  M
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current tmp_table_size =  M
Of 167 temp tables, 26% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
/usr/bin/tuning-primer.sh: line 332: bc: command not found
Current read_buffer_size =  K
Current table scan ratio = 67 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 477
Your table locking seems to be fine

sxxxxxxx:~ #

grüße gingi

MOD: Bitte CODE-Tags verwenden!
 
Last edited by a moderator:
Erstens: Bitte CODE-Tags verwenden!

Zweitens:
bc: command not found
Was gegen diesen Fehler zu tun ist steht im oben verlinkten Howto. Ist nicht wirklich schwer...

Dein MySQL-Log scheint auch etwas seltsam zu sein. Ich würde sagen, Du hast irgendwann [Strg]+[Einfg] oder einfach die rechte Maustaste geklickt.

huschi.
 
Moin,

starte einmal mysqld mit der --console option, und schau ob er dir so etwas ansagt. durchvorste auch mal dein /var/log/messages nach einem sigsegv.

andreas
 
Back
Top