Здравствуйте, жители ЛОРа!
Посоветуйте, пожалуйста, как быть в такой ситуации: есть арендованный сервер c Intel(R) Xeon(R) CPU E5620 @ 2.40GHz и 12 Gb памяти на борту, Centos 5.7 + AMP, на котором лежит некий интернет-проект с посещаемостью 1500-2000 человек в день.
Несколько дней назад на одной из страниц начались дичайшие тормоза - загрузка страницы занимает порядка 100 секунд.
Грузят ее 3 mysql-запроса:
SELECT COUNT('x') as CNT
FROM
b_sonet_log L
INNER JOIN ( SELECT MIN(ID) AS ID, TMP_ID
FROM
b_sonet_log L
WHERE
( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) OR ( L.ENTITY_TYPE IN ('G','U') AND EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) ) OR ( ( NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) ) AND ( L.ENTITY_TYPE NOT IN ('G','U') OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) ) AND ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) OR ( L.ENTITY_TYPE IN ('G','U') AND EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) ) OR ( ( NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) ) AND ( L.ENTITY_TYPE NOT IN ('G','U') OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) ) AND ( ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) OR ( ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID ) ) AND ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' ) ) ) ) ) ) ) ))
GROUP BY
TMP_ID ) L1 ON L1.ID = L.ID
LEFT JOIN b_sonet_group G ON (L.ENTITY_TYPE = 'G' AND L.ENTITY_ID = G.ID)
LEFT JOIN b_user U ON (L.ENTITY_TYPE = 'U' AND L.ENTITY_ID = U.ID)
LEFT JOIN b_user U1 ON L.USER_ID = U1.ID
LEFT JOIN b_rating_voting RG ON L.RATING_TYPE_ID = RG.ENTITY_TYPE_ID AND L.RATING_ENTITY_ID = RG.ENTITY_ID
LEFT JOIN b_rating_vote RV ON L.RATING_TYPE_ID = RV.ENTITY_TYPE_ID AND L.RATING_ENTITY_ID = RV.ENTITY_ID AND RV.USER_ID = 419
WHERE
((((L.SITE_ID = 's1' )) OR ((L.SITE_ID IS NULL) OR (length(L.SITE_ID) <= 0) OR (L.SITE_ID = '' )))) AND ((((L.LOG_DATE <= '2012-05-13 13:01:10')))) AND EXISTS ( SELECT SLR.ID
FROM
b_sonet_log_right SLR
INNER JOIN b_user_access UA ON 0=1 OR SLR.GROUP_CODE = 'SA' OR (SLR.GROUP_CODE = 'AU') OR (SLR.GROUP_CODE = 'G2') OR (UA.ACCESS_CODE = SLR.GROUP_CODE AND UA.USER_ID = 419)
WHERE
L.ID = SLR.LOG_ID)
SELECT L.ID as ID, L.TMP_ID as TMP_ID, L.ENTITY_TYPE as ENTITY_TYPE, L.ENTITY_ID as ENTITY_ID, L.USER_ID as USER_ID, L.EVENT_ID as EVENT_ID, DATE_FORMAT(L.LOG_DATE, '%d.%m.%Y %H:%i:%s') as LOG_DATE, L.LOG_UPDATE as LOG_UPDATE_X1, DATE_FORMAT(L.LOG_UPDATE, '%d.%m.%Y %H:%i:%s') as LOG_UPDATE, L.TITLE_TEMPLATE as TITLE_TEMPLATE, L.TITLE as TITLE, L.MESSAGE as MESSAGE, L.TEXT_MESSAGE as TEXT_MESSAGE, L.URL as URL, L.MODULE_ID as MODULE_ID, L.CALLBACK_FUNC as CALLBACK_FUNC, L.EXTERNAL_ID as EXTERNAL_ID, L.SITE_ID as SITE_ID, L.PARAMS as PARAMS, L.COMMENTS_COUNT as COMMENTS_COUNT, L.ENABLE_COMMENTS as ENABLE_COMMENTS, L.SOURCE_ID as SOURCE_ID, G.NAME as GROUP_NAME, G.OWNER_ID as GROUP_OWNER_ID, G.INITIATE_PERMS as GROUP_INITIATE_PERMS, G.VISIBLE as GROUP_VISIBLE, G.OPENED as GROUP_OPENED, G.IMAGE_ID as GROUP_IMAGE_ID, U.NAME as USER_NAME, U.LAST_NAME as USER_LAST_NAME, U.SECOND_NAME as USER_SECOND_NAME, U.LOGIN as USER_LOGIN, U.PERSONAL_PHOTO as USER_PERSONAL_PHOTO, U.PERSONAL_GENDER as USER_PERSONAL_GENDER, U1.NAME as CREATED_BY_NAME, U1.LAST_NAME as CREATED_BY_LAST_NAME, U1.SECOND_NAME as CREATED_BY_SECOND_NAME, U1.LOGIN as CREATED_BY_LOGIN, U1.PERSONAL_PHOTO as CREATED_BY_PERSONAL_PHOTO, U1.PERSONAL_GENDER as CREATED_BY_PERSONAL_GENDER, L.RATING_TYPE_ID as RATING_TYPE_ID, L.RATING_ENTITY_ID as RATING_ENTITY_ID, ifnull(RG.TOTAL_VALUE, 0) as RATING_TOTAL_VALUE, ifnull(RG.TOTAL_VOTES, 0) as RATING_TOTAL_VOTES, ifnull(RG.TOTAL_POSITIVE_VOTES, 0) as RATING_TOTAL_POSITIVE_VOTES, ifnull(RG.TOTAL_NEGATIVE_VOTES, 0) as RATING_TOTAL_NEGATIVE_VOTES, ifnull(RV.VALUE, 0) as RATING_USER_VOTE_VALUE
FROM
b_sonet_log L
INNER JOIN ( SELECT MIN(ID) AS ID, TMP_ID
FROM
b_sonet_log L
WHERE
( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) OR ( L.ENTITY_TYPE IN ('G','U') AND EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) ) OR ( ( NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) ) AND ( L.ENTITY_TYPE NOT IN ('G','U') OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) ) AND ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) OR ( L.ENTITY_TYPE IN ('G','U') AND EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) ) OR ( ( NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_CB = 'N' AND SLE.ENTITY_ID = L.ENTITY_ID AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) ) AND ( L.ENTITY_TYPE NOT IN ('G','U') OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_CB = 'Y' AND SLE.ENTITY_ID = L.USER_ID AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) ) AND ( ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID AND ((SLE.VISIBLE = 'Y')) ) OR ( ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID AND SLE.VISIBLE = 'I' ) OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = L.EVENT_ID ) ) AND ( EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' AND ((SLE.VISIBLE = 'Y')) ) OR EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' AND SLE.VISIBLE = 'I' ) OR NOT EXISTS( SELECT ID
FROM
b_sonet_log_events SLE
WHERE
SLE.USER_ID = 419 AND SLE.ENTITY_TYPE = L.ENTITY_TYPE AND SLE.ENTITY_ID = 0 AND SLE.ENTITY_MY = 'N' AND SLE.EVENT_ID = 'all' ) ) ) ) ) ) ) ))
GROUP BY
TMP_ID ) L1 ON L1.ID = L.ID
LEFT JOIN b_sonet_group G ON (L.ENTITY_TYPE = 'G' AND L.ENTITY_ID = G.ID)
LEFT JOIN b_user U ON (L.ENTITY_TYPE = 'U' AND L.ENTITY_ID = U.ID)
LEFT JOIN b_user U1 ON L.USER_ID = U1.ID
LEFT JOIN b_rating_voting RG ON L.RATING_TYPE_ID = RG.ENTITY_TYPE_ID AND L.RATING_ENTITY_ID = RG.ENTITY_ID
LEFT JOIN b_rating_vote RV ON L.RATING_TYPE_ID = RV.ENTITY_TYPE_ID AND L.RATING_ENTITY_ID = RV.ENTITY_ID AND RV.USER_ID = 419
WHERE
((((L.SITE_ID = 's1' )) OR ((L.SITE_ID IS NULL) OR (length(L.SITE_ID) <= 0) OR (L.SITE_ID = '' )))) AND ((((L.LOG_DATE <= '2012-05-13 13:01:10')))) AND EXISTS ( SELECT SLR.ID
FROM
b_sonet_log_right SLR
INNER JOIN b_user_access UA ON 0=1 OR SLR.GROUP_CODE = 'SA' OR (SLR.GROUP_CODE = 'AU') OR (SLR.GROUP_CODE = 'G2') OR (UA.ACCESS_CODE = SLR.GROUP_CODE AND UA.USER_ID = 419)
WHERE
L.ID = SLR.LOG_ID)
ORDER BY
LOG_UPDATE_X1 DESC
LIMIT 0, 21
SELECT LC.ID as ID, LC.LOG_ID as LOG_ID, LC.SOURCE_ID as SOURCE_ID, LC.ENTITY_TYPE as ENTITY_TYPE, LC.ENTITY_ID as ENTITY_ID, LC.USER_ID as USER_ID, LC.EVENT_ID as EVENT_ID, LC.LOG_DATE as LOG_DATE_X1, DATE_FORMAT(LC.LOG_DATE, '%d.%m.%Y %H:%i:%s') as LOG_DATE, LC.MESSAGE as MESSAGE, LC.TEXT_MESSAGE as TEXT_MESSAGE, LC.URL as URL, LC.MODULE_ID as MODULE_ID, G.NAME as GROUP_NAME, G.OWNER_ID as GROUP_OWNER_ID, G.VISIBLE as GROUP_VISIBLE, G.OPENED as GROUP_OPENED, G.IMAGE_ID as GROUP_IMAGE_ID, U.NAME as USER_NAME, U.LAST_NAME as USER_LAST_NAME, U.SECOND_NAME as USER_SECOND_NAME, U.LOGIN as USER_LOGIN, U.PERSONAL_PHOTO as USER_PERSONAL_PHOTO, U.PERSONAL_GENDER as USER_PERSONAL_GENDER, U1.NAME as CREATED_BY_NAME, U1.LAST_NAME as CREATED_BY_LAST_NAME, U1.SECOND_NAME as CREATED_BY_SECOND_NAME, U1.LOGIN as CREATED_BY_LOGIN, U1.PERSONAL_PHOTO as CREATED_BY_PERSONAL_PHOTO, U1.PERSONAL_GENDER as CREATED_BY_PERSONAL_GENDER, L.SITE_ID as LOG_SITE_ID, LC.RATING_TYPE_ID as RATING_TYPE_ID, LC.RATING_ENTITY_ID as RATING_ENTITY_ID, ifnull(RG.TOTAL_VALUE, 0) as RATING_TOTAL_VALUE, ifnull(RG.TOTAL_VOTES, 0) as RATING_TOTAL_VOTES, ifnull(RG.TOTAL_POSITIVE_VOTES, 0) as RATING_TOTAL_POSITIVE_VOTES, ifnull(RG.TOTAL_NEGATIVE_VOTES, 0) as RATING_TOTAL_NEGATIVE_VOTES, ifnull(RV.VALUE, 0) as RATING_USER_VOTE_VALUE
FROM
b_sonet_log_comment LC
LEFT JOIN b_sonet_log L ON (LC.LOG_ID = L.TMP_ID)
LEFT JOIN b_sonet_group G ON (LC.ENTITY_TYPE = 'G' AND LC.ENTITY_ID = G.ID)
LEFT JOIN b_user U ON (LC.ENTITY_TYPE = 'U' AND LC.ENTITY_ID = U.ID)
LEFT JOIN b_user U1 ON LC.USER_ID = U1.ID
LEFT JOIN b_rating_voting RG ON LC.RATING_TYPE_ID = RG.ENTITY_TYPE_ID AND LC.RATING_ENTITY_ID = RG.ENTITY_ID
LEFT JOIN b_rating_vote RV ON LC.RATING_TYPE_ID = RV.ENTITY_TYPE_ID AND LC.RATING_ENTITY_ID = RV.ENTITY_ID AND RV.USER_ID = 419
WHERE
((((L.SITE_ID = 's1' )) OR ((L.SITE_ID IS NULL) OR (length(L.SITE_ID) <= 0) OR (L.SITE_ID = '' )))) AND ((((LC.LOG_DATE <= '2012-05-13 13:02:22')))) AND EXISTS ( SELECT SLR.ID
FROM
b_sonet_log_right SLR
INNER JOIN b_user_access UA ON 0=1 OR SLR.GROUP_CODE = 'SA' OR (SLR.GROUP_CODE = 'AU') OR (SLR.GROUP_CODE = 'G2') OR (UA.ACCESS_CODE = SLR.GROUP_CODE AND UA.USER_ID = 419)
WHERE
LC.LOG_ID = SLR.LOG_ID)
ORDER BY
LOG_DATE_X1 ASC
Если пользователь на сайте не авторизован - эти запросы выполняются за несколько секунд. Если авторизован - в момент обращения к этой странице mysql сжирает одно ядро на 100%.
Конфиг mysql:
[client]
port = 3306
socket = /var/lib/mysqld/mysqld.sock
default-character-set=utf8
[mysqld_safe]
socket = /var/lib/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
max_connections = 500
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/lib/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
query_cache_size = 256M
table_cache = 5120
thread_cache_size = 32
max_heap_table_size = 256M
tmp_table_size = 512M
innodb_buffer_pool_size = 2G
innodb_additional_mem_pool_size = 16M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
transaction-isolation = READ-COMMITTED
default-storage-engine = innodb
#bind-address = 127.0.0.1
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
myisam-recover = BACKUP
expire_logs_days = 10
max_binlog_size = 100M
join_buffer_size = 8M
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_unicode_ci
init-connect = "SET NAMES utf8"
skip-character-set-client-handshake
open_files_limit = 15360
table_open_cache = 2048
binlog_cache_size = 64M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
default-character-set = utf8
[mysql]
[isamchk]
key_buffer = 16M
Прошу помощи в выяснении причины таких тормозов. Проверка/восстановление базы показывают, что все ОК.