Server just hanging (Copying to tmp table)
I did searches on the forum and I cannot find the answers I need. I also searched through the mailing lists.
This doesn't sound like a problem that should be that unique so I'm guessing y'all will know the answers.
I'm running the server on Mac OS X Server version 4.0.25-Standard I installed the standard pre-compiled version.
The server is a dual G5 with 4GB of RAM.
Every few hours my server will get stuck with select queries, these queries have been optimized to the hilt. It is different types of queries that end up making it hang. i can give specifics if you need. Essentially one of about three queries end up making the server sit and hang "Copying to tmp table". After restarting the server or killing the offending queries I can run them manually and get outputs in less than 0.20 seconds. I don't know what is causing the problem.
I turned on query caching thinking it may help, it did speed up my sites but it hasn't helped the problem. I also tweaked the other settings knowing that I have a ton of RAM at my disposal with no hint of hitting the limit. But nothing has really helped. Here is my my.cnf file:
[mysqld]
datadir=/path/to/data/mysql
;socket=/tmp/mysql.sock
set-variable = max_connections=1000
set-variable = tmp_table_size=500M
set-variable = query_cache_size=250M
set-variable = query_cache_limit=50M
set-variable = key_buffer_size=100M
set-variable = table_cache=5M
set-variable = sort_buffer_size=16M
set-variable = read_buffer_size=5M
I notice my wait_timeout is set to 28800 perhaps I should shorten things up.
I can't figure out where the temp files are saved if I'm actually hitting that. The thing is, my RAM usage is never very high so I can't imagine that I'm hitting the tmp_table_size limit. So, the "Copying to tmp table" seems to be a false error or, worse, something wrong with my RAM.
Does anyone have any suggestions at all?
One query that has been locking up the server lately is this one from PHPBB:
explain SELECT phpbb_topics.topic_title, phpbb_topics.topic_replies, phpbb_topics.topic_views, phpbb_topics.topic_id, phpbb_users.username, phpbb_users.user_realname, phpbb_posts.post_id, phpbb_posts.poster_id, phpbb_posts.post_time FROM ((phpbb_topics INNER JOIN phpbb_posts ON phpbb_topics.topic_last_post_id = phpbb_posts.post_id) INNER JOIN phpbb_users ON phpbb_users.user_id = phpbb_posts.poster_id) INNER JOIN phpbb_forums ON phpbb_forums.forum_id = phpbb_topics.forum_id WHERE (phpbb_forums.auth_view <= 0 ) AND (phpbb_forums.auth_read <= 0 ) AND phpbb_forums.forum_id NOT IN (5, 6, 2, 11) AND phpbb_topics.topic_status <> 2 ORDER BY post_time DESC LIMIT 5;
The output is:
table type possible_keys key key_len ref rows Extra
phpbb_forums ALL PRIMARY NULL NULL NULL 11 Using where; Using temporary; Using filesort
phpbb_topics ref forum_id,topic_last_post_id forum_id 2 phpbb_forums.forum_id 2041 Using where
phpbb_posts eq_ref PRIMARY,poster_id,p_id PRIMARY 3 phpbb_topics.topic_last_post_id 1
phpbb_users eq_ref PRIMARY PRIMARY 3 phpbb_posts.poster_id 1
I don't see why this one would end up locking up the server. Essentially what happens is more people are waiting for connections and the system quickly hits the max connections limit.
Subject
Views
Written By
Posted
Server just hanging (Copying to tmp table)
27565
August 11, 2005 11:25AM
23650
August 12, 2005 09:07AM
18949
August 12, 2005 01:06PM
18425
August 22, 2005 09:46AM
16526
August 24, 2005 03:27PM
12979
August 24, 2005 04:05PM
13668
August 26, 2005 11:02AM
7445
August 26, 2005 11:05AM
6832
August 26, 2005 11:45AM
6610
August 26, 2005 05:46PM
6874
August 26, 2005 10:34PM
6485
August 25, 2005 01:08PM
5878
August 26, 2005 11:07AM
5682
August 27, 2005 09:09AM
6005
August 29, 2005 11:50AM
5923
August 29, 2005 12:04PM
5285
August 29, 2005 12:55PM
5171
August 29, 2005 05:26PM
5143
August 29, 2005 06:34PM
4779
August 29, 2005 08:40PM
4657
August 29, 2005 08:47PM
4523
August 29, 2005 09:00PM
4718
August 30, 2005 10:05AM
4599
August 30, 2005 10:18AM
5114
August 30, 2005 10:20AM
6120
August 29, 2005 08:53PM
4989
August 29, 2005 09:50PM
4826
August 29, 2005 10:01PM
5272
August 30, 2005 08:53AM
4683
August 30, 2005 11:22AM
5222
August 30, 2005 11:33AM
4890
August 30, 2005 11:59AM
24351
August 31, 2005 02:32PM
6522
August 31, 2005 02:49PM
5206
August 31, 2005 02:56PM
5060
August 31, 2005 03:06PM
8299
December 07, 2006 10:30AM
5000
August 31, 2005 03:10PM
4871
August 31, 2005 03:32PM
17712
August 31, 2005 07:15PM
5117
September 01, 2005 03:05AM
7832
September 15, 2005 04:31PM
5557
September 01, 2005 04:39AM
4458
September 08, 2005 09:53AM
4819
September 08, 2005 11:25AM
4595
September 26, 2005 11:52AM
4505
September 26, 2005 12:13PM
4436
September 27, 2005 09:55AM
4221
September 27, 2005 10:18AM
4122
September 28, 2005 10:29AM
4259
September 28, 2005 10:34AM
4438
September 28, 2005 10:52AM
4897
September 28, 2005 10:58AM
9675
September 23, 2005 01:56AM
4959
September 23, 2005 07:11AM
4936
October 05, 2005 04:58AM
5201
October 05, 2005 04:52PM
6144
October 05, 2005 11:49PM
5398
October 06, 2005 01:34AM
6719
October 06, 2005 04:57PM
4650
December 13, 2005 10:28AM
4635
December 13, 2005 10:34AM
4549
November 17, 2005 09:39AM
4904
January 08, 2007 12:12PM
4777
December 12, 2005 02:13PM
4619
December 14, 2005 11:43PM
4212
December 15, 2005 08:37AM
4285
December 15, 2005 11:18AM
4203
December 15, 2005 11:27AM
4320
December 15, 2005 11:32AM
4069
December 15, 2005 11:43AM
4033
December 15, 2005 11:43AM
4204
December 15, 2005 11:48AM
4090
December 15, 2005 11:51AM
4483
December 15, 2005 02:14PM
4136
December 15, 2005 02:18PM
4007
December 15, 2005 02:27PM
4509
December 15, 2005 02:43PM
4052
December 15, 2005 08:46AM
5041
January 26, 2006 12:38PM
4168
January 26, 2006 01:48PM
4243
January 26, 2006 01:48PM
4029
January 26, 2006 01:52PM
4172
January 27, 2006 04:46PM
4052
January 29, 2006 11:21AM
4386
January 30, 2006 09:42AM
4424
February 27, 2006 02:17PM
4104
February 27, 2006 02:23PM
4337
March 05, 2006 04:56AM
4154
March 06, 2006 08:09AM
4124
April 05, 2006 01:03PM
4301
September 27, 2006 08:43AM
4258
November 19, 2006 04:42AM
4409
December 14, 2006 05:45PM
4229
February 01, 2007 04:40AM
4894
November 11, 2007 01:24PM
5109
December 20, 2007 10:40AM
6542
January 21, 2008 10:14AM
5879
January 21, 2008 10:53AM
5344
May 19, 2008 09:41AM
5551
February 05, 2008 10:27AM
6097
March 12, 2008 08:37AM
5415
May 19, 2008 03:02AM
6151
November 14, 2008 12:31AM
7161
March 06, 2009 03:36PM