Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

VERY slow InnoDB writes (in the teens/sec) (3 replies)

$
0
0
Hi,

I just upgraded my MySQL to the community edition 64-bit 5.6.14 and I'm having VERY VERY slow response from the server.

Here is my.cnf:

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
#myisam_sort_buffer_size = 8M
server-id = 1
explicit_defaults_for_timestamp

general_log = 0
log_output = TABLE
long_query_time = 4
log-queries-not-using-indexes
character_set_server = utf8
character-set-server = utf8
collation-server = utf8_unicode_ci
init-connect = 'SET NAMES utf8'
log-error = /var/log/mysqld.error.log
slow-query-log = 1

innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/lib/mysql
innodb_buffer_pool_size = 16M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_file_per_table = 1
innodb_log_file_size = 50M

The initial issue was a java program that remotely tries to insert several thousand rows of data in 1600 row batches. The first batch would be very quick but the 2nd on would take forever (minutes each).

I verified this with Mysqlworkbench which is telling me I'm using 100% Key Efficiency, 25.1% Innodb Buffer, and between 17 and 77 innodb writes per second (it does spike up every once in a while to 300 -- very hills & valleys graph).

The only three variables that stick out (from phpmyadmin):
Handler read rnd next 1180061
Innodb buffer pool reads 29783
Opened tables 26375

To do a local test, I dumped a 80MB database using Mysqlworkbench, moved the sql file locally to the server and re-imported the sql into a new database:

time mysql -p --host=192.168.1.4 --user=root --port=3306 --default-character-set=utf8 --comments --database=NEW-InnoDB < Dump20131107-1.sql
Enter password:
1.098u 0.088s 1:15.47 1.5% 0+0k 0+0io 0pf+0w

I then edited the Dump file and replaced all occurrences of InnoDB with MyISAM:

#time mysql -p --host=192.168.1.4 --user=root --port=3306 --default-character-set=utf8 --comments --database=NEW-MyISAM < Dump20131107-1.sql
Enter password:
1.070u 0.064s 0:21.05 5.3% 0+0k 0+0io 0pf+0w

1:15s vs 21s

iostat on the server shows everything is being written to disk:

avg-cpu: %user %nice %system %iowait %steal %idle
1.65 0.00 0.30 22.23 0.00 75.81

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 134.20 0.00 7905.60 0 79056
dm-0 990.70 0.00 7904.80 0 79048
dm-1 0.00 0.00 0.00 0 0
dm-2 0.00 0.00 0.00 0 0

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>