게시물 261건
   
[redhat6.7] cpu 코어 조절
글쓴이 : theko 날짜 : 2017-02-22 (수) 16:58 조회 : 5920
1. 임시로 core 갯수 조정(재부팅 없이 조정할 수 있으나, 재부팅 후 원래대로 돌아옴)




# CPU 확인


[root@hostname ~]# cat /sys/devices/system/cpu/online

0-23

[root@hostname ~]# cat /sys/devices/system/cpu/offline

24-31










[root@hostname ~]# cd /sys/devices/system/cpu/

[root@hostname cpu]# ls -al

합계 0

drwxr-xr-x 28 root root    0 2016-04-11 09:19 .

drwxr-xr-x 14 root root    0 2016-04-11 09:19 ..

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu0

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu1

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu10

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu11

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu12

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu13

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu14

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu15

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu16

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu17

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu18

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu19

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu2

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu20

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu21

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu22

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu23

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu3

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu4

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu5

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu6

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu7

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu8

drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu9

drwxr-xr-x  3 root root    0 2016-05-18 10:59 cpufreq

drwxr-xr-x  2 root root    0 2016-05-18 10:59 cpuidle

-r--r--r--  1 root root 4096 2016-04-12 00:00 kernel_max

-r--r--r--  1 root root 4096 2016-05-18 10:59 offline

-r--r--r--  1 root root 4096 2016-04-11 09:19 online

-r--r--r--  1 root root 4096 2016-04-12 00:00 possible

-r--r--r--  1 root root 4096 2016-04-12 00:00 present

-rw-r--r--  1 root root 4096 2016-04-11 09:20 sched_mc_power_savings

-rw-r--r--  1 root root 4096 2016-04-11 09:20 sched_smt_power_savings

[root@hostname cpu]#










[root@hostname cpu]# lscpu

Architecture:          x86_64

CPU op-mode(s):        32-bit, 64-bit

Byte Order:            Little Endian

CPU(s):                24

On-line CPU(s) list:   0-23

Thread(s) per core:    2

Core(s) per socket:    6

Socket(s):             2

NUMA node(s):          2

Vendor ID:             GenuineIntel

CPU family:            6

Model:                 44

Stepping:              2

CPU MHz:               1600.000

BogoMIPS:              6664.09

Virtualization:        VT-x

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              12288K

NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22

NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23

[root@bnpsvrdev01 cpu]#










[root@hostname cpu]# grep "processor" /proc/cpuinfo

processor       : 0

processor       : 1

processor       : 2

processor       : 3

processor       : 4

processor       : 5

processor       : 6

processor       : 7

processor       : 8

processor       : 9

processor       : 10

processor       : 11

processor       : 12

processor       : 13

processor       : 14

processor       : 15

processor       : 16

processor       : 17

processor       : 18

processor       : 19

processor       : 20

processor       : 21

processor       : 22

processor       : 23 











임시로 CPU Core 갯 수 조정


[root@hostname cpu]# echo 0 > /sys/devices/system/cpu/cpu23/online

[root@hostname cpu]# echo 0 > /sys/devices/system/cpu/cpu22/online




혹은




[root@hostname ~]# chcpu -d 23

CPU 23 disabled

[root@hostname ~]# chcpu -d 22

CPU 22 disabled




* 두 명령어 모두 /sys/devices/system/cpu/cpu23/online 이라는 ASSCI TEXT 파일의 내용을  1 에서 0 으로 변경함으로

   CPU Core 상태를 Offline 으로 변경한다. 








영구적으로 CPU Core 갯 수 조정





[root@hostname ~]# cat /etc/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /boot/, eg.

#          root (hd0,0)

#          kernel /vmlinuz-version ro root=/dev/mapper/vg_bnp-LogVol00

#          initrd /initrd-[generic-]version.img

#boot=/dev/sda

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux 6 (2.6.32-573.el6.x86_64)

        root (hd0,0)

        kernel /vmlinuz-2.6.32-573.el6.x86_64 ro root=/dev/mapper/vg_bnp-LogVol00 rd_NO_LUKS LANG=ko_KR.UTF-8 rd_NO_MD rd_LVM_LV=vg_bnp/LogVol00 crashkernel=128M  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_bnp/LogVol02 rd_NO_DM rhgb quiet maxcpus=8

        initrd /initramfs-2.6.32-573.el6.x86_64.img

[root@bnpsvrdev01 ~]#







* /etc/grub.conf 설정파일에서 kernel 부분에 maxcpus=N 구문을 삽입하여 부팅 시 변경하게끔 조정한다.

  이 방법은 최초 1회 재부팅이 필요하다. 



출처: http://woorilife.tistory.com/55 [우리들의 삶]

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com