IBM Power Systems Power Linux HOWTO IBM STG
IBM Power Systems Power. Linux HOWTO IBM STG Power Boo. Seon Yu Seung. Gyu Lee © 2013 IBM Corporation
IBM Power Systems Index 1. Install § § 설치 전 구성 및 준비사항 Power Linux Install 2. Setup § § § Network setup Etherchannel 구성 (bonding) YUM 구성 Compiler 설치 IBM Installation Toolkit 3. Others § § § IBM Simplified Setup Tool Disk 추가 및 LVM mirroring 설정 DLPAR 구성 4. Power Linux Tuning § § § 2 Power Saver Mode SMT Disable Stop Unnecessary Services Complier Option sysctl Tuning © 2013 IBM Corporation
IBM Power Systems Power. Linux HOWTO 1. Install © 2013 IBM Corporation
IBM Power Systems 1. Install – 설치 전 구성 및 준비사항 § 7 R 2의 SAS RAID adapter – Linux의 LVM mirror는 AIX LVM mirror와는 달리 완전한 OS disk의 보호에는 부족하므로, SAS RAID adpater에 의한 HW mirroring을 구현하는 것이 보통입니다. – 여기서는 아래와 같은 feature code “EJ 0 F”를 사용했습니다. • EJ 0 F Storage Backplane -- 6 SFF Drives/SATA DVD/RAID/External SAS Port 4 © 2013 IBM Corporation
IBM Power Systems 1. Install – 설치 전 구성 및 준비사항 § SAS RAID 구성 - 개요 – OS를 설치하기 전에, 내장형 SAS RAID adapter에 연결된 내장 disk들을 RAID 10으로 format 해야 합니다. – 이를 위해서는, 먼저 장비에 함께 딸려오는 “Standalone Diagnostic CD”를 이용하여 booting해야 합 니다. – 이 “Standalone Diagnostic CD”로 booting을 하게 되면, AIX에서 “diag” 명령을 수행한 것과 동일한 메뉴가 나오며, 여기서 다음과 같은 순서로 RAID 구성 메뉴를 찾아 들어가면 됩니다. • Task Selection • Array RAID Manager • IBM SAS Disk Array Manager • Create an Array Candidate pdisk and Format to 528 byte Sectors • Create a SAS Disk Array 5 © 2013 IBM Corporation
IBM Power Systems 1. Install – 설치 전 구성 및 준비사항 § SMS mode Booting – “Standalone Diagnostic CD”를 넣고 booting합니다. – 만약 이미 disk로 booting하도록 설정이 되어 있다면, CD로 booting하기 위해서 HMC를 통해 SMS 메뉴로 boot mode를 바꾸거나, console에서 booting시 5개의 text icon이 뜰 때 1번 키를 눌 러 SMS 메뉴로 들어가야 합니다. 6 © 2013 IBM Corporation
IBM Power Systems 1. Install – 설치 전 구성 및 준비사항 § Boot Device 선택 (SMS) § 다음과 같은 순서로 boot device 설정 메뉴를 찾아 들어 가서, SATA CD-ROM을 boot device로 지정합니다. – 5. Select Boot Options – 1. Select Install/Boot Device – 3. CD/DVD – 5. SATA – 1. SATA CD-ROM – 2. Normal Mode Boot – 1. Yes § SMS에서 빠져 나오면 CDROM에 든 media로부터 booting을 하게 됩니다. 7 © 2013 IBM Corporation
IBM Power Systems 1. Install – 설치 전 구성 및 준비사항 § Candidate disk 선택 과정 – RAID disk 구성을 위해서는, 먼저 512 -byte로 format된 일반 hdisk를 528 -byte로 format하여 Candidate disk, 즉 pdisk로 먼저 만들어야 합니다. – 여기서는 PCIe x 4 Insternal 3 Gb SAS RAID Adapter에 내장 disk들이 연결되어 있습니다. 10 © 2013 IBM Corporation
IBM Power Systems 1. Install – Power Linux Install § “Welcome to Red Hat Enterprise Linux” 창이 나오면 OK에 커서를 두고 엔터키를 입력합니 다. § 그 후에 생성되는 Language 설정에서 English를 선택 합니다. § Disk가 비어있지 않다는 경고메시지가 출력되면, reinitialize all을 선택합니다. § Location and time zone 메뉴에서 Asia/Seoul 을 선택합니다. § 설치가 완료되고 나면 reboot을 합니다. 17 © 2013 IBM Corporation
IBM Power Systems Power. Linux HOWTO 2. Setup © 2013 IBM Corporation
IBM Power Systems 2. Setup – Network Setup § Linux에서 네트워크를 설정하기 위해서는 네트워크 포트의 script를 편집하여 작성합니다. § /etc/sysconfig/network-script에서 해당 네트워크 포트의 script를 편집합니다. # cd /etc/sysconfig/network-scripts # vi ifcfg-eth 0 – BOOTPROTO=“dhcp” 고정 ip 사용시 static으로 변경 – HWADDR=…. – IPADDR=xxx. xxx �입력한 ip확인 – NETMASK=255. xxx – GATEWAY=xxx. xxx – TYPE=“Ethernet” – ONBOOT=“yes” yes로 바꿔야 booting시 자동으로 network port를 올립니다. § # service network restart �확인 후 network 재시작 19 © 2013 IBM Corporation
IBM Power Systems 2. Setup - Ether. Channel 구성 (Bonding) § Linux에서 etherchannel 구성 – Linux에서 etherchannel(bonding)을 구성하기 위해서는 network-scripts에서 bond interface script file을 작성해서 구성합니다. – Bond option은 아래와 같습니다. [Bonding mode option] 0: balance-round robin ( 2개의 NIC를 통한 분배 + Fault Tolerance) 1 : active-standby (Active 상태의 NIC에 문제 발생시 Fault Tolerance) 2 : balance-xor (xor 연산을 통해서 통신 + Fault Tolerance) 3 : broadcast (2개의 NIC에 어떤 규칙없이 데이터 통신 + Fault Tolerance) 20 © 2013 IBM Corporation
IBM Power Systems 2. Setup - Ether Channel 구성 (Bonding) § Linux에서 ether channel 구성 – 먼저 bond 0 파일을 /etd/modprobe. d 에 생성하여 아래와 같이 script를 작성합니다. # vi /etc/modprobe. d/bond 0 alias bond 0 bonding – /etc/sysconfig/network-scripts 아래 Bond interface file 생성하여 아래와 같이 script를 작성합니다. # vi /etc/sysconfig/network-scripts/ifcfg-bond 0 DEVICE=bond 0 IPADDR=xxx. xxx NETMASK=255. xxx USERCTL=no BOOTPROTO=none ONBOOT=yes 21 © 2013 IBM Corporation
IBM Power Systems 2. Setup - Ether Channel 구성 (Bonding) – Bonding 할 network port의 network scripts 수정합니다. 저는 eth 0와 eth 1로 설정하였 습니다. # vi /etc/sysconfig/network-scripts/ifcfg-eth 0 DEVICE=eth 0 BOOTPROTO=none ONBOOT=yes MASTER=bond 0 SLAVE=yes USERCTL=no *eth 1역시 device name, UUID, HWADDR을 제외하고 위와 같이 수정 d. Network 재시작 및 확인 # service network restart # cat /proc/net/bonding/bond 0 *네트워크가 끊어지니 HMC 상에서 terminal로 작업하시는 것을 권합니다. 22 © 2013 IBM Corporation
IBM Power Systems 2. Setup – YUM Local Repository Setup § YUM – Redhat Enterprise Linux에서 RPM 기반의 시스템을 인스톨/업데이트/제거의 편의성을 위해서 yum 이라는 tool을 사용합니다. 설치한 Redhat Linux에서 함께 설치되어 있으며, repository를 기반으로 RPM package에 접근하기 때문에 운영의 편의를 위해 RHEL CD안에서 repository를 추출하여 설정 해줍니다. § RHEL RPM Package 추출 – Install CD에서 RPM fileset들을 추출합니다. 먼저 OS install CD를 CD-ROM에 삽입합니다. # mount –t iso 9660 /dev/sr 0 /media/dvd media/dvd에 install cd를 mount 합니다. # df –k 로 mount 확인 # mkdir /home/YUM repository에서 쓰일 RPM file들을 보관할 디렉터리를 생성합니다. # cd /media/dvd/Packages # cp –r. /home/YUM 23 install CD안의 Packages 디렉터리 파일들을 추출합니다. © 2013 IBM Corporation
IBM Power Systems 2. Setup – YUM Local Repository Setup § Repository 생성 fileset 설치 – Repository를 생성하는 createrepo fileset을 설치하기 위해 아래 세 rpm file을 설치합니다. # cd /media/dvd/Packages # ls deltarpm*. rpm python-deltarpm*. rpm createrepo*. rpm # rpm –Uvh deltarpm*. rpm python-deltarpm*. rpm createrepo*. rpm 24 © 2013 IBM Corporation
IBM Power Systems 2. Setup – YUM Local Repository Setup § Repository data 생성 # cd /home/YUM # createrepo /home/YUM 에 repository data들을 생성합니다. # ls /home/YUM/repodata 생성된 데이터 들을 확인합니다. § Repository 등록 # vi /etc/yum. repos. d/rhel 64 -ppc. repository 파일 이름으로 rhel 64 -ppc. repo로 하였습니다. [rhel 64 -ppc. repo] name=Red Hat Enterprise Linux 6. 4 for PPC ( 무엇으로 하든 상관없습니다. ) failovermethod=priority baseurl=file: ///home/YUM enabled=1 metadata_expire=0 d gpgcheck=0 25 © 2013 IBM Corporation
IBM Power Systems 2. Setup – YUM Local Repository Setup § YUM test 26 – 설정을 마치고 테스트를 합니다. # yum search telnet 찾고자 하는 fileset과 관련 된 파일을 검색합니다. # yum install telnet. ppc 64 해당 fileset을 설치합니다. © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Advanced Toolcahin (컴파일러) § IBM Advance Toolchain for Power. Linux – Power. Linux 에서 보다 나은 성능을 위해서 IBM Advance Toolchain 이라는 컴파일러를 제공합니다. – Advance Toolchain 6. 0에서 제공되는 gcc 버전은 4. 7. 3 입니다. (RHEL에 포함된 gcc는 4. 4 입니다. ) – 하기 링크(IBM Developer. Works site)에서 다운받으실 수 있습니다. https: //www. ibm. com/developerworks/mydeveloperworks/wikis/home? lang=en#/wiki/W 51 a 7 ffcf 4 dfd_4 b 40_9 d 82_446 ebc 23 c 550/page/IBM%20 Advance%2 0 Toolchain%20 for%20 Power. Linux%20 Documentation 27 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Advanced Toolcahin (컴파일러) § IBM Advance Toolchain for Power. Linux – Downloads 페이지에서 Linux 버전에 맞는 tab을 선택합니다. – 많은 file list 중에서 아래 네 가지 파일을 download합니다. (2013년 5월 13일 기준 6. 0. 4 버전 release) advance-toolchain-at 6. 0 -runtime. ppc 64. rpm advance-toolchain-at 6. 0 -devel. ppc 64. rpm advance-toolchain-at 6. 0 -mcore-libs. ppc 64. rpm advance-toolchain-at 6. 0 -perf. ppc 64. rpm – SCP를 이용해서 관련파일들을 linux 파티션으로 이동하거나 usb, cd 등을 이용해서 linux 파티션에 복사를 합니다. 28 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Advanced Toolcahin (컴파일러) § IBM Advance Toolchain for Power. Linux – YUM을 이용해 bzip 2 관련 파일들을 설치합니다. ( Advance Toolchain 설치 시 필요) # yum search bzip # yum install bzip 2 -devel. ppc 64 bzip 2 -libs. ppc 64 bzip 2. ppc 64 29 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Advanced Toolcahin (컴파일러) § IBM Advance Toolchain for Power. Linux – 일반 RPM 파일을 설치 하듯 다운받은 네 가지 파일을 설치합니다. 상호 파일간에 의존성이 있으므 로 한번에 네 가지 파일을 설치합니다. # rpm -Uvh advance-toolchain*. ppc 64. rpm – 설치한 Advance Toolchain의 gcc compiler 위치는 /opt/at 6. 0/bin/gcc 입니다. 기존 gcc 4. 4 버전을 이동시키고, 새로 설치한 compiler로 링크를 설정합니다. # mv /usr/bin/gcc. 4. 4 # ln –s /opt/at 6. 0/bin/gcc /usr/bin/gcc 30 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Advanced Toolcahin (컴파일러) § Compile 방법 – IBM Advance Toolchain 6. 0 (이하 AT 6. 0)은 gcc 4. 7. 3 이 포함되어 있습니다. – AT 6. 0은 자체 library와 연계하여 추가적으로 사용할 수 있는 option들이 있습니다. – AIX와 다르게 Default option으로는 64 bit로 compile 되며, 32 bit로 compile하기 위해서는 –m 32라 는 option을 주어야 합니다. – Low latency를 구현 하기 위해서는 아래와 같은 option으로 complie하는 것을 권장합니다. # gcc –O 3 –flto –mcpu=power 7 –mtune=power 7 -ltcmalloc 31 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Installation Toolkit § IBM Installation Toolkit은 Power Linux에 필요한 파일셋 들의 repository를 제공합니다. – 아래 url에 접속하여 하단의 package를 클릭하여 iso 이미지를 다운로드 합니다. http: //www-304. ibm. com/webapp/set 2/sas/f/lopdiags/installtools/download/home. html – IBM id 가 필요하며, 로그인 후 간단한 설문조사와 약 관 동의를 체크 하시면 다운로드 페이지로 넘어가게 됩니다. § Image를 scp를 이용해 server로 옮깁니다. * PC에는 winscp라는 툴을 사용합니다. * Server에서는 # yum install openssh-clients. ppc 64 을 이용해 scp client를 설치 합니다. § iso이미지를 mount 합니다. # mkdir /media/IBM_Toolkit # mount -o loop /root/IBM_Installation_Toolkit_54. iso /media/IBM_Toolkit/ 32 © 2013 IBM Corporation
IBM Power Systems 2. Setup – IBM Installation Toolkit 34 © 2013 IBM Corporation
IBM Power Systems Power. Linux HOWTO 3. Others © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § IBM Power Linux에서 제공하는 IBM Installation Toolkit은 Open source workload 의 설정 을 web기반 GUI를 이용하여 쉽게 할 수 있도록 하는 Simplified Setup Tool을 포함하고 있 습니다. § IBM SST를 이용하여 아래의 네 가지 서버 환경을 구성하는데 필요한 요소들을 설치 및 설정 할 수 있습니다. – Web server (LAMP) : Linux, Apache, Mysql, PHP 네 가지 오픈소스를 사용하여 구성한 웹서버 – Mail server : Post. Fix(MTA) 와 IMAP 4 프로토콜을 이용해서 mail 서버를 구축합니다. – File and print server : – Network Infrastructure server § SST를 이용하기 위해서는 먼저, Installation Toolkit의 yum repository를 이용하여 설치를 합 니다. # yum install sst-* 36 sst 관련 모든 파일들을 설치해줍니다. © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § 첫 화면에서 4가지 workload를 볼 수 있고, 아직 configured 되지 않았다는 것을 확인 할 수 있습니다. 설치를 원하는 workload를 선택하여 클릭합니다. 원하는 open source workload 선택 38 © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § LAMP 구성시 자동으로 설정되는 parameter들 Files that will be changed: /etc/httpd/conf/httpd. conf /etc/sysconfig/httpd /etc/sysctl. conf /etc/sysconfig/network-scripts/ifup-eth ================================================= Commands that will be performed: iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT service iptables save sysctl -w net. ipv 4. conf. all. rp_filter=1 sysctl -w net. ipv 4. conf. all. arp_filter=1 sysctl -w net. ipv 4. tcp_timestamps=0 sysctl -w net. ipv 4. tcp_max_tw_buckets=1440000 sysctl -w net. core. rmem_default=16777216 sysctl -w net. core. rmem_max=16777216 sysctl -w net. core. wmem_default=16777216 sysctl -w net. core. wmem_max=16777216 sysctl -w net. core. optmem_max=16777216 sysctl -w net. ipv 4. tcp_rmem="65536 87380 16777216" sysctl -w net. ipv 4. tcp_wmem="65536 87380 16777216" sysctl -w net. ipv 4. tcp_window_scaling=0 sysctl -w net. ipv 4. tcp_dsack=0 sysctl -w net. ipv 4. tcp_sack=0 sysctl -w net. core. somaxconn=66636 sysctl -w net. core. netdev_max_backlog =30000 sysctl -w net. ipv 4. tcp_max_syn_backlog=16384 ip link set eth 3 txqueuelen 60000 chkconfig --level 35 httpd on service httpd restart chkconfig --level 35 mysqld on service mysqld restart © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § Mail Server 구성 - Postfix – Postfix는 SMTP (Simple Mail Transfer Protocol)와 MTA (Mail Transfer Agent) 기능을 구현하는 어플 리케이션 입니다. – 아래에 주어진 필드 값들을 입력하면 /etc/postfix/main. cf 파일이 편집되어 Postfix에 반영됩니다. My Hostname : 메일서버에서 사용할 hostname을 입력합니다. default값은 localhost. localdomain 입 니다. ex) mail. ibm. com My Domain : 메일 서버에서 사용할 Domain을 입력합니다. ex) ibm. com Inet Interface : 메일을 수신할 서버를 지정합니다. (기본값은 all 입니다. ) 41 © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § Mail Server 구성 – 구성될 정보들을 확인하고 설치를 진행합니다. 43 © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § File and Print Server 구성 – 변경되는 사항들을 확인하고, 구성을 진행합니다. – 앞서 설정한 사항들이 Samba 관련 smb. conf와 rc 데몬 관련 rc. conf 파일들에 적용됩니다. 45 © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § File and Print Server 구성시 자동으로 설정되는 parameter들 Files that will be changed: /etc/samba/smb. conf /etc/rc. d/local Commands that will be performed: iptables -t filter -A SST-INPUT -m udp -p udp --dport 137 -j ACCEPT iptables -t filter -A SST-INPUT -m udp -p udp --dport 138 -j ACCEPT iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT service iptables save echo 2048 > /sys/block/ram 0/queue/read_ahead_kb echo 2048 > /sys/block/ram 1/queue/read_ahead_kb …중략… echo 2048 > /sys/block/ram 15/queue/read_ahead_kb echo 2048 > /sys/block/loop 0/queue/read_ahead_kb echo 2048 > /sys/block/loop 1/queue/read_ahead_kb …중략… echo 2048 > /sys/block/loop 7/queue/read_ahead_kb echo 2048 > /sys/block/sdb/queue/read_ahead_kb echo 2048 > /sys/block/sda/queue/read_ahead_kb echo 2048 > /sys/block/dm-0/queue/read_ahead_kb echo 2048 > /sys/block/dm-1/queue/read_ahead_kb …중략… echo 2048 > /sys/block/dm-7/queue/read_ahead_kb echo 2048 > /sys/block/sr 0/queue/read_ahead_kb echo deadline > /sys/block/sdb/queue/scheduler echo deadline > /sys/block/sda/queue/scheduler echo deadline > /sys/block/dm-0/queue/scheduler echo deadline > /sys/block/sr 0/queue/scheduler chkconfig --level 35 smb on service smb restart © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § Network infrastructure Server 구성 – DNS 서버인 BIND server를 구성할지 proxy server의 종류인 Squid 서버를 구성할지 선택을 합니다. 47 © 2013 IBM Corporation
IBM Power Systems 3. Others - IBM Simplified Setup Tool § Network infrastructure Server 구성 – 설정을 확인한 뒤, 구성을 진행합니다. 50 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § Linux LVM – AIX 의 LVM과 마찬가지로 Linux의 LVM 역시 물리적 디스크, 볼륨 그룹, 논리적 디스크 이 세가지 개념으로 구성되어 있습니다. – 두 운영체제의 LVM의 기본적인 개념은 비슷하지만, 아래와 같은 차이점이 있습니다. • hdisk[0, 1, 2, …] 와 sd[a, b, c, …] AIX에서 물리적인 disk 단위는 hdisk[0, 1, 2. . ] 와 같은 식으로 표현되지만, Linux에서는 sda, sdb, sdc… (IDE 방식 disk는 hd[a, b, c…) 처럼 표현됩니다. • PP vs PE, LE vs LP 물리적 할당 단위인 AIX의 PP(Physical Partition)은 Linux에서 PE (Physical Extend)로 대응 되고, 논리적 할당 단위인 LP(Logical Partition)은 Linux의 LE (Logical Extend)로 대응 됩니다. • AIX와 Linux 간의 기본적인 LVM 명령어 비교 AIX 51 Linux 비고 Physical Volume chdev / rmdev; reducevg –d / lspv fdisk / pvremove / pvdisplay PV를 LVM에서 사용하도록 설 정 Volume Group mkvg / reducevg / lsvg vgcreate / vgremove / vgdisplay VG 생성, 제거, 확인 Logical Volume mklv / rmlv / lslv lvcreate / lvremove / lvdisplay LV 생성, 제거, 확인 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § Physical Disk와 Disk Partition – Linux에서 sda, adb… 로 구분되는 물리적 디스크는 partition을 나눌 수 있습니다. – Partition은 disk의 실린더 번호를 기준으로 순차적으 로 나뉘어 집니다. [root@localhost ~]# fdisk -l Disk /dev/sda: 300. 0 GB, 3000000 bytes – 디스크 이름 (sda, sdb …)뒤에 숫자(sda 1, sda 2, sda 3 …) 로 구분되며, 낮은 번호부터 시스템에 mount됩니 다. – Power. PC용 RHEL 6. 4를 인스톨하면, 장착된 디스크 중, 첫 번째 디스크(sda)를 아래와 같이 파티셔닝합니 다. sda 1 : PPC PRe. P Boot Power. PC boot 파티션 sda 2 : Linux boot를 위한 파티션 sda 3 : Linux LVM이 관장하는 파티션 128 heads, 32 sectors/track, 143051 cylinders Units = cylinders of 4096 * 512 = 2097152 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0 x 7 a 170900 Device Boot /dev/sda 1 * Start 1 End 3 Blocks Id System 4096 41 PPC PRe. P Boot Partition 1 does not end on cylinder boundary. /dev/sda 2 3 253 512000 83 Linux Partition 2 does not end on cylinder boundary. /dev/sda 3 253 143051 292451328 8 e Linux LVM Partition 3 does not end on cylinder boundary. – fdisk –l 명령어로 System의 전체 디스크의 파티션을 확인 할 수 있습니다. 52 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) [root@localhost ~]# fdisk -l § LVM Disk 추가 – RHEL 패키지에는 udev 라는 데몬이 포함되어 있어, AIX와는 다르게 디스크를 추가했을 때, cfgmgr과 같은 명령 없이 system에서 인식을 합니다. Disk /dev/sda: 300. 0 GB, 3000000 bytes 128 heads, 32 sectors/track, 143051 cylinders Units = cylinders of……. . Disk /dev/sdb: 300. 0 GB, 3000000 bytes 256 heads, 63 sectors/track, 36330 cylinders – system에 디스크를 추가하고 fdisk –l 명령으로 확인합니다. – 추가된 디스크를 partitioning 합니다. 여기서는 sdb로 인식하였으므로, 아래 명령으로 partitioning 합니다. # fdisk /dev/sdb Command (m for help): – m을 입력 하여 입력 메뉴를 확인합니다. 53 Units = cylinders of 16128 * 512 = 8257536 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@localhost ~]# fdisk /dev/sdb Command (m for help): Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM Disk Partitioning [root@localhost ~]# fdisk /dev/sdb – ‘n’ 을 입력합니다. (add a new partition) Command action e extended (확장 파티션) p primary partition (1 -4) (주 파티션) – ‘p’ 주 파티션을 선택합니다. – 생성할 파티션 개수를 입력합니다. (1 -4개 가능) First cylinder (1 -36330, default 1): Last cylinder, +cylinders or +size{K, M, G} – 각 파티션 별로 첫 실린더와 끝 실린더를 입력 하여 크기를 설정합니다. 첫 실린더의 경우, 엔터를 입력하면 default값이 입력 되고, 끝 실린더는 +를 이용하여 크기를 지정할 수 있습니다. ex) Last cylinder : +60 G (60 G 파티션 생성) Command (m for help): Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): n Command action e extended p primary partition (1 -4) p Partition number (1 -4): 1 First cylinder (1 -36330, default 1): 1 Last cylinder, +cylinders or +size{K, M, G} (1 -36330, default 36330): Using default value 36330 54 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM Disk Partitioning – 디스크에서 사용할 시스템을 지정해 주기 위해서 ‘t’를 입력하여 system id를 설정합니다. Selected partition : 1 (설정할 파티션 선택) Hex code (type L to list codes): L Hex code로 되어 있는 system id를 입력합니다. ‘L’을 입력하여 list를 확인 할 수 있습니다. Hex code (type L to list codes): 8 e Linux LVM의 code인 8 e를 입력합니다. Command (m for help): t Selected partition 1 Hex code (type L to list codes): L 0 1 2 3 4 5 6 7 8 Empt FAT 12 XENIX root XENIX usr FAT 16 <32 M Extended FAT 16 HPFS/NTFS AIX 24 NEC DOS 39 Plan 9 3 c Partition. Magic 40 Venix 80286 41 PPC PRe. P Boot 42 SFS 4 d QNX 4. x 4 e QNX 4. x 2 nd part 4 f QNX 4. x 3 rd part 81 Minix / old Lin 82 Linux swap / So 83 Linux 84 OS/2 hidden C: 85 Linux extended 86 NTFS volume set 87 NTFS volume set 88 Linux plaintext 8 e Linux LVM . . . bf Solaris c 1 DRDOS/sec (FATc 4 DRDOS/sec (FATc 6 DRDOS/sec (FATc 7 Syrinx da Non-FS data db CP/M / CTOS /. de Dell Utility df Boot. It Hex code (type L to list codes): 8 e Changed system type of partition 1 to 8 e (Linux LVM) 55 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) Command (m for help): P § LVM Disk Partitioning, PV 생성 – ‘P’ 를 입력하여 현재 설정을 확인합니다. Disk /dev/sdb: 300. 0 GB, 3000000 bytes 256 heads, 63 sectors/track, 36330 cylinders Units = cylinders of 16128 * 512 = 8257536 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0 x 184 d 40 f 8 – 설정을 확인한 뒤, 변경 사항이 없으면 ‘w’를 입 력하여 설정을 저장한 뒤 빠져나옵니다. Device Boot /dev/sdb 1 Start End Blocks Id System 1 36330 292965088+ 8 e Linux LVM Command (m for help): w The partition table has been altered! – fdisk –l 로 시스템에 반영이 됐는지 확인합니 다. Calling ioctl() to re-read partition table. Syncing disks. [root@localhost ~]# fdisk -l – pvdisplay를 입력하여 Physical Volume이 등록 되었는지 확인하면, 아직 LVM에는 생성이 되지 않았습니다. Disk /dev/sda: 300. 0 GB, 3000000 bytes 128 heads, 32 sectors/track, 143051 cylinders Units = cylinders of……. . – pvcreate /dev/(디스크파티션) 을 입력하여 PV 를 LVM에 생성합니다. Disk /dev/sdb: 300. 0 GB, 3000000 bytes 256 heads, 63 sectors/track, 36330 cylinders Units = cylinders of 16128 * 512 = 8257536 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes ex) pvcreate /dev/sdb 1 Device Boot /dev/sdb 1 Start 1 End Blocks Id System 36330 292965088+ 8 e Linux LVM [root@localhost ~]# pvcreate /dev/sdb 1 Physical volume "/dev/sdb 1" successfully created 56 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM Volume Group – pvdisplay 명령으로 생성한 PV를 확인합니다. # pvdisplay – PV를 새로운 Volume Group에 추가 (vgcreate) # vgcreate (vg이름) /dev/(pv이름) # vgs vg확인 – PV를 기존 Volume Group에 추가 (vgextend) # vgextend (vg이름) /dev/(pv이름) – VG 삭제 (vgremove) # vgremove (vg이름) – Volume Group에서 PV 제거 (vgreduce) # vgreduce (vg이름) /dev/(pv이름) [root@localhost ~]# pvdisplay /dev/sdb 1 "/dev/sdb 1" is a new physical volume of "279. 39 Gi. B" --- NEW Physical volume --PV Name /dev/sdb 1 VG Name PV Size 279. 39 Gi. B Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID 7 c 1 Ok. Y-h. Exy-c. BW 7 -m. OA 3 -b 6 MX-RGCD-G 9 Sxma [root@localhost ~]# vgcreate test_vg /dev/sdb 1 Volume group "test_vg" successfully created [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree Vol. Group 1 3 0 wz--n- 278. 90 g 0 test_vg 1 0 0 wz--n- 279. 39 g [root@localhost ~]# vgremove test_vg Volume group "test_vg" successfully removed [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree Vol. Group 1 3 0 wz--n- 278. 90 g 0 [root@localhost ~]# vgextend Vol. Group /dev/sdb 1 Volume group "Vol. Group" successfully extended [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree Vol. Group 2 3 0 wz--n- 558. 29 g 279. 39 g [root@localhost ~]# vgreduce Vol. Group /dev/sdb 1 Removed "/dev/sdb 1" from volume group " Vol. Group" [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree Vol. Group 1 3 0 wz--n- 278. 90 g 0 57 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM Logical Volume – VG에 논리 볼륨(LV)을 생성 (lvcreate) # lvcreate –L (lv 크기) –n (lv이름) (vg이름) # lvs LV 확인 – LV의 크기 변경 (lvresize) # lvresize –L (변경할 크기) /dev/(vg이름)/(lv이름) (LV가 디렉터리에 마운트되어 있으면 안 된다. ) ex) lvresize –L +10 M /dev/test. VG/test. LV 10 M 확장 lvresize –L 100 M /dev/test. VG/test. LV 100 M로 크기 변경 lvresize –L -10 M /dev/test. VG/test. LV 10 M 축소 *LV 크기 축소 시 , 데이터 손상에 대한 경고메시지 가 출력됩니다. – LV제거 # lvremove /dev/(vg이름)/(lv이름) 58 [root@localhost /]# lvcreate -L 500 M -n test_lv Vol. Group Logical volume "test_lv" created [root@localhost /]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_home Vol. Group -wi-ao--- 221. 32 g lv_root Vol. Group -wi-ao--- 50. 00 g lv_swap Vol. Group -wi-ao--- 7. 58 g test_lv Vol. Group -wi-ao--- 500. 00 m [root@localhost /]# lvresize -L +100 M /dev/Vol. Group/test_lv Extending logical volume test_lv to 600. 00 Mi. B Logical volume test_lv successfully resized [root@localhost /]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_home Vol. Group -wi-ao--- 221. 32 g lv_root Vol. Group -wi-ao--- 50. 00 g lv_swap Vol. Group -wi-ao--- 7. 58 g test_lv Vol. Group -wi-ao--- 600. 00 m [root@localhost /]# lvresize -L 700 M /dev/Vol. Group/test_lv Extending logical volume test_lv to 700. 00 Mi. B Logical volume test_lv successfully resized [root@localhost /]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_home Vol. Group -wi-ao--- 221. 32 g lv_root Vol. Group -wi-ao--- 50. 00 g lv_swap Vol. Group -wi-ao--- 7. 58 g test_lv Vol. Group -wi-ao--- 700. 00 m [root@localhost /]# lvresize -L -200 M /dev/Vol. Group/test_lv WARNING: Reducing active and open logical volume to 500. 00 Mi. B THIS MAY DESTROY YOUR DATA (filesystem etc. ) Do you really want to reduce test_lv? [y/n]: y Reducing logical volume test_lv to 500. 00 Mi. B Logical volume test_lv successfully resized [root@localhost /]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_home Vol. Group -wi-ao--- 221. 32 g lv_root Vol. Group -wi-ao--- 50. 00 g lv_swap Vol. Group -wi-ao--- 7. 58 g test_lv Vol. Group -wi-ao--- 500. 00 m © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) [root@localhost /]# mkdir /test § LVM File System – 먼저 file system(fs)을 mount 할 디렉터리를 생성하고, fs 을 생성하여 mount합니다. # mkdir (mount할 디렉터리 명) # mkfs –t (fs 타입) /dev/(vg이름)/(lv이름) # mount –t (fs 타입) /dev/(vg이름)/(lv이름) (mout point) ex) # mkdir /test # mkfs –t ext 4 /dev/test. VG/test. LV # mout –t ext 4 /dev/test. VG/test. LV /test * ext 4는 저널링 파일시스템으로서 리눅스 표준 파일 시스템 타입입니다. # df –h. T 생성한 파일시스템을 확인합니다. – File System 사이즈 변경 • 먼저 mount를 해제 합니다. # umount (mount point) • 해당 FS를 검사하고 사이즈를 변경합니다. # e 2 fsck –f /dev/(vg이름)/(lv이름) # resize 2 fs /dev/(vg이름)/(lv이름) 변경할 size ex) # resize 2 fs /dev/VG 1/LV 1 +100 g 100 G 확장 # resize 2 fs /dev/VG 2/LV 2 -50 m 50 M 축소 # resize 2 fs /dev/VG 3/LV 3 150 g 150 G 로 변경 59 [root@localhost /]# mkfs -t ext 4 /dev/Vol. Group/test_lv mke 2 fs 1. 41. 12 (17 -May-2010) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 128016 inodes, 512000 blocks 25600 blocks (5. 00%) reserved for the super user First data block=1 Maximum filesystem blocks=67633152 63 block groups 8192 blocks per group, 8192 fragments per group 2032 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 30 mounts or 180 days, whichever comes first. Use tune 2 fs -c or -i to override. [root@localhost /]# mount -t ext 4 /dev/Vol. Group/test_lv /test/ [root@localhost /]# df -h. T Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/Vol. Group-lv_root ext 4 50 G 8. 4 G 39 G 18% / tmpfs 7. 5 G 0% /dev/ shm /dev/sda 2 ext 4 485 M 44 M 416 M 10% /boot /dev/mapper/Vol. Group-lv_home ext 4 218 G 3. 0 G 204 G 2% /home /dev/mapper/Vol. Group-test_lv ext 4 485 M 11 M 449 M 3% /test © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM - /etc/fstab 설정 – 먼저, 생성한 LV에 label을 만들어 줍니다. # e 2 label /dev/(VG 이름)/(LV 이름) LV label 확인 # e 2 label /dev/(VG 이름)/(LV 이름) /(label 이름) – vi 편집기를 이용해 /etc/fstab에 아래와 같은 항목을 추가합니다. LABEL=(label이름) (mount point 주소) ext 4 default 1 2 [root@localhost IBM_Toolkit]# e 2 label /dev/Vol. Group/test_lv /test-label [root@localhost IBM_Toolkit]# vi /etc/fstab ------------------------------------------------V I편집 ----------------------------------------------------------------# # /etc/fstab # Created by anaconda on Fri Apr 26 14: 29: 09 2013 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/Vol. Group-lv_root / ext 4 defaults 11 UUID=8 d 3 e 75 bb-248 d-4 d 15 -8 a 9 f-cf 0 ee 906 d 9 a 9 /boot ext 4 defaults 12 /dev/mapper/Vol. Group-lv_home /home ext 4 defaults 12 /dev/mapper/Vol. Group-lv_swap defaults 00 LABEL=/test-label /test tmpfs /dev/ shm 61 ext 4 defaults tmpfs defaults 22 00 추가된 항목 © 2013 IBM Corporation
IBM Power Systems 3. Others – Linux LVM (Logical Volume Manager) § LVM Mirroring – LVM이 관장하는 볼륨을 미러링 합니다. – Linux LVM Type(8 e)이 아닌, boot image와 Linux영역은 LVM을 이용하여 mirroring 할 수 없습니다. – lvconvert 명령에서 m 1 옵션을 주어 lv의 속성을 mirroring 할 수 있도록 변경합니다. # lvconvert –m 1 /dev/(vg이름)/(lv 이름) – lvs에 –a 옵션(all)과 –o +devices 옵션(LV의 물리적 위치)을 주어 mirroring 된 상태를 확인합니다. # lvs –a –o +devices [root@localhost IBM_Toolkit]# lvconvert -m 1 /dev/Vol. Group/lv_home: Converted: 0. 0% Vol. Group/lv_home: Converted: 0. 2% . . . Vol. Group/lv_home: Converted: 99. 8% Vol. Group/lv_home: Converted: 100. 0% [root@localhost ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Move lv_home Vol. Group mwi-aom-221. 32 g [lv_home_mimage_0] Vol. Group iwi-aom-- 221. 32 g [lv_home_mimage_1] Vol. Group iwi-aom-- 221. 32 g [lv_home_mlog] Vol. Group lwi-aom-- 4. 00 m lv_root Vol. Group -wi-ao--50. 00 g lv_swap Vol. Group -wi-ao--7. 58 g 62 Log Cpy%Sync lv_home_mlog 100. 00 Convert Devices lv_home_mimage_0(0), lv_home_mimage_1(0) /dev/sda 3(12800) /dev/sdb 1(125) /dev/sdb 1(56784) /dev/sda 3(0) /dev/sda 3(69459) © 2013 IBM Corporation
IBM Power Systems 3. Others – Power Linux DLPAR 구성 § Linux 파티션에서 RMC 네트워크 데몬 설치 – HMC와 파티션간의 네트워크가 구성되어 있으나, DLPAR 시도 시, 아래와 같은 메시지가 출력됩니 다. – Linux 파티션의 터미널 창에서 YUM을 이용해 RMC Network를 구성하는 아래 file 들을 설치합니다. • 해당 파일들은 IBM Installation Toolkit으로 구성한 YUM repository에 있습니다. • Korn shell에서 설치를 해야 하므로, 먼저 kshell을 구성합니다. # yum install ksh. ppc 64 src. ppc rsct. core. utils. ppc rsct. core. ppc devices. chrp. base. Service. RM. ppc Dynamic. RM. ppc 64 ibm-power-managed-rhel 6. ppc 64 • YUM을 이용해 위 여섯 개의 파일들을 찾아서 install 합니다. (bold 표시한 키워드로 찾으면 쉽습니다. ) # yum search src rsct servicerm dynamicrm ibm-power-managed 64 © 2013 IBM Corporation
IBM Power Systems 3. Others – Power Linux DLPAR 구성 § Linux 파티션에서 RMC 네트워크 데몬 설치 (계속) # yum install src. ppc rsct. core. utils. ppc devices. chrp. base. Service. RM. ppc Dynamic. RM. ppc 64 rsct. core. ppc ibm-power-managed-rhel 6. ppc 64 # reboot 65 install 후 reboot을 합니다. © 2013 IBM Corporation
IBM Power Systems 3. Others – Power Linux DLPAR 구성 § Linux 파티션에서 RMC 네트워크 데몬 실행 # lssrc –g rsct_rm Subsystem IBM. Service. RM IBM. DRM IBM. ERRM IBM. Audit. RM IBM. Sensor. RM IBM. Mgmt. Domain. RM IBM. Host. RM # lssrc -a 66 Subsystem ctrmc IBM. Service. RM IBM. DRM ctcas IBM. ERRM IBM. Audit. RM IBM. Sensor. RM IBM. Mgmt. Domain. RM IBM. Host. RM rsct_rm 그룹에 해당 데몬들이 설치되었는지 확인합니다. Group PID Status rsct_rm 2630 active rsct_rm 2632 active rsct_rm inoperative rsct_rm inoperative Group rsct_rm rsct_rm rsct_rm PID 1261 2630 2632 Status active inoperative inoperative © 2013 IBM Corporation
IBM Power Systems 3. Others – Power Linux DLPAR 구성 § Linux 파티션에서 RMC 네트워크 데몬 실행 – 네트워크 데몬을 시작합니다. # startsrc -g rsct_rm 0513 -059 The IBM. ERRM Subsystem has been started. Subsystem PID is 3492. 0513 -059 The IBM. Audit. RM Subsystem has been started. Subsystem PID is 3493. 0513 -059 The IBM. Sensor. RM Subsystem has been started. Subsystem PID is 3494. 0513 -029 The IBM. Service. RM Subsystem is already active. Multiple instances are not supported. 0513 -059 The IBM. Mgmt. Domain. RM Subsystem has been started. Subsystem PID is 3495. 0513 -029 The IBM. DRM Subsystem is already active. Multiple instances are not supported. 0513 -059 The IBM. Host. RM Subsystem has been started. Subsystem PID is 3496. # lssrc -g rsct_rm Subsystem IBM. Service. RM IBM. DRM IBM. ERRM IBM. Audit. RM IBM. Sensor. RM IBM. Host. RM IBM. Mgmt. Domain. RM 67 Group rsct_rm rsct_rm PID 2630 2632 3493 3494 3496 3560 Status active active © 2013 IBM Corporation
IBM Power Systems 3. Others – Power Linux DLPAR 구성 § Dynamic Lpar 동작 확인 # ppc 64_cpu --cores-on Lpar에 현재 할당된 CPU를 확인합니다. (4 core activate) Number of cores online = 4 – HMC 상에서 CPU 제거 # ppc 64_cpu –cores-on 68 (3 core 할당) 확인 © 2013 IBM Corporation
IBM Power Systems Power. Linux HOWTO 4. Tuning © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Power Saver Mode § Power Saver Mode – HMC에서 ASM launching – Power Save Mode를 disable하는 것이 짧은 transaction의 응답 시간 향상에 좋습니다. – 이의 disable을 위해서는 ASM (Advanced System Management) 메뉴에 접속해야 합니다. – ASM은 Power. Linux 서버의 serial port를 통해 접속할 수도 있으나, 여기서는 HMC를 이용해서 접속하는 방법을 소개 합니다. © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Power Saver Mode § Power Saver Mode – ASM에 접속 – 앞 페이지의 ASM 메뉴를 launch하면, 아래 왼쪽 화면과 같이 service processor IP를 선택하는 메뉴가 나옵니다. (보 통 Power. Linux에서는 service processor가 1개이므로 그냥 OK를 선택하면 됩니다. ) – 이어서 나오는 ASM 초기 메뉴에서, id는 admin, password도 admin으로 login 합니다. © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Power Saver Mode § Power Saver Mode - Disable Power Saver mode – Brower 왼쪽 window의 “System Configuration” 메뉴의 sub-menu 중 “Power Management”를 택합니다. – 그 sub-menu 중 “Power Mode Setup”을 선택합니다. – 이어서 나타나는 오른쪽 window에서, “Disable Power Saver mode”를 선택하고 아래의 “Continue” 버튼을 누릅니다. Low latency에는 이것을 선택 ! © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Power Saver Mode § Power Saver Mode – Idle Power Saver disable – – (POWER 7+ 이전 model에서는 이 메뉴가 존재하지 않을 수 있으니 무시하십시오. ) Sub-menu 중 “Power Mode Setup” 바로 아래에 있는 “Idle Power Saver”를 이어서 선택합니다. 이어서 나타나는 오른쪽 window에서, “Idle Power Saver Enable”의 값을 disable로 선택합니다. 기타 항목들이나, 왼쪽 window의 ““Idle Power Saver” 밑의 “Tuning Parameters”는 모두 무시해도 됩니다. (Power Saver mode를 enable할 때 사용되는 parameter들이므로, 여기서는 무관합니다. ) Low latency에는 이것을 선택 ! © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – SMT Disable § SMT disable – 증권사 FEP 등과 같이 thread 수가 많지 않고 CPU 부하가 높지 않은 서버에서는 SMT를 disable하는 것이 성능상 더 유리한 경우가 있습니다. – SMT의 disable은 다음 명령으로 수행합니다. – 이 명령은 reboot 후에는 효력을 상실하므로, AIX의 /etc/inittab에 해당하는 /etc/rc. d/rc 3. d/S 99 local 에 아래와 같이 입력해두어야 합니다. [root@Power. Linux 2 ~]# ppc 64_cpu --cores-on Number of cores online = 4 [root@Power. Linux 2 ~]# ppc 64_cpu --smt SMT is on [root@Power. Linux 2 ~]# ppc 64_cpu --smt=off [root@Power. Linux 2 ~]# ppc 64_cpu --smt SMT is off [root@Power. Linux 2 ~]# vi /etc/rc. d/rc 3. d/S 99 local … touch /var/lock/subsys/local /usr/sbin/ppc 64_cpu --smt=off © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Stop Unnecessary Services § Stop unnecessary services – auditd, dovecot 등과 같이 불필요한 서비스를 모두 중단합니다. [root@Power. Linux 2 ~]# /sbin/chkconfig auditd 0: off 1: off 2: on crond 0: off 1: off 2: on ip 6 tables 0: off 1: off 2: on iprdump 0: off 1: off 2: on iprinit 0: off 1: off 2: on iprupdate 0: off 1: off 2: on iptables 0: off 1: off 2: on lvm 2 -monitor 0: off 1: on 2: on multipathd 0: off 1: off 2: on netconsole 0: off 1: off 2: off netfs 0: off 1: off 2: off network 0: off 1: off 2: on postfix 0: off 1: off 2: on rdisc 0: off 1: off 2: off restorecond 0: off 1: off 2: off rhnsd 0: off 1: off 2: on rhsmcertd 0: off 1: off 2: off rsyslog 0: off 1: off 2: on rtas_errd 0: off 1: off 2: on saslauthd 0: off 1: off 2: off sshd 0: off 1: off 2: on udev-post 0: off 1: on 2: on. . 3: on 4: on 5: on 3: on 4: on 5: on 3: on 4: on 5: on 3: off 4: off 5: off 3: on 4: on 5: on 3: off[root@Power. Linux 2 4: off 5: off 3: on 4: on 5: on [root@Power. Linux 2 3: on 4: off 5: on 3: off[root@Power. Linux 2 4: off 5: off 3: on [root@Power. Linux 2 4: on 5: on [root@Power. Linux 2 6: off 6: off 6: off 6: off ~]# /sbin/chkconfig 6: off ~]# /sbin/chkconfig 6: off ~]# ~]# ~]# /sbin/chkconfig /sbin/chkconfig --level --level --level --level 3 3 3 3 auditd off ip 6 tables off iprdump off iprinit off iprupdate off iptables off lvm 2 -monitor off netfs off postfix off rhnsd off rhsmcertd off rtas_errd off rsyslog off © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Compiler Option § Compiler option – Power. Linux에는 advance-toolchain이라는 gcc 4. 7. 3 + library들이 설치되어 있습니다. – RHEL 6. 3의 기본 gcc인 4. 4를 이것으로 replace하여 soft-link를 걸어 놓았습니다. – 이것을 사용하시면 더 좋은 성능을 얻을 수 있고, 사용법은 동일합니다. [root@localhost ~]# ls -l /usr/bin/gcc lrwxrwxrwx. 1 root 18 Jun 11 16: 02 /usr/bin/gcc -> /opt/at 6. 0/bin/gcc [root@localhost ~]# rpm -qa | grep advance-toolchain-at 6. 0 -runtime-6. 0 -4. ppc 64 advance-toolchain-at 6. 0 -devel-6. 0 -4. ppc 64 [root@localhost seed]# /usr/bin/gcc 4. 4 -O 3 -lpthread -lm -o seed. c: In function ‘main’: seed. c: 299: warning: cast to pointer from integer of different size [root@localhost seed]#. /seed cpu: 0 size: 1400 enc: 5(msec), dec: 4(msec), throughput: 40000 Kpps 448 Mbps, 25 us cpu: 1 size: 1400 enc: 5(msec), dec: 4(msec), throughput: 40000 Kpps 448 Mbps, 25 us [root@localhost seed]# /usr/bin/gcc -O 3 -lpthread -lm -o seed. c: In function ‘main’: seed. c: 299: 54: warning: cast to pointer from integer of different size [root@localhost seed]#. /seed cpu: 1 size: 1400 enc: 3(msec), dec: 4(msec), throughput: 66666 Kpps 746 Mbps, 15 us cpu: 0 size: 1400 enc: 3(msec), dec: 4(msec), throughput: 66666 Kpps 746 Mbps, 15 us 암호화 seed. c 성능 테스트 기존 gcc 4. 4 AT gcc 4. 7. 3 © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – Compiler Option § IBM Advance Toolchain의 추가적인 compiler option – Advance. Toolchain에서 제공되는 몇 가지 추가 option을 넣으면 더 나은 성능을 내는 경우도 있습니다. – 그러나 항상 +효과를 내는 것은 아니며, 업무 성격에 따라 –효과를 내는 경우도 자주 있습니다. – 많은 경우에, -O 3만 넣는 것이 가장 좋은 효과를 내기도 합니다. gcc -O 3 -flto -mcpu=power 7 -mtune=power 7 -ltcmalloc -mno-vsx link time optimization을 해주는 option “Preserve compile-time information within object files to permit further inter-compilation-unit optimizations at link time. ” Thread-caching 성능에 최적화된 malloc library를 사용하도록 하게 해주는 option “Thread-Caching Malloc library, a fast, low-overhead, low-contention memory allocation/deallocation library” power 7에 최적화된 code를 만드는 option power 7의 VSX option을 안 쓰도록 하는 option © 2013 IBM Corporation
IBM Power Systems 4. Power Linux Tuning – sysctl Tuning § 일반적인 sysctl tuning – 일반적으로 권고되는 sysctl tuning 값입니다. – Reboot 이후에도 같은 효과를 유지하기 위해서는 /etc/sysctl. conf에 해당 값들을 등록하면 됩니다. /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl vm. min_free_kbytes="65536" vm. swappiness="30" vm. dirty_ratio="50" net. core. netdev_max_backlog="250000" net. core. optmem_max="524287" net. ipv 4. igmp_max_memberships="30" net. ipv 4. tcp_no_metrics_save="1" net. ipv 4. tcp_reordering="9" net. ipv 4. tcp_timestamps="0" net. ipv 4. tcp_window_scaling="1" net. ipv 4. tcp_adv_win_scale="1" net. ipv 4. tcp_sack="0" net. ipv 4. tcp_low_latency="1" net. ipv 4. tcp_moderate_rcvbuf="1" net. core. wmem_default="65536" net. core. rmem_max="16777216" net. core. wmem_max="16777216" net. ipv 4. tcp_rmem="8192 8388608 16777216" net. ipv 4. tcp_wmem="4096 8388608 16777216" net. ipv 4. tcp_mem="8388608" net. ipv 4. route. flush="1" net. ipv 4. udp_wmem_min="4096" net. ipv 4. udp_rmem_min="8192" net. ipv 4. udp_mem="2322816 3097088 4645632" © 2013 IBM Corporation
IBM Power Systems © 2013 IBM Corporation
- Slides: 79