MySQL Server verbraucht nur max. 23% CPU
Posted: 2006-09-27 13:08
Hallo,
mein MySQL Server verbraucht auch bei hohen lasten immer nur maximal 23%-25% CPU.
Die Serverausstattung:
2 x Dual Xeon mit 2,4Ghz.
4GB RAM
2 x 35GB SCSI Platten im RAID-1 mit 10.000 Umdrehungen
1 x 73Gb SCSI Platte mit 10.000 Umdrehungen
MySQL: mysql Ver 14.7 Distrib 4.1.8, for pc-linux (i686)
Distri: RedHat Enterprise 3
Das "data" Verzeichnis vom MySQL Server liegt auf der 73GB Platte.
Die MySQL-Konfiguration:
Top:
Wenn nun ein grozer Prozess läuft nimmt der MySQL Server immer nur eine 1 von 4 CPU mit 100% und schreibt dann 25% in Top rein (was eigentlich ganz logisch ist).
Ist hier von MySQL eine Grenze gesetzt, warum nicht mehr CPU in Anspruch genommen wird, da ja im Prinzip genügend Ressourcen vorhanden sind.
Die andere Sache ist, warum haben alle Prozesse von mysql immer ~875MB Speicher?
Dank im vorraus.
mein MySQL Server verbraucht auch bei hohen lasten immer nur maximal 23%-25% CPU.
Die Serverausstattung:
2 x Dual Xeon mit 2,4Ghz.
4GB RAM
2 x 35GB SCSI Platten im RAID-1 mit 10.000 Umdrehungen
1 x 73Gb SCSI Platte mit 10.000 Umdrehungen
MySQL: mysql Ver 14.7 Distrib 4.1.8, for pc-linux (i686)
Distri: RedHat Enterprise 3
Das "data" Verzeichnis vom MySQL Server liegt auf der 73GB Platte.
Die MySQL-Konfiguration:
Code: Select all
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
#
# Start
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
max_connections=256
[mysql.server]
user=mysql
basedir=/var/lib
# The MySQL server
[mysqld]
port = 3306
datadir=/disk2/mysql
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
max_connection = 256
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
#query_cache_size = 32M
query_cache_limit = 512M
query_cache_size = 512M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 4
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Code: Select all
13:21:15 up 78 days, 14:43, 1 user, load average: 0.24, 0.49, 0.97
129 processes: 127 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 7.3% 0.0% 0.4% 0.0% 0.0% 12.2% 79.8%
cpu00 10.5% 0.0% 1.0% 0.0% 0.1% 24.1% 64.1%
cpu01 0.0% 0.0% 0.0% 0.0% 0.0% 0.1% 99.8%
cpu02 18.3% 0.0% 0.5% 0.0% 0.0% 24.6% 56.5%
cpu03 0.6% 0.0% 0.1% 0.0% 0.0% 0.1% 99.0%
Mem: 3869508k av, 3808352k used, 61156k free, 0k shrd, 44068k buff
2736520k actv, 109220k in_d, 58832k in_c
Swap: 1044184k av, 219068k used, 825116k free 1761596k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
16527 mysql 17 0 880M 874M 1916 R 5.1 23.1 1:33 0 mysqld
14468 mysql 16 0 880M 874M 1916 S 1.8 23.1 2:21 2 mysqld
9028 mysql 15 0 880M 874M 1916 S 0.1 23.1 22:10 3 mysqld
12989 apache 15 0 15868 15M 6508 S 0.1 0.3 0:14 2 httpd
16516 apache 17 0 11920 11M 5500 S 0.1 0.2 0:10 0 httpd
Ist hier von MySQL eine Grenze gesetzt, warum nicht mehr CPU in Anspruch genommen wird, da ja im Prinzip genügend Ressourcen vorhanden sind.
Die andere Sache ist, warum haben alle Prozesse von mysql immer ~875MB Speicher?
Dank im vorraus.