kswapd0은 RHEL 6.3에서 CPU를 99%~100% 사용합니다.

kswapd0은 RHEL 6.3에서 CPU를 99%~100% 사용합니다.

방금 5개 시스템에 RHEL6을 설치했습니다. 시스템 구성은

CPU-i7
HDD-500GB
RAM-2GB
스왑 공간-4GB

기존 시스템과 동일한 소프트웨어와 모든 구성을 설치했습니다. 하지만 내 새 시스템이 매우 느리게 실행되고 있어요!

top명령 출력은 다음과 같습니다.

[root@localhost ~]# top

top - 12:27:56 up 24 min,  3 users,  load average: 1.00, 1.00, 0.82
Tasks: 214 total,   2 running, 212 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.1%us, 13.0%sy,  0.0%ni, 85.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

이전 시스템은 새 시스템보다 구성이 적었기 때문에 이전 시스템에서는 그런 문제가 없었습니다!

업데이트 1:

나는 Michael과 von Brand의 의견에 동의합니다. 하지만 내 시스템은 여전히 ​​매우 느립니다. 특히 QtCreator에서 무언가를 컴파일할 때 그렇습니다. 심지어 마우스 움직임도 느려졌습니다.

파티션을 교체 /etc/fstab하고 재부팅하기 전에 댓글로 확인해 보니 스왑이 0.0GB로 나오던데 kswapd0은 여전히 ​​99%~100%를 사용하고 있습니다.

다른 프로세서가 완전히 활용되지 않는 이유는 무엇입니까?

내 RAM(2GB)이 더 작습니다.

또는

시작되지 않은 CPU를 관리하는 서비스가 있습니까?

업데이트 2: 출력은 dmesg다음과 같습니다

  ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
  alloc irq_desc for 16 on node -1
  alloc kstat_irqs on node -1
alloc irq_2_iommu on node -1
ehci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
ehci_hcd 0000:00:1a.0: setting latency timer to 64
ehci_hcd 0000:00:1a.0: EHCI Host Controller
ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:1a.0: debug port 2
ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported
ehci_hcd 0000:00:1a.0: irq 16, io mem 0xf7c38000
ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.32-71.el6.x86_64 ehci_hcd
usb usb1: SerialNumber: 0000:00:1a.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
  alloc irq_desc for 23 on node -1
  alloc kstat_irqs on node -1
alloc irq_2_iommu on node -1
ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
ehci_hcd 0000:00:1d.0: setting latency timer to 64
ehci_hcd 0000:00:1d.0: EHCI Host Controller
ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
ehci_hcd 0000:00:1d.0: debug port 2
ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported
ehci_hcd 0000:00:1d.0: irq 23, io mem 0xf7c37000
ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: EHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.32-71.el6.x86_64 ehci_hcd
usb usb2: SerialNumber: 0000:00:1d.0
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
uhci_hcd: USB Universal Host Controller Interface driver
PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
rtc_cmos 00:06: RTC can wake from S4
rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
registered taskstats version 1
IMA: No TPM chip found, activating TPM-bypass!
rtc_cmos 00:06: setting system clock to 2013-03-04 14:10:29 UTC (1362406229)
Initalizing network drop monitor service
Freeing unused kernel memory: 1220k freed
Write protecting the kernel read-only data: 7176k
dracut: dracut-004-32.el6
dracut: rd_NO_LUKS: removing cryptoluks activation
dracut: rd_NO_LVM: removing LVM activation
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: [email protected]
udev: starting version 147
dracut: Starting plymouth daemon
dracut: rd_NO_DM: removing DM RAID activation
dracut: rd_NO_MD: removing MD RAID activation
ahci 0000:00:1f.2: version 3.0
ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
  alloc irq_desc for 31 on node -1
  alloc kstat_irqs on node -1
alloc irq_2_iommu on node -1
ahci 0000:00:1f.2: irq 31 for MSI/MSI-X
ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x5 impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part ems apst 
ahci 0000:00:1f.2: setting latency timer to 64
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
scsi4 : ahci
scsi5 : ahci
ata1: SATA max UDMA/133 abar m2048@0xf7c36000 port 0xf7c36100 irq 31
ata2: DUMMY
ata3: SATA max UDMA/133 abar m2048@0xf7c36000 port 0xf7c36200 irq 31
ata4: DUMMY
ata5: DUMMY
ata6: DUMMY
usb 1-1: new high speed USB device using ehci_hcd and address 2
usb 1-1: New USB device found, idVendor=8087, idProduct=0024
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 6 ports detected
ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
ata1.00: ACPI _SDD failed (AE 0x5)
ata3.00: ACPI _SDD failed (AE 0x5)
usb 2-1: new high speed USB device using ehci_hcd and address 2
usb 2-1: New USB device found, idVendor=8087, idProduct=0024
usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 2-1: configuration #1 chosen from 1 choice
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 8 ports detected
usb 2-1.3: new low speed USB device using ehci_hcd and address 3
usb 2-1.3: New USB device found, idVendor=04ca, idProduct=0062
usb 2-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 2-1.3: Product: USB Optical Mouse
usb 2-1.3: configuration #1 chosen from 1 choice
input: USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input3
generic-usb 0003:04CA:0062.0001: input,hidraw0: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:1d.0-1.3/input0
usb 2-1.4: new low speed USB device using ehci_hcd and address 4
usb 2-1.4: New USB device found, idVendor=03f0, idProduct=0024
usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1.4: Product: HP Basic USB Keyboard
usb 2-1.4: Manufacturer: CHICONY
usb 2-1.4: configuration #1 chosen from 1 choice
input: CHICONY HP Basic USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/input/input4
generic-usb 0003:03F0:0024.0002: input,hidraw1: USB HID v1.11 Keyboard [CHICONY HP Basic USB Keyboard] on usb-0000:00:1d.0-1.4/input0
ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata3.00: ACPI _SDD failed (AE 0x5)
ata3.00: ACPI: failed the second time, disabled
ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
ata3.00: ATAPI: hp      DVD-RAM GH82N, R204, max UDMA/100, ATAPI AN
ata1.00: ACPI _SDD failed (AE 0x5)
ata1.00: ACPI: failed the second time, disabled
ata1.00: ATA-8: ST500DM002-1BD142, HP73, max UDMA/100
ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/100
ata3.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access     ATA      ST500DM002-1BD14 HP73 PQ: 0 ANSI: 5
scsi 2:0:0:0: CD-ROM            hp       DVD-RAM GH82N    R204 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 0:0:0:0: [sda] 4096-byte physical blocks
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 >
sd 0:0:0:0: [sda] Attached SCSI disk
sr0: scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 2:0:0:0: Attached scsi CD-ROM sr0
EXT4-fs (sda7): INFO: recovery required on readonly filesystem
EXT4-fs (sda7): write access will be enabled during recovery
EXT4-fs (sda7): orphan cleanup on readonly fs
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 15341115
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835089
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835088
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835087
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835085
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835081
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835080
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835079
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835076
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835075
EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835067
EXT4-fs (sda7): 11 orphan inodes deleted
EXT4-fs (sda7): recovery complete
EXT4-fs (sda7): mounted filesystem with ordered data mode
dracut: Mounted root filesystem /dev/sda7
dracut: Loading SELinux policy
SELinux:  Disabled at runtime.
SELinux:  Unregistering netfilter hooks
type=1404 audit(1362406240.622:2): selinux=0 auid=4294967295 ses=4294967295
dracut: /sbin/load_policy: Can't load policy: No such file or directory
dracut: Switching root
udev: starting version 147
e1000e: Intel(R) PRO/1000 Network Driver - 1.2.7-k2
e1000e: Copyright (c) 1999 - 2009 Intel Corporation.
  alloc irq_desc for 20 on node -1
  alloc kstat_irqs on node -1
alloc irq_2_iommu on node -1
e1000e 0000:00:19.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
e1000e 0000:00:19.0: setting latency timer to 64
  alloc irq_desc for 32 on node -1
  alloc kstat_irqs on node -1
alloc irq_2_iommu on node -1
e1000e 0000:00:19.0: irq 32 for MSI/MSI-X
0000:00:19.0: eth0: (PCI Express:2.5GB/s:Width x1) 6c:3b:e5:13:26:21
0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
0000:00:19.0: eth0: MAC: 10, PHY: 11, PBA No: 0100ff-0ff
sd 0:0:0:0: Attached scsi generic sg0 type 0
sr 2:0:0:0: Attached scsi generic sg1 type 5
ACPI: WMI: Mapper loaded
EXT4-fs (sda5): mounted filesystem with ordered data mode
microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU1 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU2 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU3 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU4 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU5 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU6 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
microcode: CPU7 sig=0x306a9, pf=0x2, revision=0x12
platform microcode: firmware: requesting intel-ucode/06-3a-09
Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
Microcode Update Driver: v2.00 removed.
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
e1000e 0000:00:19.0: irq 32 for MSI/MSI-X
e1000e 0000:00:19.0: irq 32 for MSI/MSI-X
ADDRCONF(NETDEV_UP): eth0: link is not ready
e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
eth0: no IPv6 routers present
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Bridge firewalling registered
virbr0: starting userspace STP failed, starting kernel STP
nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Ebtables v2.0 registered
fuse init (API version 7.13)
ip6_tables: (C) 2000-2006 Netfilter Core Team
lo: Disabled Privacy Extensions
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
device vnet0 entered promiscuous mode
virbr0: topology change detected, propagating
virbr0: port 1(vnet0) entering forwarding state
vnet0: no IPv6 routers present
kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0x0
kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079
kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffcc3e1a
kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079
kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0x0
kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x130079
kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0xffcc3e1a
kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x530079
kvm: 3639: cpu2 unimplemented perfctr wrmsr: 0xc1 data 0x0
virbr0: port 1(vnet0) entering disabled state
device vnet0 left promiscuous mode
virbr0: port 1(vnet0) entering disabled state

swap나는 여기서 관련된 어떤 것도 발견하지 못했습니다 .

업데이트 3: 아래 내 답변을 참조하십시오 Its a kernel bug!

답변1

CPU 비율은 다음을 기준으로 합니다.하나CPU이므로 아마도 100%의 몇 배일 것입니다. 그리고 로드 평균(CPU에서 대기 중인 평균 프로세스 수)이 낮고 시스템이 거의 90% 유휴 상태입니다. 걱정할 이유가 없습니다.

답변2

좋다@본브랜드CPU 사용량 백분율은 기본적으로 단일 CPU를 기준으로 합니다. 따라서 프로세스에 다중 스레드가 있는 경우 다중 코어 또는 다중 CPU 시스템에서 이 숫자는 쉽게 100%를 초과할 수 있습니다.

Cpu(s)상단 행에 있는 총계를 보면 시스템이 사용자 공간에서 1.1%의 시간을 보내고, 시스템 코드(기본적으로 커널)에서 13.0%를 소비하며, 유휴 상태에서 85.9%의 시간을 소비한다는 것을 알 수 있습니다. . 이는 하나의 코어가 100% 속도로 실행되는 멀티 코어 CPU와 매우 일치합니다.

top을 눌러 소위 Irix 모드와 Solaris 모드 사이를 전환 할 수 있습니다 shifti. Irix 모드 사용떠나다, 표시된 CPU 사용량은 Irix 모드에 있는 동안 모든 CPU 및/또는 코어에 걸쳐 표시됩니다.존재하다, 잘 갖춰진 멀티 프로세서 시스템에서도 완전히 활용된 코어는 100%로 표시됩니다. 따라서 Irix 모드가 꺼지면 두 개의 코어가 완전히 활용되고 다른 코어는 완전히 유휴 상태인 가상의 10코어 시스템에서 CPU 사용량이 200%가 아닌 20%로 표시됩니다.

답변3

커널 오류:Goldilocks가 지적했듯이 내 문제는 핵심에 있다고 생각합니다. RAM을 4GB로 늘렸을 때 모든 프로세스가 안정적이었고 2GB RAM이 있는 Core 2 Intel 프로세서 박스에서도 잘 작동했습니다.

답변4

여기에서 아주 오래된 질문을 파헤치고 있지만 동일한 문제가 있습니다. 나에게 문제는 MYSQLD가 실행되는 것으로 끝났습니다.

먼저, ec2에서 t1-nano ubuntu 인스턴스(1 코어 512 RAM)로 전환한 후 상태 확인이 실패하기 시작했다는 사실을 발견했습니다. 당시 나는 정적 상태 확인, 301개 항목 및 기타 몇 가지 정적 파일 항목으로만 nginx를 실행하고 있었기 때문에 이것이 괜찮다고 생각했습니다. 몇 달 전에 친구들이 사용할 수 있도록 wordpress와 mysql을 설치했다는 사실을 잊어버렸습니다.

출력을 살펴본 TOP결과 kswapd0이 모든 CPU를 소비하고 있음을 발견했습니다. htopmysql이 모든 메모리를 차지하고 있다는 것을 발견한 것은 메모리를 사용하고 정렬한 후에였습니다 .

mysql을 제거했는데 모든 것이 정상입니다.

관련 정보