[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Проблема с Базой
netesa
Здравствуйте, забанили мою базу данных из-за превышения нагрузки.
Прислали лог и сказали Вам следует проанализировать приведенную информацию, логи веб-сервера и устранить причину нагрузки на сервер баз данных., но я в этом не соображаю помогите пожалуйста....

Лог медленных запросов к базе:

# 556.6s user time, 3.1s system time, 69.99M rss, 248.82M vsz
# Current date: Wed Mar 5 15:31:26 2014
# Hostname: mysql4.ihc.ru
# Files: /var/log/mysql-slow.log-20140304
# Overall: 9.55k total, 10 unique, 0.11 QPS, 0.00x concurrency ___________
# Time range: 2014-03-03 04:02:04 to 2014-03-04 04:01:47
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 122s 397us 2s 13ms 33ms 37ms 11ms
# Lock time 12s 22us 1s 1ms 725us 22ms 66us
# Rows sent 4.78M 0 1.84k 525.12 1.78k 513.37 719.66
# Rows examine 62.00M 1.83k 25.94k 6.65k 12.50k 3.71k 6.31k
# Rows affecte 0 0 0 0 0 0 0
# Rows read 62.00M 1.83k 25.94k 6.65k 12.50k 3.71k 6.31k
# Bytes sent 849.62M 79 174.79k 91.13k 174.27k 82.85k 165.97k
# Query size 815.02k 44 346 87.42 246.02 52.58 69.19

# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ================== ============= ===== ====== ===== ===============
# 1 0x92F3B1B361FB0E5B 79.5006 65.0% 4885 0.0163 0.10 SELECT wp_options
# 2 0xDB4A4C488625A780 28.0592 22.9% 752 0.0373 0.00 SELECT wp_term_relationships wp_posts
# 3 0xAAE0EC5B83F665CE 4.8005 3.9% 720 0.0067 0.17 SELECT wp_wpsd_trends
# 4 0xC06D9613DB8AD977 4.3256 3.5% 720 0.0060 0.00 SELECT wp_wpsd_trends
# MISC 0xMISC 5.6378 4.6% 2470 0.0023 0.0 <6 ITEMS>

# Query 1: 0.06 QPS, 0.00x concurrency, ID 0x92F3B1B361FB0E5B at byte 1193878024
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.10
# Time range: 2014-03-03 04:02:04 to 2014-03-04 04:01:47
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 51 4885
# Exec time 64 80s 9ms 2s 16ms 18ms 40ms 12ms
# Lock time 88 10s 24us 1s 2ms 761us 31ms 159us
# Rows sent 71 3.42M 734 736 735.02 719.66 0 719.66
# Rows examine 49 30.85M 6.46k 6.47k 6.47k 6.31k 0 6.31k
# Rows affecte 0 0 0 0 0 0 0 0
# Rows read 49 30.85M 6.46k 6.47k 6.47k 6.31k 0 6.31k
# Bytes sent 97 831.26M 165.70k 174.79k 174.25k 174.27k 4.03k 165.97k
# Query size 41 338.71k 71 71 71 71 0 71
# String:
# Databases p158994_db
# Hosts
# Last errno 0
# Users p158994_db
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms #
# 10ms ################################################################
# 100ms #
# 1s #
# 10s+
# Tables
# SHOW TABLE STATUS FROM `p158994_db` LIKE 'wp_options'\G
# SHOW CREATE TABLE `p158994_db`.`wp_options`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'\G

# Query 2: 0.01 QPS, 0.00x concurrency, ID 0xDB4A4C488625A780 at byte 882065697
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2014-03-03 04:04:54 to 2014-03-04 04:01:26
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 7 752
# Exec time 22 28s 30ms 91ms 37ms 51ms 8ms 34ms
# Lock time 1 127ms 50us 50ms 168us 301us 2ms 63us
# Rows sent 28 1.35M 1.83k 1.84k 1.83k 1.78k 0 1.78k
# Rows examine 14 8.78M 11.96k 11.96k 11.96k 11.96k 0 11.96k
# Rows affecte 0 0 0 0 0 0 0 0
# Rows read 14 8.78M 11.96k 11.96k 11.96k 11.96k 0 11.96k
# Bytes sent 2 17.11M 16.00k 23.35k 23.30k 22.45k 242.41 22.45k
# Query size 23 189.47k 258 258 258 258 0 258
# String:
# Databases p158994_db
# Hosts
# Last errno 0 (751/99%), 1160 (1/0%)
# Users p158994_db
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms ################################################################
# 100ms
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `p158994_db` LIKE 'wp_term_relationships'\G
# SHOW CREATE TABLE `p158994_db`.`wp_term_relationships`\G
# SHOW TABLE STATUS FROM `p158994_db` LIKE 'wp_posts'\G
# SHOW CREATE TABLE `p158994_db`.`wp_posts`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT object_id, term_taxonomy_id FROM wp_term_relationships INNER JOIN wp_posts ON object_id = ID WHERE term_taxonomy_id IN (45,1283,911,583,46,47,48,16,672,681,17,101,909,914,1,309,702,910,913,912,908) AND post_type IN ('post') AND post_status = 'publish'\G

# Query 3: 0.01 QPS, 0.00x concurrency, ID 0xAAE0EC5B83F665CE at byte 1866133520
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.17
# Time range: 2014-03-03 04:17:38 to 2014-03-04 03:17:25
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 7 720
# Exec time 3 5s 5ms 912ms 7ms 7ms 33ms 5ms
# Lock time 0 95ms 25us 56ms 131us 113us 2ms 30us
# Rows sent 0 690 0 1 0.96 0.99 0.20 0.99
# Rows examine 14 8.88M 12.60k 12.63k 12.63k 12.50k 0 12.50k
# Rows affecte 0 0 0 0 0 0 0 0
# Rows read 14 8.88M 12.60k 12.63k 12.63k 12.50k 0 12.50k
# Bytes sent 0 80.90k 109 122 115.06 112.70 1.49 112.70
# Query size 10 88.38k 125 126 125.70 124.25 0 124.25
# String:
# Databases p158994_db
# Hosts
# Last errno 0
# Users p158994_db
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms ################################################################
# 10ms #
# 100ms #
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `p158994_db` LIKE 'wp_wpsd_trends'\G
# SHOW CREATE TABLE `p158994_db`.`wp_wpsd_trends`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT wpsd_trends_stats as stats FROM wp_wpsd_trends where wpsd_trends_type = 19 and wpsd_trends_date = '2014-03-03 00:00:00'\G

# Query 4: 0.01 QPS, 0.00x concurrency, ID 0xC06D9613DB8AD977 at byte 1964872375
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2014-03-03 04:17:38 to 2014-03-04 03:17:25
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 7 720
# Exec time 3 4s 5ms 111ms 6ms 8ms 4ms 5ms
# Lock time 0 80ms 24us 12ms 111us 131us 632us 35us
# Rows sent 0 690 0 1 0.96 0.99 0.20 0.99
# Rows examine 14 8.88M 12.60k 12.63k 12.63k 12.50k 0 12.50k
# Rows affecte 0 0 0 0 0 0 0 0
# Rows read 14 8.88M 12.60k 12.63k 12.63k 12.50k 0 12.50k
# Bytes sent 0 79.16k 103 113 112.58 112.70 2.09 112.70
# Query size 10 84.16k 119 120 119.70 118.34 0.00 118.34
# String:
# Databases p158994_db
# Hosts
# Last errno 0
# Users p158994_db
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms ################################################################
# 10ms #
# 100ms #
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `p158994_db` LIKE 'wp_wpsd_trends'\G
# SHOW CREATE TABLE `p158994_db`.`wp_wpsd_trends`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT wpsd_trends_id as id FROM wp_wpsd_trends where wpsd_trends_type = 1 and wpsd_trends_date = '2014-03-03 00:00:00'\G
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.