LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   qmail server stop working when mysql utilize high CPU (https://www.linuxquestions.org/questions/linux-server-73/qmail-server-stop-working-when-mysql-utilize-high-cpu-4175424560/)

centos123 08-29-2012 05:47 AM

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.

asimba 08-30-2012 05:20 AM

try mysqltuner.pl to get started with - not to miss out apache and other logs

centos123 08-31-2012 05:30 AM

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.

asimba 08-31-2012 08:26 AM

try doing google for mysqltuner.pl

When you run this script - do you get any information like fragmented tables etc and/or any recommendations.

centos123 08-31-2012 11:15 PM

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)

asimba 09-03-2012 04:04 AM

You might want to try recommended changes to /etc/my.cnf

query_cache_size=32M
thread_cache_size=16

centos123 09-04-2012 03:54 AM

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

asimba 09-04-2012 06:55 AM

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.


All times are GMT -5. The time now is 09:33 PM.