I appreciate your help. I'll do my best to answer your questions, but please let me know if I'm giving you the wrong information....
Main Street James wrote:
yaz,
Do php & mysql have enough ram allocated to them?
In /etc/php5/apache2/php.ini, I have: memory_limit = 64M
In /etc/mysql/my.cnf, I have:
Code:
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 200
table_cache = 64
thread_concurrency = 8
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
I don't know if they're being constrained otherwise.
Quote:
Are there any entries in WM's slow-query-log?
Yes, it appears so. This wasn't previously enabled, so I went to my.cnf and did:
Code:
# Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
Looking at mysql-slow.log, there are lots of entries within a short amount of time, for example (the wiki database is oncdryangorg):
Code:
/usr/sbin/mysqld, Version: 5.5.31-0ubuntu0.12.04.1-log ((Ubuntu)). started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument
# Time: 140126 14:09:55
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.000446 Lock_time: 0.000161 Rows_sent: 1 Rows_examined: 6
SET timestamp=1390763395;
SELECT count(*) FROM mysql.user WHERE user='root' and password='';
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.150106 Lock_time: 0.000194 Rows_sent: 42 Rows_examined: 143
SET timestamp=1390763395;
select concat('select count(*) into @discard from `',
TABLE_SCHEMA, '`.`', TABLE_NAME, '`')
from information_schema.TABLES where ENGINE='MyISAM';
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.212197 Lock_time: 0.000478 Rows_sent: 0 Rows_examined: 1193
SET timestamp=1390763395;
select count(*) into @discard from `information_schema`.`COLUMNS`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.000960 Lock_time: 0.000791 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763395;
select count(*) into @discard from `information_schema`.`EVENTS`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.000943 Lock_time: 0.000724 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763395;
select count(*) into @discard from `information_schema`.`PARAMETERS`;
# Time: 140126 14:09:56
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.892206 Lock_time: 0.000697 Rows_sent: 0 Rows_examined: 143
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`PARTITIONS`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.001102 Lock_time: 0.000386 Rows_sent: 0 Rows_examined: 23
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`PLUGINS`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.000666 Lock_time: 0.000405 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`PROCESSLIST`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.000946 Lock_time: 0.000754 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`ROUTINES`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.006651 Lock_time: 0.000418 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`TRIGGERS`;
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 0.006799 Lock_time: 0.000411 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763396;
select count(*) into @discard from `information_schema`.`VIEWS`;
# Time: 140126 14:10:00
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000539 Lock_time: 0.000188 Rows_sent: 0 Rows_examined: 1
use onc_dryang_org;
SET timestamp=1390763400;
UPDATE /* SiteStatsUpdate::doUpdate PeterYang */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.001931 Lock_time: 0.000525 Rows_sent: 12 Rows_examined: 21
SET timestamp=1390763400;
SELECT /* ResourceLoader::preloadModuleInfo */ md_module,md_deps FROM `wiki_module_deps` WHERE md_module IN ('site',$
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000642 Lock_time: 0.000178 Rows_sent: 11 Rows_examined: 51
SET timestamp=1390763400;
SELECT /* ResourceLoader::preloadModuleInfo */ mr_resource,mr_timestamp FROM `wiki_msg_resource` WHERE mr_resource I$
# Time: 140126 14:10:04
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000321 Lock_time: 0.000152 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763404;
SELECT /* ChangeTags::listDefinedTags PeterYang */ vt_tag FROM `wiki_valid_tag`;
# Time: 140126 14:12:58
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000554 Lock_time: 0.000225 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763578;
SELECT /* Block::newLoad PeterYang */ ipb_id,ipb_address,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_anon_$
# Time: 140126 14:12:59
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000554 Lock_time: 0.000151 Rows_sent: 0 Rows_examined: 21
SET timestamp=1390763579;
SELECT /* ResourceLoader::preloadModuleInfo */ md_module,md_deps FROM `wiki_module_deps` WHERE md_module IN ('jquery$
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000759 Lock_time: 0.000155 Rows_sent: 17 Rows_examined: 51
SET timestamp=1390763579;
SELECT /* MessageBlobStore::getFromDB */ mr_blob,mr_resource,mr_timestamp FROM `wiki_msg_resource` WHERE mr_resource$
# Time: 140126 14:13:49
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000526 Lock_time: 0.000191 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763629;
SELECT /* Block::newLoad 64.237.55.3 */ ipb_id,ipb_address,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_ano$
# Time: 140126 14:15:56
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000253 Lock_time: 0.000088 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390763756;
UPDATE /* SiteStatsUpdate::doUpdate 217.69.133.67 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:17:42
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000898 Lock_time: 0.000626 Rows_sent: 0 Rows_examined: 7
SET timestamp=1390763862;
CREATE /* ViewCountUpdate::collect PeterYang */ TEMPORARY TABLE `wiki_acchits` ENGINE=HEAP AS SELECT hc_id,COUNT(*) AS $
# Time: 140126 14:17:43
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.003027 Lock_time: 0.000122 Rows_sent: 0 Rows_examined: 4
SET timestamp=1390763863;
UPDATE /* ViewCountUpdate::collect PeterYang */ `wiki_page`,`wiki_acchits` SET page_counter=page_counter + hc_n WHERE pa$
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000246 Lock_time: 0.000090 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390763863;
UPDATE /* SiteStatsUpdate::doUpdate PeterYang */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000584 Lock_time: 0.000176 Rows_sent: 11 Rows_examined: 51
SET timestamp=1390763863;
SELECT /* ResourceLoader::preloadModuleInfo */ mr_resource,mr_timestamp FROM `wiki_msg_resource` WHERE mr_resource I$
# Time: 140126 14:18:22
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000285 Lock_time: 0.000102 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390763902;
UPDATE /* SiteStatsUpdate::doUpdate 217.69.133.84 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:18:24
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000265 Lock_time: 0.000095 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390763904;
UPDATE /* SiteStatsUpdate::doUpdate 217.69.133.217 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:18:50
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000474 Lock_time: 0.000173 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390763930;
SELECT /* Block::newLoad 204.152.200.42 */ ipb_id,ipb_address,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_$
# Time: 140126 14:23:49
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000477 Lock_time: 0.000180 Rows_sent: 0 Rows_examined: 0
SET timestamp=1390764229;
SELECT /* Block::newLoad 95.211.87.85 */ ipb_id,ipb_address,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_an$
# Time: 140126 14:25:55
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.001025 Lock_time: 0.000751 Rows_sent: 0 Rows_examined: 9
SET timestamp=1390764355;
CREATE /* ViewCountUpdate::collect 217.69.133.85 */ TEMPORARY TABLE `wiki_acchits` ENGINE=HEAP AS SELECT hc_id,COUNT(*)$
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.002450 Lock_time: 0.000123 Rows_sent: 0 Rows_examined: 6
SET timestamp=1390764355;
UPDATE /* ViewCountUpdate::collect 217.69.133.85 */ `wiki_page`,`wiki_acchits` SET page_counter=page_counter + hc_n WHER$
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000260 Lock_time: 0.000106 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390764355;
UPDATE /* SiteStatsUpdate::doUpdate 217.69.133.85 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:28:01
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000247 Lock_time: 0.000084 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390764481;
UPDATE /* SiteStatsUpdate::doUpdate 209.107.208.158 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:28:42
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
# Query_time: 0.000227 Lock_time: 0.000070 Rows_sent: 0 Rows_examined: 1
SET timestamp=1390764522;
UPDATE /* SiteStatsUpdate::doUpdate 157.55.35.109 */ `wiki_site_stats` SET ss_total_views=ss_total_views+1;
# Time: 140126 14:28:43
# User@Host: oncdryangorg[oncdryangorg] @ localhost []
I don't know what to make of this, and the query time & lock times don't seem to be that long to me. I don't understand why these requests necessarily ended up in this log given the parameters in my.cnf/
Quote:
Are you seeing any irregular traffic?
Not really (based on looking at Apache's access.log and error.log). It's a site with modest traffic. Being a public wiki, there are some attempts for automated spammers to sign up and post spam, but I have a decent captcha in place, and any accounts need to be manually approved to get any editing rights, so there's minimal harm done.
I forgot to mention that I've seen a "system will be checked for errors at next reboot" message at least once, and it performed the equivalent of a chkdsk at the next reboot; not sure if bad sectors or disk issues is something I need to be worried about.