Deatlocks by Mysql 5.1

bodo_von_greif
Posts: 4
Joined: 2009-05-19 13:38

Re: Deatlocks by Mysql 5.1

Post by bodo_von_greif »

Hi all,

>Ich bin mal so frei und stelle es öffentlich:
danke :-)

> Allerdings zu Deinem Speziellen Fall solstest Du u.A. auch mal prüfen, ob Tabellen gelockt werden also death locks entstehen.

Innotop sagt: keine locks

Sind dann immer ca 5 Einträge sichtbar:

update zeiger set edatum = '2009-05-19', lnr = 12345, zst = now(); oder so

Einer hängt dann und die anderen brauchen dann 1200 Sekunden. Lock time = 0.000020 laut slow_query log

Hat noch jemand diese Hänger, die sich nur mit einem "killall -9 mysqld" lösen lassen?

Danke, Gruss,

Bodo
Top

bodo_von_greif
Posts: 4
Joined: 2009-05-19 13:38

Re: Deatlocks by Mysql 5.1

Post by bodo_von_greif »

Hi,

concurrent_inserts? Ist auf Standard.

Ich hatte thread_concurrency auf 8, habs mit 4 probiert aber Fehler tritt weiterhin auf.

Systemauslastung: Nicht der Rede Wert
Swap: 2 GB nicht angetastet

my.cnf:

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /raid/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
default-table-type=InnoDB
port = 3306
socket = /raid/mysql/mysql.sock
#basedir=/raid/mysql
datadir=/raid/mysql
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 1024
table_definition_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 4
max_connections = 1001
transaction-isolation = READ-UNCOMMITTED
# wait_timeout = 3600
# interactive_timeout = 3600
server-id = 1

innodb_autoextend_increment = 1G
innodb_data_home_dir = /raid/mysql/
innodb_data_file_path = ibdata1:200G:autoextend
innodb_log_group_home_dir = /raid/mysql/
innodb_buffer_pool_size = 24G
innodb_additional_mem_pool_size = 80M
innodb_log_file_size = 1G
innodb_log_buffer_size = 4G
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 1200

lower_case_table_names=1
innodb_flush_method=O_DIRECT

slow_query_log=1
#log-queries-not-using-indexes=1

# The safe_mysqld script
[safe_mysqld]
err-log=/raid/mysql/mysqld.log

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

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

MySQL Version 5.1.34-community-log x86_64

Uptime = 0 days 0 hrs 14 min 35 sec
Avg. qps = 439
Total Questions = 384404
Threads Connected = 13

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:
http://dev.mysql.com/doc/refman/5.1/en/ ... ables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 10.000000 sec.
You have 1 out of 384425 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.1/en/ ... overy.html

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

MAX CONNECTIONS
Current max_connections = 1001
Current threads_connected = 13
Historic max_used_connections = 17
The number of used connections is 1% 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
Max Memory Ever Allocated : 28.68 G
Configured Max Per-thread Buffers : 12.09 G
Configured Max Global Buffers : 28.48 G
Configured Max Memory Limit : 40.58 G
Physical Memory : 47.16 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
No key reads?!
Seriously look into using some indexes
Current MyISAM index space = 98 K
Current key_buffer_size = 384 M
Key cache miss rate is 1 : 0
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 32 M
Current query_cache_used = 3 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 10.96 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 8 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 815 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 = 5005 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_open_cache = 1024 tables
Current table_definition_cache = 512 tables
You have a total of 500 tables
You have 522 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 3398 temp tables, 1% were created on disk
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 2 M
Current table scan ratio = 121 : 1
read_buffer_size seems to be fine

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

Ausgaben von innotop während Hänger:

CXN Cmd ID User Host DB Time Query
xxx Query 7 xxx localhost xxx 13:12 update xxx set xxx1_datum = '2009-05-22', xxx1_lnr = 63523, zst = now()
xxx Query 9 xxx localhost xxx 13:12 update xxx set xxx2_datum = '2009-05-22', xxx2_lnr = 63527, zst = now()
xxx Query 10 xxx localhost xxx 13:12 update xxx set xxx3_datum = '2009-05-22', xxx3_lnr = 63526, zst = now()
xxx Query 11 xxx localhost xxx 13:12 update xxx set xxx4_datum = '2009-05-22', xxx4_lnr = 63527, zst = now()
xxx Query 12 xxx localhost xxx 13:12 update xxx set xxx5_datum = '2009-05-22', xxx5_lnr = 63525, zst = now()
xxx Query 14 xxx localhost xxx 13:12 update xxx set xxx6_datum = '2009-05-22', xxx6_lnr = 63551, zst = now()

xxx -> Anonymisiert

InnoDB Deadlocks (? for help) xxx, 2+17:12:22, InnoDB 1s :-), 14.96 QPS, 10 thd, 5.1.34-community-log

________________________ Deadlock Transactions _________________________
CXN ID Timestring User Host Victim Time Undo LStrcts Query Text
Top

bodo_von_greif
Posts: 4
Joined: 2009-05-19 13:38

Re: Deatlocks by Mysql 5.1

Post by bodo_von_greif »

Hi,

>Das ist das update, ohne where Clause, auf die Tabelle mit den zig Millionen Datensätze?
>Dann ist die Ursache gleich gefunden.

Ich bitte Dich! Wir sind hier ein professionelles Entwicklerteam mit jahrzehntelanger Datenbankerfahrung.

Die Tabelle enthält Zeiger für einen Rohdatenpuffer und hat -1- Zeile.

Die selbe Datenbank läuft unter MySQL 5.0.x extrem zuverlässig mit erheblich mehr Last, es liegt also eindeutig an der 5.1 Version.
Diese "stuck threads" sehe ich unter 5.1 zum allerersten mal.

Partitionieren mit der grössten Tabelle haben wir versucht. -Verschlechtert- aber die Performance um durchaus 20%.

Danke Dir, ein weiterhin ratloser,

Bodo

Wochenende mit wenig Last fehlerfrei durchgelaufen
Top

bodo_von_greif
Posts: 4
Joined: 2009-05-19 13:38

Re: Deatlocks by Mysql 5.1

Post by bodo_von_greif »

Hi,

ich hab bei MySQL http://bugs.mysql.com einen Report aufgemacht: Bug #45062
edit matzewe01 (link zum Bug eingefügt)
http://bugs.mysql.com/bug.php?id=45062

Gruss,

Bodo
Top