Extrem hohe CPU

handschigl

New Member
Hallo,

die CPU meines Servers ist seit gestern extrem hoch. Ich dachte, dass es eventuell an einem Backup-Cronjob läge und habe den Server neu gestartet, aber dennoch ist die CPU immer über 500%. An den Besucherzahlen kann es nicht liegen, die sind momentan niedriger als vorher und da hatte ich eine CPU von 0%...

Wie kann ich die Ursache für die hohe CPU finden?

Und warum gibt "top" eine wesentlich niedrigere CPU aus als "cat /proc/loadavg"?

Viele Grüße
Christian
 
Okay.

cat /proc/loadavg:
Code:
5.71 4.24 4.32 2/166 5810

top:
Code:
top - 17:53:53 up  1:35,  1 user,  load average: 5.85, 4.86, 4.54
Tasks: 150 total,   1 running, 149 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 73.4%id, 26.6%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   6045832k total,  3871896k used,  2173936k free,    17956k buffers
Swap:  1060248k total,        0k used,  1060248k free,  3636240k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0 10312  844  700 S    0  0.0   0:00.72 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0
    4 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/0
    5 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1
    6 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/1
    7 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/2
    8 root      20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/2
    9 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/3
   10 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/3
   11 root      20   0     0    0    0 S    0  0.0   0:00.05 events/0
   12 root      20   0     0    0    0 S    0  0.0   0:00.01 events/1
   13 root      20   0     0    0    0 S    0  0.0   0:04.00 events/2
   14 root      20   0     0    0    0 S    0  0.0   0:00.01 events/3
   15 root      20   0     0    0    0 S    0  0.0   0:00.00 cpuset
   16 root      20   0     0    0    0 S    0  0.0   0:00.00 khelper
   19 root      20   0     0    0    0 S    0  0.0   0:00.00 netns
 
Last edited by a moderator:
Sorry, war grad blödsinn, aber das stinkt nach einer sterbenden Platte.
Die hohe Load resultiert aus dem Engpass von IO Komponenten mit hoher sicherheit die Festplatte.
-> 25% iowait und sonst hat er nichts zu tun...

Das ist mit sicherheit die Platte.

Ich würde mal mit iostat der Sache versuchen auf den Grund zu gehen.
Damit man wenigstens weiss, wohin er denn "ggf. viel" schreibt.
Ansonsten hilft nur noch hdparam diverse Stresttests auf der Platte, (auch ein kopieren von einer grossen Datei ist denkbar) um genauer zu prüfen, wo das Problem liegt.


-> Sende uns doch noch die Info, wie die Partitionen aufgebaut sind und die ausgabe von iostat -> Ist im sysstat Paket enthalten.
 
Last edited by a moderator:
Oder er startet mit smartctl einen Komplett-Test auf der Festplatte. Alternativ kann man auch vorher mit smartctl -A nachschauen, ob da schon zig Sektoren auf den Ersatzbereich umgemapped wurden.
 
Hi, Danke erst mal!

Jetzt ist die CPU plötzlich wieder runter... Sie liegt nun unter 10%... Heißt das, dass es jetzt doch nicht an der Festplatte lag?

top sagt jetzt:
Code:
top - 19:56:14 up  3:37,  1 user,  load average: 0.10, 0.12, 0.10
Tasks: 140 total,   1 running, 139 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.5%us,  0.2%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.1%hi,  0.0%si,  0.0%st
Mem:   6045832k total,  4259224k used,  1786608k free,    32612k buffers
Swap:  1060248k total,        0k used,  1060248k free,  4009088k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7076 www-data  20   0  224m  13m 5112 S    1  0.2   0:00.50 apache2
 7163 www-data  20   0  224m  13m 4720 S    1  0.2   0:00.04 apache2
 6806 www-data  20   0  228m  17m 5184 S    0  0.3   0:00.37 apache2
 7075 www-data  20   0  224m  13m 5040 S    0  0.2   0:00.51 apache2
 7101 www-data  20   0  224m  13m 5408 S    0  0.2   0:00.13 apache2
 7380 root      20   0 18956 1276  936 R    0  0.0   0:00.05 top
    1 root      20   0 10312  844  700 S    0  0.0   0:00.76 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0
    4 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/0
    5 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1
    6 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/1
    7 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/2
    8 root      20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/2
    9 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/3
   10 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/3
   11 root      20   0     0    0    0 S    0  0.0   0:00.12 events/0

iostat sagt:
Code:
Linux 2.6.33-myloc (xx.xx.fastwebserver.de)       06/17/10        _x86_64_

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.75    0.00    0.27   25.57    0.00   73.41

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              40.52      3050.51       521.14   40579977    6932616
sda1              0.00         0.12         0.00       1602          0
sda2             40.52      3050.37       521.14   40578071    6932616
sdb               0.00         0.10         0.00       1320          0

MOD: Bitte [noparse]
Code:
...
[/noparse]-Tags um Ausgaben, Code, etc. verwenden (im Editor auch mit '#' erreichbar). Danke!


smartctl kann ich nicht mittels apt-get install installieren. Was soll ich hier tun?

Was meinst du mit "Info, wie die Partitionen aufgebaut ist"?
 
Last edited by a moderator:
Gib einfach mal an, was folgende Befehle auspsucken:

mount bzw.
cat /etc/fstab

cat /proc/mdstat


Ja, installiere bitte smartctl das war ein guter Tipp vom Vorredner.

Nein, ich würde technische Proeleme mit der Platte noch nicht ausschliessen.
Vermutlich wurden irgendwelche Schreiboperationen "endlich" beendet, allerdings werden weitere Schreiboperationen bei defekter Platte gleiche oder ähnliche Sympthome aufweisen.
 
mount:
Code:
/dev/sda2 on / type ext3 (rw,usrquota,grpquota)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
none on /selinux type selinuxfs (rw,relatime)

/etc/fstab gibt es bei mir nicht auf dem Server...

cat /proc/mdstat:
Code:
Personalities :
unused devices: <none>

MOD: Bitte [noparse]
Code:
...
[/noparse]-Tags um Ausgaben, Code, etc. verwenden (im Editor auch mit '#' erreichbar). Danke!

Okay, kannst du mir bitte sagen, wie man unter Debian smartctl schnell und einfach installiert? apt-get hat es nicht in seiner package list...
 
Last edited by a moderator:
Ok, keine Raid und keine 2. Festplatte richtig?

apt-get install smartmontools

hättest Du wie folgt gefunden:

apt-cache search smartctl
 
Cool danke!

smartctl -a /dev/sda2 sagt:
Code:
=== START OF INFORMATION SECTION ===
Device Model:     WDC WD10EARS-00Y5B1
Serial Number:    WD-WMAV50877275
Firmware Version: 80.00A80
User Capacity:    1,000,204,886,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Thu Jun 17 21:22:32 2010 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                                        was suspended by an interrupting command from host.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                 (20880) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 240) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x3031) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   133   133   021    Pre-fail  Always       -       6316
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       11
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       2039
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       9
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       8
193 Load_Cycle_Count        0x0032   146   146   000    Old_age   Always       -       164047
194 Temperature_Celsius     0x0022   100   090   000    Old_age   Always       -       47
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
MOD: Bitte [noparse]
Code:
...
[/noparse]-Tags um Ausgaben, Code, etc. verwenden (im Editor auch mit '#' erreichbar). Danke!


Ich hoffe, dass sda2 das richtige war... oder brauche ich sda oder sda1?

Also RAID habe ich nicht und ob ne zweite Festplatte dabei ist, weiß ich nicht. Ich denke aber nicht...
Wenn die Festplatte kaputt wird, dann wird Webtropia diese schon austauschen und die Daten rüberspielen, hoffe ich mal... Ich brauche halt Beweise, um denen das vor dem Festplatten ausfall mitteilen zu können...
 
Last edited by a moderator:
Wenn die Festplatte kaputt wird, dann wird Webtropia diese schon austauschen und die Daten rüberspielen, hoffe ich mal... Ich brauche halt Beweise, um denen das vor dem Festplatten ausfall mitteilen zu können...

Was Du als erstes brauchst ist wohl eine Backup ....

Dass da keine Fehler geloggt sind verwundert weniger.


Bezüglich der Anwendung von smartctl -> sishe dazu die manpages.
Bedienungsanleitungen lese ich nur gegen ein angemessenes Honorar vor.
Natürlich erst, nachdem eine brauchbares Backup erstellt wurde.

So, und jetzt heisst es die Festplatte mal stressen.
Prüfen, ob die durchsatzraten si sein dürfen und können.
 
Last edited by a moderator:
So, nachdem steht sagt es jetzt:
Code:
=== START OF INFORMATION SECTION ===
Device Model:     WDC WD10EARS-00Y5B1
Serial Number:    WD-WMAV50877275
Firmware Version: 80.00A80
User Capacity:    1,000,204,886,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Jun 18 16:00:41 2010 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                                        was suspended by an interrupting command from host.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                 (20880) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 240) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x3031) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   133   133   021    Pre-fail  Always       -       6316
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       11
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       2058
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       9
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       8
193 Load_Cycle_Count        0x0032   146   146   000    Old_age   Always       -       164654
194 Temperature_Celsius     0x0022   100   090   000    Old_age   Always       -       47
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%      2056         -
# 2  Extended offline    Completed without error       00%      2045         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
 
Back
Top