mysql hoher cpu-load

Alle weiteren Dienste, die nicht in die drei oberen Foren gehören.
Antworten
Colttt
Beiträge: 2986
Registriert: 16.10.2008 23:25:34
Wohnort: Brandenburg
Kontaktdaten:

mysql hoher cpu-load

Beitrag von Colttt » 03.02.2020 11:57:56

Hallo,

von Zeit zu Zeit habe ich eine hohe Load auf meinem System verursacht durch mysql:

Code: Alles auswählen

top - 11:39:08 up 32 days,  1:39,  3 users,  load average: 25.37, 25.58, 23.39
Tasks: 234 total,  30 running, 204 sleeping,   0 stopped,   0 zombie
%Cpu(s): 85.5 us, 13.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  1.3 si,  0.0 st
GiB Mem :     15.7 total,      0.2 free,      5.6 used,      9.8 buff/cache
GiB Swap:      4.7 total,      4.5 free,      0.1 used.      9.7 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                                                                                                 
24964 mysql     20   0 7440092   3.7g  11496 S  64.6  23.4   1193:47 mysqld                                                                                                                                                                                                                                                  
18915 www-data  20   0  363768 131524  46504 R  11.1   0.8   0:16.97 apache2                                                                                                                                                                                                                                                 
19290 www-data  20   0  290924  54596  40308 R  11.1   0.3   0:21.94 apache2                                                                                                                                                                                                                                                 
19658 www-data  20   0  361420 126312  43492 R  11.1   0.8   0:02.01 apache2                                                                                                                                                                                                                                                 
19778 www-data  20   0  363472 128324  43636 R  11.1   0.8   0:01.44 apache2                                                                                                                                                                                                                                                 
19800 www-data  20   0  361420  85644  39992 R  11.1   0.5   0:01.09 apache2                                                                                                                                                                                                                                                 
19814 www-data  20   0  363464 125576  41556 R  11.1   0.8   0:00.48 apache2                                                                                                                                                                                                                                                 
19853 www-data  20   0  359236 120340  39772 R  11.1   0.7   0:00.38 apache2                                                                                                                                                                                                                                                 
17580 www-data  20   0  298216  65408  45748 R  10.1   0.4   1:01.51 apache2                                                                                                                                                                                                                                                 
19654 www-data  20   0  361424 127212  44352 R  10.1   0.8   0:02.16 apache2                                                                                                                                                                                                                                                 
19686 www-data  20   0  363464  73212  44720 R  10.1   0.4   0:01.93 apache2                                                                                                                                                                                                                                                 
17114 www-data  20   0  363612 130196  46008 R   9.1   0.8   0:38.22 apache2                                                                                                                                                                                                                                                 
18328 www-data  20   0  363768 130608  47056 R   9.1   0.8   0:13.49 apache2                                                                                                                                                                                                                                                 
18922 www-data  20   0  322544  73296  53744 S   9.1   0.4   0:33.80 apache2                                                                                                                                                                                                                                                 
19135 www-data  20   0  439060 119016  46952 R   9.1   0.7   0:07.47 apache2                                                                                                                                                                                                                                                 
19469 www-data  20   0  361432 129416  46528 R   9.1   0.8   0:08.67 apache2                                                                                                                                                                                                                                                 
19475 www-data  20   0  297940  65520  46264 S   9.1   0.4   0:07.07 apache2                                                                                                                                                                                                                                                 
19481 www-data  20   0  295900  63604  46152 R   9.1   0.4   0:03.57 apache2                                                                                                                                                                                                                                                 
18417 www-data  20   0  363620 128932  45624 R   8.1   0.8   0:15.39 apache2                                                                                                                                                                                                                                                 
18808 www-data  20   0  298088  64916  47296 R   8.1   0.4   0:15.46 apache2                                                                                                                                                                                                                                                 
18832 www-data  20   0  361440 128688  46176 R   8.1   0.8   0:14.08 apache2                                                                                                                                                                                                                                                 
19133 www-data  20   0  296032  64652  47140 R   8.1   0.4   0:09.25 apache2                                                                                                                                                                                                                                                 
19641 www-data  20   0  361436 124868  43988 R   8.1   0.8   0:05.38 apache2                                                                                                                                                                                                                                                 
19649 www-data  20   0  292964  55704  41384 S   8.1   0.3   0:05.81 apache2                                                                                                                                                                                                                                                 
18985 www-data  20   0  297960  64108  46568 S   7.1   0.4   0:11.07 apache2                                                                                                                                                                                                                                                 
19088 www-data  20   0  361724 127792  46608 R   7.1   0.8   0:07.51 apache2                                                                                                                                                                                                                                                 
19288 www-data  20   0  295892  62848  45512 S   7.1   0.4   0:06.10 apache2                                                                                                                                                                                                                                                 
19633 www-data  20   0  297940  65232  45812 R   7.1   0.4   0:02.37 apache2                                                                                                                                                                                                                                                 
19660 www-data  20   0  295956  63164  45768 S   7.1   0.4   0:03.32 apache2                                                                                                                                                                                                                                                 
19695 www-data  20   0  297940  62464  45008 S   7.1   0.4   0:02.59 apache2                                                                                                                                                                                                                                                 
18345 www-data  20   0  373404  69004  47912 S   6.1   0.4   0:21.21 apache2                                                                                                                                                                                                                                                 
19291 www-data  20   0  297816  62348  44940 R   6.1   0.4   0:23.03 apache2                                                                                                                                                                                                                                                 
18594 www-data  20   0  297952  62696  43264 S   5.1   0.4   0:12.72 apache2                                                                                                                                                                                                                                                 
19852 www-data  20   0  290892  51952  37812 S   5.1   0.3   0:00.11 apache2                                                                                                                                                                                                                                                 
19122 www-data  20   0  297940  63740  46240 S   4.0   0.4   0:12.76 apache2                                                                                                                                                                                                                                                 
19279 www-data  20   0  295884  61908  44556 R   4.0   0.4   0:07.15 apache2                                                                                                                                                                                                                                                 
19302 www-data  20   0  290900  54724  41444 S   4.0   0.3   0:02.85 apache2                                                                                                                                                                                                                                                 
17926 www-data  20   0  298212  66744  46948 R   3.0   0.4   0:35.11 apache2                                                                                                                                                                                                                                                 
19685 www-data  20   0  290984  55124  40788 S   3.0   0.3   0:01.24 apache2                                                                                                                                                                                                                                                 
19688 www-data  20   0  371352  63468  44592 S   3.0   0.4   0:04.79 apache2                                                                                                                                                                                                                                                 
19822 www-data  20   0  290900  51540  37472 S   3.0   0.3   0:00.12 apache2
Jedoch weiss ich leider nicht warum die Load so hoch ist, mytop zeigt mir nichts verräterisches an

Code: Alles auswählen

MySQL on localhost (10.3.18)                                                                                                                                                                                                                     up 6+03:21:06 [11:54:00]
 Queries: 301.3M   qps:  596 Slow:    3.4k         Se/In/Up/De(%):    154/01/04/00
 Sorts:     47 qps now: 2769 Slow qps: 0.0  Threads:   15 (   8/   1) 103/13/16/00
 Cache Hits: 194.3M Hits/s: 384.2 Hits now: 992.9  Ratio: 42.0%
 Ratio now: 35.0% 
 Handler: (R/W/U/D)  6756/  367/ 1181/    0        Tmp: R/W/U:   200/  200/    0
 ISAM Key Efficiency: 99.3%  Bps in/out: 111.3k/814.2k   Now in/out: 544.9k/ 2.9M

       Id     User         Host/IP        DB   Time     %    Cmd           State Query
       --     ----         -------        --   ----     -    ---           ----- ----------
  4854797     root       localhost                1   0.0  Sleep                                                                                                                                                                                                                                                           
  4874531 DB-STASI       localhost    wolke7      1   0.0  Sleep                                                                                                                                                                                                                                                           
        1 system u                                0   0.0 Daemon InnoDB purge co                                                                                                                                                                                                                                           
        2 system u                                0   0.0 Daemon InnoDB purge wo                                                                                                                                                                                                                                           
        3 system u                                0   0.0 Daemon InnoDB purge wo                                                                                                                                                                                                                                           
        4 system u                                0   0.0 Daemon InnoDB purge wo                                                                                                                                                                                                                                           
        5 system u                                0   0.0 Daemon InnoDB shutdown                                                                               q                                                                                                                                                            
  4874419     root       localhost    wolke7      0   0.0  Query            Init show full processlist                                                                                                                                                                                                                     
  4874583 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4874584 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4874590 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4874595 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4874608 DB-STASI       localhost    wolke7      0   0.0  Query Checking permis SELECT `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `permissions`, `checksum` FROM `oc_filecache` WHERE `storage` = '934' AND `path_hash` = 
  4874609 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4874610 DB-STASI       localhost    wolke7      0   0.0  Query        Rollback INSERT INTO `oc_file_locks` (`key`, `lock`, `ttl`) VALUES('files/d7xxxxxx057b301a8f1642a8341', '1', '1580730840')                                                                                                                    
  4874611 DB-STASI       localhost    wolke7      0   0.0  Sleep
  4876352 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4876353 DB-STASI       localhost    wolke7      0   0.0  Sleep                                                                                                                                                                                                                                                           
  4876354 DB-STASI       localhost    wolke7      0   0.0  Sleep
Gibt es noch andere Möglichkeiten, dass man herausfinden kann was ihn da grade so beschäftigt?
Debian-Nutzer :D

ZABBIX Certified Specialist

Benutzeravatar
whisper
Beiträge: 3184
Registriert: 23.09.2002 14:32:21
Lizenz eigener Beiträge: GNU Free Documentation License
Kontaktdaten:

Re: mysql hoher cpu-load

Beitrag von whisper » 03.02.2020 16:58:17

mytop macht ja eher momentaufnahmen.
Ich habe collectd am laufen und die GUI CGP dazu. Aber ehrlich gescgt, ist das auch keine Garantie etwas zu finden. Meißt sind es einfach nur Scripte, die per Zufall deine Webseiten nach schwachstellen scannen und apache Prozesse lostreten und beschäftigen. Je nach dahinter liegenden Systemen führt das zu Datenbank Zugriffen.
Es kann auch Peaks beim MTA sein, wenn das user auth auf DB basiert, was es ja nicht immer ist.
Was hilft, ist wenn du im Monitoring genau vergleichst, wo zur selben Zeit noch spitzen sind. ...
Dabei hilft z.B. das CGP mit canvas

Antworten