LinuxQuestions.org
Review your favorite Linux distribution.
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 08-29-2012, 05:47 AM   #1
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
qmail server stop working when mysql utilize high CPU


iworked in a company, have own mail server , MTA qmail.When ever our employee login in morning either httpd server utilization is high or mysql utilization is high.more over mysql load is high.
i have to restart the services every time.This takes time to come down the cpu load which effect work...
why it utilize high cpu even if load is low about 5%.how to resolve this daily problem of mysql high load.

any one have any solution ,please provide me.
 
Old 08-30-2012, 05:20 AM   #2
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
try mysqltuner.pl to get started with - not to miss out apache and other logs
 
Old 08-31-2012, 05:30 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i downloaded and run this perl file ....but i dont know what it do?
i need to lowerdown cpu load when it get high i think does not do this.
 
Old 08-31-2012, 08:26 AM   #4
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
try doing google for mysqltuner.pl

When you run this script - do you get any information like fragmented tables etc and/or any recommendations.
 
Old 08-31-2012, 11:15 PM   #5
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
this is output of script

perl mysqltuner.pl

>> MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.95
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive +BDB -Federated +InnoDB -ISAM -NDBCluster
ERROR 1102 (42000) at line 1: Incorrect database name 'go3.bkup'
ERROR 1102 (42000) at line 1: Incorrect database name 'go3.bkup'
[!!] InnoDB is enabled but isn't being used
[!!] BDB is enabled but isn't being used
Argument "" isn't numeric in numeric gt (>) at mysqltuner.pl line 564, <> line
2 (#1)
(W numeric) The indicated string was fed as an argument to an operator
that expected a numeric value instead. If you're fortunate the message
will identify which operator was so unfortunate.

[OK] Total fragmented tables:

-------- Security Recommendations -------------------------------------------
[!!] User '@localhost' has no password set.
[!!] User '@localhost.localdomain' has no password set.
[!!] User 'root@127.0.0.1' has no password set.
[!!] User 'root@localhost.localdomain' has no password set.
ERROR 1102 (42000) at line 1: Incorrect database name 'go3.bkup'
Argument "" isn't numeric in numeric eq (==) at mysqltuner.pl line 623, <> line
2 (#1)

-------- Performance Metrics -------------------------------------------------
[--] Up for: 23m 26s (10 q [0.007 qps], 7 conn, TX: 7K, RX: 631)
[--] Reads / Writes: 100% / 0%
[--] Total buffers: 34.0M global + 2.7M per thread (100 max threads)
[OK] Maximum possible memory usage: 309.0M (17% of installed RAM)
[OK] Slow queries: 0% (0/10)
[OK] Highest usage of available connections: 1% (1/100)
[!!] Cannot calculate MyISAM index size - re-run script as root user
[!!] Query cache is disabled
[OK] Temporary tables created on disk: 0% (0 on disk / 2 total)
[!!] Thread cache is disabled
[OK] Table cache hit rate: 50% (6 open / 12 opened)
[OK] Open file limit used: 1% (12/1K)
[OK] Table locks acquired immediately: 100% (12 immediate / 12 locks)
[!!] Connections aborted: 14%

-------- Recommendations -----------------------------------------------------
General recommendations:
Add skip-innodb to MySQL configuration to disable InnoDB
Add skip-bdb to MySQL configuration to disable BDB
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
Set thread_cache_size to 4 as a starting value
Your applications are not closing MySQL connections properly
Variables to adjust:
query_cache_size (>= 8M)
thread_cache_size (start at 4)
 
Old 09-03-2012, 04:04 AM   #6
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
You might want to try recommended changes to /etc/my.cnf

query_cache_size=32M
thread_cache_size=16
 
Old 09-04-2012, 03:54 AM   #7
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i didnot find any thing like query in my.cnf

vi /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
Old 09-04-2012, 06:55 AM   #8
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
If its not there - you might want to add those two lines and restart daemon (and keep it under observation and see if that helps).

Often at times you might want to wait for about 24 hours to get meaningful data/tweaks.
 
  


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
[SOLVED] High CPU load, but low CPU usage (high idle CPU) baffy Linux - Newbie 5 03-13-2013 09:24 AM
[SOLVED] Bash Scripting -- Find High utilize process. Toushi Linux - Newbie 8 08-12-2012 07:47 AM
qmail smtp hang / stop working a few times everyday icechong Linux - Server 8 10-05-2011 08:04 AM
start-stop-daemon cause high cpu usage danjz Linux - Server 1 05-14-2007 02:46 PM
Qmail problems - CPU load average rising too high xbaez Linux - Software 0 11-16-2005 12:23 PM

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

All times are GMT -5. The time now is 09:23 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