MySQL Forums
Forum List  »  Performance

Question on slow queries
Posted by: Michele Quaini
Date: May 30, 2013 04:18AM

Hello, I ran a tool on my website and i got these ranking of slow queries. The db engine is INNODB, and i see that the COMMIT and some UPDATES is @ first position. How can i fix this problem? Below i have pasted my my.cnf. May thanks.

# 838.2s user time, 2.2s system time, 113.31M rss, 199.30M vsz
# Current date: Thu May 30 10:09:18 2013
# Hostname: ***
# Files: /var/lib/mysql/mysql-slow.log
# Overall: 3.25M total, 1.11k unique, 64.27 QPS, 0.18x concurrency _______
# Time range: 2013-05-29 19:51:01 to 2013-05-30 09:53:35
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 8915s 1us 24s 3ms 1ms 70ms 27us
# Lock time 343s 0 5s 105us 260us 5ms 0
# Rows sent 17.53M 0 151.08k 5.66 19.46 129.22 0
# Rows examine 245.73M 0 151.08k 79.31 28.75 1.47k 0
# Query size 242.82M 5 55.10k 78.28 183.58 101.50 36.69

# Profile
# Rank Query ID Response time Calls R/Call Apdx V/M Item
# ==== ================== =============== ======= ====== ==== ===== ======
# 1 0x813031B8BBC3B329 944.3823 10.6% 14740 0.0641 0.99 1.47 COMMIT
# 2 0x2946F5C805C641F0 731.4449 8.2% 4398 0.1663 0.98 1.80 UPDATE character_stats
# 3 0x06BA864C75EF674B 526.1830 5.9% 1452 0.3624 0.96 1.33 UPDATE users
# 4 0xDD330E911DAEA564 462.8022 5.2% 2205 0.2099 0.98 1.16 UPDATE characters
# 5 0xBD6E40FB34D33F35 407.3738 4.6% 4344 0.0938 0.99 1.47 UPDATE items
# 6 0x401B579DF69F42EC 369.0405 4.1% 240553 0.0015 1.00 1.94 SELECT characters
# 7 0x594F579F62DEA5CF 367.6932 4.1% 1264 0.2909 0.96 1.75 INSERT stats_globals
# 8 0x02744255916D5340 349.9996 3.9% 144223 0.0024 1.00 1.63 SELECT users
# 9 0x1A0E0318A9EB259C 273.7407 3.1% 124777 0.0022 1.00 0.26 SHOW COLUMNS
# 10 0xA35332B856A53F6B 199.9855 2.2% 111913 0.0018 1.00 0.19 SHOW COLUMNS
# 11 0x75B1DBD48BF47623 199.0869 2.2% 129 1.5433 0.74 4.24 INSERT stats_globals
# 12 0x582611CFF1C063BB 183.3514 2.1% 649 0.2825 0.98 0.85 UPDATE characters
# 13 0xDF1FB1A2536CEFBE 173.0813 1.9% 619 0.2796 0.97 0.81 UPDATE messages
# 14 0x754B29BDA72EF43B 168.5860 1.9% 627 0.2689 0.97 0.89 INSERT toplistvotes
# 15 0xE5C6D63541E4E1E2 164.9002 1.8% 1452 0.1136 0.99 1.38 INSERT trace_user_logins
# 16 0x0D2F027A30BDA707 163.3852 1.8% 626 0.2610 0.98 0.79 INSERT messages
# 17 0x076B778757C29A1E 140.1671 1.6% 358 0.3915 0.96 3.75 UPDATE items
# 18 0x8F02E08F358A68AC 119.7538 1.3% 1562 0.0767 1.00 0.51 UPDATE character_actions
# 19 0xC13C4066C2C95AF5 117.0228 1.3% 1562 0.0749 1.00 3.15 SELECT character_actions
# 20 0xB5F7525A5CB371E9 105.5070 1.2% 395 0.2671 0.97 1.63 INSERT character_actions
# 21 0x79136FFAD369F1BA 105.3963 1.2% 354 0.2977 0.97 1.26 INSERT character_actions
# 34 0x7B5B7941028EDE4B 54.0050 0.6% 55 0.9819 0.88 4.13 UPDATE ads
# 57 0x9E7261B3F59F331E 19.2066 0.2% 58 0.3311 0.95 0.67 INSERT character_actions
# 64 0x67A347A2812914DF 16.0391 0.2% 25 0.6416 0.88 3.22 SELECT messages_archive
# 69 0x57A18166A52BD016 14.5479 0.2% 55 0.2645 0.95 4.60 SELECT ad_extras
# 71 0xD350A58013580CAE 14.5026 0.2% 52 0.2789 0.96 0.49 INSERT character_actions
# 73 0xABCD223742501FB1 13.8047 0.2% 22 0.6275 0.89 1.54 UPDATE users
# 83 0xFBB53CDC0C3D2272 10.6655 0.1% 31 0.3440 0.94 0.94 INSERT items
# 98 0x2857E030AF6C119B 8.0144 0.1% 13 0.6165 0.88 1.84 INSERT group_characters
# 107 0x4C61C246A8EE9F3C 6.0430 0.1% 12 0.5036 0.92 0.85 INSERT character_actions
# MISC 0xMISC 2485.5319 27.9% 2590372 0.0010 NS 0.0 <1074 ITEMS>

my.cnf

[mysqlhotcopy]
interactive-timeout

[mysqld]
key_buffer=64M
thread_concurrency=8
max_connections=40
max_user_connections=40

#long_query_time=0
#log_slow_queries="/var/lib/mysql/mysql-slow.log"

read_buffer_size=2M
table_cache=750
tmp_table_size=256M

# InnoDB
# Set buffer pool size to 50-80% of your computer's memory
innodb_buffer_pool_size=640M
innodb_additional_mem_pool_size=20M
# Set the log file size to about 25% of the buffer pool size
innodb_log_file_size=128M
innodb_log_buffer_size=8M
innodb_file_per_table=1
innodb_thread_concurrency=2

wait_timeout=40
skip-external-locking
myisam_sort_buffer_size=64M
connect_timeout=10
max_allowed_packet=1M
server-id=1
thread_cache_size=8
sort_buffer_size=2M
read_rnd_buffer_size=8M
query_cache_size=56M

open_files_limit=2966
[myisamchk]
key_buffer=64M
sort_buffer_size=64M
write_buffer=2M
read_buffer=2M

[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash

Options: ReplyQuote


Subject
Views
Written By
Posted
Question on slow queries
2553
May 30, 2013 04:18AM
1009
May 31, 2013 05:14AM
993
May 31, 2013 06:09AM
988
June 01, 2013 02:45PM
1217
June 04, 2013 02:35AM
1299
June 05, 2013 11:27PM
834
June 06, 2013 02:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.