LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2005, 01:45 AM   #1
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
Question MySQL process - Sleep. What does it mean?


Hello,

If I have dozens of processes like this:

| 436 | linu_data | localhost | linu_data | Sleep | 1864 | | |

Does it (over)load the database? What is Sleep?

Thank you.

Last edited by linuxfond; 10-13-2005 at 02:27 PM.
 
Old 10-13-2005, 02:38 PM   #2
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Original Poster
Rep: Reputation: 30
Yeah.... in addition to MySQL, I found other processes that Sleep. Why is then CPU loaded to 80% if everything sleeps?
 
Old 10-13-2005, 02:58 PM   #3
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Original Poster
Rep: Reputation: 30
Hi, is there anyone?

This is ps aux:

mysql 2063 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2204 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2205 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2206 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2207 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2208 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2210 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2211 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2212 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
mysql 2213 0.0 2.0 30540 10696 ? S 20:17 0:00 /usr/sbin/mysqld
root 2230 0.0 1.6 18676 8468 ? S 20:17 0:00 httpd2 -f /etc/ht
root 2233 0.0 0.4 4044 2192 ? S 20:17 0:00 /usr/bin/perl /us
apache 2253 0.0 1.6 18752 8568 ? S 20:17 0:00 httpd2 -f /etc/ht
apache 2254 0.0 1.6 18752 8568 ? S 20:17 0:00 httpd2 -f /etc/ht
apache 2255 0.0 1.6 18752 8568 ? S 20:17 0:00 httpd2 -f /etc/ht
apache 2256 0.0 1.6 18752 8568 ? S 20:17 0:00 httpd2 -f /etc/ht
apache 2257 0.0 1.6 18752 8568 ? S 20:17 0:00 httpd2 -f /etc/ht

Is it OK to leave the Sleeping processes alone? Do they put any load on the server?
 
Old 10-13-2005, 04:23 PM   #4
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
are you talking about the "show processlist" command in MySQL?

if so, the sleep means the connection to the database is not processing but not yet freed. You should check your code to see if you are closing the connections correctly. the connections can also be there because you use pooling, so the system can reuse exist connnections.

I don't think sleeping processes will take up CPU, but if a large number of them don't eventually die, your MySQL will run out of avaliable connections.
 
Old 10-13-2005, 05:10 PM   #5
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Original Poster
Rep: Reputation: 30
Phooo.... That's an exhaustive answer! Thanks, if I understood you right, everything is clear now.
 
Old 02-14-2008, 09:40 AM   #6
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
well, im not sure i understand.

if i kill mine, more just show up. are you supposed to close the db connection in your php file for these to stop showing up? there's no setting in mysql to automatically close connections after x number of seconds?
 
Old 04-11-2009, 05:49 AM   #7
The-Bat
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
You can use "set-variable=wait_timeout=xxx(seconds)" to close the connections.

- Karthik Iyer
The-Bat
 
Old 04-11-2009, 08:04 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,371

Rep: Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381
I suggest you read this: [removed]

Last edited by Tinkster; 07-23-2012 at 04:16 PM. Reason: link gone bad ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Searching for Server (BOOTP/DHCP) <sleep> <sleep> .. .. Eileen Linux - Networking 12 10-21-2005 01:14 AM
Only one process for mysql 5.0.0? slackerboy Slackware 1 07-14-2004 07:29 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM


All times are GMT -5. The time now is 04:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration