LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-28-2009, 12:04 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
mysql Copying to tmp table constantly, crashing server


In my mysql processlist i have a bunch of:
Copying to tmp
queries going.

In the /tmp directory, I have the following mysql files:
-rw-rw---- 1 mysql mysql 1.2G Oct 28 11:59 #sql_51aa_0.MYD
-rw-rw---- 1 mysql mysql 1.0K Oct 28 11:58 #sql_51aa_0.MYI
-rw-rw---- 1 mysql mysql 1.2G Oct 28 11:59 #sql_51aa_1.MYD
-rw-rw---- 1 mysql mysql 1.0K Oct 28 11:58 #sql_51aa_1.MYI
-rw-rw---- 1 mysql mysql 1.1G Oct 28 12:00 #sql_51aa_2.MYD
-rw-rw---- 1 mysql mysql 1.0K Oct 28 11:59 #sql_51aa_2.MYI

This is driving the load of my server above 10, I stop mysql and apache, and the copying to tmp just starts right back up again.

My /tmp is only 4GB, and as you can see, there are 3.3GB taken up right now by mysql, it seems when a query finishes the file in /tmp goes away, but then 2 seconds later, process list is showing Copying to tmp again, and there is a huge file in /tmp.

What exactly causes mysql to "Copying to tmp"?

Anyone know a fix for this?

TIA
 
Old 10-28-2009, 02:54 PM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Copying to tmp table

I work for a hosting company. We have a free project where this is a frequent issue. Users just simply forget to add indexes to their tables (or don't even know, they need to). You should inspect the running queries using SHOW PROCESSLIST; or SHOW FULL PROCESSLIST;. In normal operation, queries shouldn't take more than 1-2 seconds to finish even during rush hours.

There might be other reasons, though.

Last edited by janoszen; 10-28-2009 at 03:10 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL: Table always crashing (error 134) Swakoo Linux - General 10 10-17-2008 01:16 PM
Debian Server Constantly Crashing SonicEarth Linux - Server 1 09-15-2008 05:08 PM
Debian Server Constantly Crashing SonicEarth Linux - Newbie 2 09-15-2008 03:32 PM
server (Fedora core 3) crashing after copying data... zepplin611 Linux - Hardware 1 01-21-2005 10:32 PM
Table copying in MySQL prabhatsoni General 4 10-26-2004 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration