LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-03-2008, 10:34 AM   #1
Rezner
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
RedHat MySQL memory usage


Hello. I'm managing a RedHat VPS that is used for hosting a group of websites and I've been having some memory usage issues lately.

I've spoken with my hosting company and looked at some diagnostics and MySQL has a stranglehold on the system's memory. I have a total of 13 active databases (not counting the default "mysql" database), which are taking up 3% memory each. However, when I run the "top" command I see 18 instances of mysqld, each taking 3% memory.

My main question is about what exactly an instance of mysqld in the top listing entails-I thought it was one for each active database, but the are 5 more instances of mysqld than I have databases. Any idea what these are, and if so can I turn them off without losing any functionality?

Any help is greatly appreciated. Thanks.
 
Old 07-03-2008, 12:19 PM   #2
nitehawk
LQ Newbie
 
Registered: Jun 2008
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by Rezner View Post
Hello. I'm managing a RedHat VPS that is used for hosting a group of websites and I've been having some memory usage issues lately.

I've spoken with my hosting company and looked at some diagnostics and MySQL has a stranglehold on the system's memory. I have a total of 13 active databases (not counting the default "mysql" database), which are taking up 3% memory each. However, when I run the "top" command I see 18 instances of mysqld, each taking 3% memory.

My main question is about what exactly an instance of mysqld in the top listing entails-I thought it was one for each active database, but the are 5 more instances of mysqld than I have databases. Any idea what these are, and if so can I turn them off without losing any functionality?

Any help is greatly appreciated. Thanks.
I think your interpretation of the mysqld is incorrect. When mysqld starts, it does not create an instance for each database. It starts and listens for database connections, when a connection is requested mysqld forks and creates a new process to handle that connection. If you see 18 processes, then likely you have 17 active mysql connections. Some may be from users ODBC connections, others could be command line mysql connections. My system currently shows 30 mysqld processes, each with 2.7% of the system memory. Keep in mind that one single application instance could have several open odbc connections to the database, each will have it's own mysqld. One of our applications frequently has 4 simultaneous databases open at once.

-Nite
 
Old 07-03-2008, 01:00 PM   #3
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Rep: Reputation: 17
http://www.itslot.com/calculate_mysql_memory -> Calculate MySQL memory usage.

http://emergent.urbanpug.com/?p=61 -> Reduce MySQL memory Footprint.
 
Old 07-04-2008, 08:24 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Unless you are seeing degraded performance with the sites, why are you concerned about memory usage? Are the sites slow or unresponsive? I don't recall seeing anything like that in your post, only the concern that each process is using 3% of memory.
 
Old 07-04-2008, 11:56 PM   #5
Rezner
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by trickykid View Post
Unless you are seeing degraded performance with the sites, why are you concerned about memory usage? Are the sites slow or unresponsive? I don't recall seeing anything like that in your post, only the concern that each process is using 3% of memory.
Yes, degraded performance with the sites is the memory usage problem I was referring to-sorry for not being specific.

Altering the server variables as mentioned has apparently solved the problem-thanks for the help.
 
  


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 increasing memory usage over time jman623 Linux - Server 0 08-21-2007 07:44 PM
RedHat AS 3.0: Minimize memory(RAM) usage mhathi Linux - Newbie 0 11-02-2004 11:26 AM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Apache, PHP, Mysql memory usage MikeyCarter Linux - Software 0 09-24-2003 12:37 PM
RedHat 9 memory usage: is this normal? Bjornkri Linux - Newbie 2 06-03-2003 03:49 AM

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

All times are GMT -5. The time now is 11:48 AM.

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