• This forum has a zero tolerance policy regarding spam. If you register here to publish advertising, your user account will be deleted without further questions.

Hohe Prozessorauslastung obwohl keine Last

harald2k

New Member
Hallo,

ich habe folgendes Problem: Wie der Anhang zeigt sind auf dem System Prozesse die viel zu Hohe Prozessorlast ziehen, jedoch kaum Speicher verbrauchen. Das System ist ein Ubuntu 12.04 auf Proxmox und hat 8 CPU und 32GB zugewiesen bekommen. Und obwohl nichts los ist, ist das System ausgelastet und reagiert langsam. Wie kann ich diese Prozesse identifizieren, was das genau ist. Auf unserem alten Server (10.04) war dieser Phänomen nicht.

Vielen Dank für eure Hilfe

gruß
Norbert
 

Attachments

  • apache_cpu.png
    apache_cpu.png
    96.8 KB · Views: 471
Wo bitte siehst du auf dem Screenshot "idle" (=inaktiv)?
 
Naja ideln nicht umbedingt, aber ein Load von 3.x bei 8 Kernen ist auch nicht wirklich viel.
 
Natürlich langweilt sich die Kiste laut dem Screenshot - und damit nun genug der Nebensächlichkeiten und auf eine detaillierte Schilderung des TO warten, was genau nicht so tut wie gewünscht.
Meine Glaskugel sagt, dass die Webseiten auf dem Server langsam bis gar nicht reagieren (max_clients) - aber die ist auch schon stark angestaubt und hat einen Riss ;)
 
Ok, vielen Dank erstmal, ich hole nochmal etwas aus:

Das alte System hatte zwei physische Server. Ein Frontend und ein Backendserver. Der Backendserver hatte auch die Datenbank drin und cronjob liefen auch auf ihm. Das System hatte 4 Kerne und 16GB RAM, ubutunu 10.4. Speed war insgesamt ok.

Jetzt haben wir einen physischen Server mit 24 Kernen und 192 GB RAM. Auf dem laufen über Proxmox einzelne VMs mit Ubuntu 12.04 für Frontend, Backend, Datenbank, Cronjobs. Backend und Datenbank sind jeweils 8 Kerne und 32Gb zugewiesen. Problem ist das beide ausgelastet sind, obwohl nicht allzuviel drauf los ist. Der Code zum alten System hat sich nicht geändert. Es muss also eine Frage der Einstellungen sein.

Die Datenbank hat fast eine permanent Auslastung von 100%. Anfragen von Frontend und backend dauern daher. Jetzt die große Frage, warum ??

Was ist gemacht worden: my.cnf Einstellungen wurden mit mysqltuner.pl und tuning-primer.sh angepasst. Das System hatte schon mal 4 Kerne und weniger RAM - läuft dann nach dem Neustart und nach einiger Zeit ist er wieder bei 100%, gleicher Spiel jetzt bei 8 Kernen und 32GB. Habe das Gefühl auch wenn man mehr zuweist wird es nicht besser. Der Hauptunterschied ist ja, dass Datenbank und Backend jetzt auf zwei Maschinen laufen und ein neues Ubuntu drauf ist. Beide im selben Subnetz mit xxx.xxx.232.174 und xxx.xxx.232.172.

Kann es sein, dass hier die Anfragen vom Backend erst aus dem Rechnenzentrum rausgehen und dann wieder zurückkommen und das es deswegen so lange dauert ?
Genug RAM ist ja da, die Db soll sich viel nehmen um schneller zu arbeiten. Was ich nicht verstehe ist, warum es am Ende doch wieder langsamer wird.

danke und gruß
norbert
 

Attachments

  • top_db.png
    top_db.png
    67.4 KB · Views: 380
  • top_backend.png
    top_backend.png
    56.2 KB · Views: 331
  • proxmox_uebersicht.png
    proxmox_uebersicht.png
    39.8 KB · Views: 356
my.cnf und die Ausgaben von mysqltuner.pl und tuning-primer.sh bitte posten.

Für die anderen Helfer bitte die Paketfilterregeln des Hosts und die Netzwerkconfigs von Host und Guest posten.
 
my.cnf (nur die aktiven und ohne Kommentare)
====
Code:
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
local-infile = 1
read_buffer_size = 1M
key_buffer              = 512M
max_allowed_packet      = 2G
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
max_connections        = 300
table_cache            = 192
thread_concurrency     = 10
query_cache_limit       = 16M
query_cache_size        = 256M
innodb_additional_mem_pool_size = 256M
innodb_buffer_pool_size = 16G
innodb_log_buffer_size = 256M

[mysqldump]
quick
quote-names
max_allowed_packet      = 2G

[isamchk]
key_buffer              = 16M

mysqltuner
========
Code:
 >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at [url]http://mysqltuner.com/[/url]
 >>  Run with '--help' for additional options and output filtering
[OK] Logged in using credentials from debian maintenance account.
[OK] Currently running supported MySQL version 5.5.28-0ubuntu0.12.04.2
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster 
[--] Data in MyISAM tables: 487M (Tables: 110)
[--] Data in InnoDB tables: 8G (Tables: 173)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 199

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 19h 5m 46s (24M q [353.139 qps], 973K conn, TX: 382B, RX: 5B)
[--] Reads / Writes: 68% / 32%
[--] Total buffers: 17.3G global + 3.6M per thread (300 max threads)
[OK] Maximum possible memory usage: 18.3G (58% of installed RAM)
[OK] Slow queries: 0% (33K/24M)
[OK] Highest usage of available connections: 55% (165/300)
[OK] Key buffer size / total MyISAM indexes: 512.0M/520.7M
[OK] Key buffer hit rate: 99.8% (4B cached / 8M reads)
[OK] Query cache efficiency: 66.4% (6M cached / 10M selects)
[!!] Query cache prunes per day: 476758
[OK] Sorts requiring temporary tables: 9% (92K temp sorts / 933K sorts)
[!!] Joins performed without indexes: 161285
[OK] Temporary tables created on disk: 13% (186K on disk / 1M total)
[OK] Thread cache hit rate: 97% (23K created / 973K connections)
[!!] Table cache hit rate: 0% (202 open / 1M opened)
[OK] Open file limit used: 4% (66/1K)
[OK] Table locks acquired immediately: 99% (10M immediate / 10M locks)
[OK] InnoDB data size / buffer pool: 8.4G/16.0G

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    Increasing the query_cache size over 128M may reduce performance
    Adjust your join queries to always utilize indexes
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (> 256M) [see warning above]
    join_buffer_size (> 128.0K, or always use indexes with joins)
    table_cache (> 192)


 tuning-primer.sh
===========
        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.5.28-0ubuntu0.12.04.2 x86_64

Uptime = 0 days 19 hrs 13 min 0 sec
Avg. qps = 353
Total Questions = 24450384
Threads Connected = 105

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
[url]http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html[/url]
Visit [url]http://www.mysql.com/products/enterprise/advisors.html[/url]
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10.000000 sec.
You have 35127 out of 24450460 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See [url]http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html[/url]

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 2
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 105
Historic max_used_connections = 165
The number of used connections is 55% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 1.72 G
Current InnoDB data space = 8.39 G
Current InnoDB buffer pool free = 41 %
Current innodb_buffer_pool_size = 16.00 G
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 17.82 G
Configured Max Per-thread Buffers : 1.04 G
Configured Max Global Buffers : 17.25 G
Configured Max Memory Limit : 18.29 G
Physical Memory : 31.42 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 250 M
Current key_buffer_size = 512 M
Key cache miss rate is 1 : 570
Key buffer free ratio = 75 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 256 M
Current query_cache_used = 136 M
Current query_cache_limit = 16 M
Current Query cache Memory fill ratio = 53.25 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 161690 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 1500 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_open_cache = 192 tables
Current table_definition_cache = 400 tables
You have a total of 193 tables
You have 238 open tables.
Current table_cache hit rate is 0%
, while 123% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 1216536 temp tables, 13% were created on disk
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 6295 : 1
You have a high ratio of sequential access requests to SELECTs
You may benefit from raising read_buffer_size and/or improving your use of indexes.

TABLE LOCKING
Current Lock Wait ratio = 1 : 3003
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=ALWAYS'.

Ein wichtiger Punkt ist mir noch eingefallen: Am Anfang war die neue DB falsch konfiguriert, sie war als SLAVE und der alte Server war als Master drin. (ist aber keinem so richtig ausgefallen) Das ging etwas langssam und als der alte Server dann abgemeldet wurde und der SLAVE sich ständig ins nichts versucht hat zu verbinden wurde es richtig langsam. Der Fehlr wurde bemerkt, dann wurde die Config (hoffentlich) so richtig geändert, das der neue Db server nur noch Master ist. Die master.info Dateien wurden entfernt.

>Für die anderen Helfer bitte die Paketfilterregeln des Hosts und die Netzwerkconfigs von Host und Guest posten.

da muss ich passen :confused:, wo finde ich das genau ?

gruß
norbert
 
Last edited by a moderator:
Back
Top