2022년 12월 7일 수요일

Microsoft .NET 7, 이제 IBM Power에서도 지원

 


.NET 7이 이제 Linux on Power (ppc64le)에서도 지원됩니다.  즉 ppc64le 아키텍처의 Power 서버에서는 C# 언어도 지원하게 되었습니다.  이로써 microservices app 개발에 사용되는 5개 프로그래밍 언어가 모두 ppc64le에서 지원됩니다.  





즉, 과거에는 Oracle 등 AIX에서 수행되는 기간계 시스템과 연계하여 C# 언어로 작성된 업무 프로그램을 사용하기 위해서는 Windows 또는 Linux를 설치한 x86 시스템이 필요했으나, 이제는 x86이 필요하지 않고 같은 Power 시스템에 설치된 Redhat 또는 Openshift container에서 C# 업무 프로그램을 운용할 수 있게 된 것입니다.  





2021년 Stack Overflow에서의 개발자 설문에 따르면 .NET framework은 전업 개발자들에게 있어서 가장 중요한 프레임웍 및 라이브러리입니다. 







관련 발표는 아래 URL에서 좀 더 자세히 보실 수 있습니다.


https://community.ibm.com/community/user/powerdeveloper/blogs/janani-janakiraman/2022/11/07/net7-support-linux-on-power


또한 .NET 7 ppc64le는 이미 고객 reference가 있습니다.  독일의 컴퓨터 설계 관련 기업인 SKM Informatik GmbH인데, 이 기업의 요청으로 .NET 7의 ppc64le 지원이 시작되었다고 합니다.


https://www.ibm.com/downloads/cas/29RYARBY


.NET 7은 github에 그 source code가 공개되니 직접 build 하셔도 됩니다만, .NET 7 for ppc64le는 Openshift container 이미지로 제공되고 또 RHEL 8.7 또는 RHEL 9.1에서 YUM repository를 통해서도 제공됩니다.  


.NET 7 관련된 패키지들은 yum 명령어를 통해 패키지로 아래 예와 같이 설치하실 수 있습니다.  


[cecuser@p1274-pvm1 ~]$ hostnamectl

   Static hostname: p1274-pvm1

         Icon name: computer-vm

           Chassis: vm

        Machine ID: e5e70adcd98c4b56b00cc49cbf093412

           Boot ID: 36e5448112b5432c91f40abe413cb05a

    Virtualization: powervm

  Operating System: Red Hat Enterprise Linux 8.7 (Ootpa)

       CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos

            Kernel: Linux 4.18.0-372.9.1.el8.ppc64le

      Architecture: ppc64-le



[cecuser@p1274-pvm1 ~]$ yum list | grep dotnet

dotnet.ppc64le                                          7.0.100-1.el8_7                                             rhel-8-for-ppc64le-appstream-rpms

dotnet-apphost-pack-7.0.ppc64le                         7.0.0-1.el8_7                                               rhel-8-for-ppc64le-appstream-rpms

dotnet-host.ppc64le                                     7.0.0-1.el8_7                                               rhel-8-for-ppc64le-appstream-rpms

dotnet-hostfxr-7.0.ppc64le                              7.0.0-1.el8_7                                               rhel-8-for-ppc64le-appstream-rpms

dotnet-runtime-7.0.ppc64le                              7.0.0-1.el8_7                                               rhel-8-for-ppc64le-appstream-rpms

dotnet-sdk-7.0.ppc64le                                  7.0.100-1.el8_7                                             rhel-8-for-ppc64le-appstream-rpms

dotnet-sdk-7.0-source-built-artifacts.ppc64le           7.0.100-1.el8_7                                             codeready-builder-for-rhel-8-ppc64le-rpms

dotnet-targeting-pack-7.0.ppc64le                       7.0.0-1.el8_7                                               rhel-8-for-ppc64le-appstream-rpms

dotnet-templates-7.0.ppc64le                            7.0.100-1.el8_7                                             rhel-8-for-ppc64le-appstream-rpms




[cecuser@p1274-pvm1 ~]$ sudo yum install dotnet-sdk-7.0

Updating Subscription Management repositories.

Last metadata expiration check: 23:10:11 ago on Tue 06 Dec 2022 03:10:01 AM EST.

Dependencies resolved.

===================================================================================================

 Package                        Arch    Version            Repository                         Size

===================================================================================================

Installing:

 dotnet-sdk-7.0                 ppc64le 7.0.100-1.el8_7    rhel-8-for-ppc64le-appstream-rpms  53 M

Installing dependencies:

 aspnetcore-runtime-7.0         ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 2.8 M

 aspnetcore-targeting-pack-7.0  ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 1.6 M

 dotnet-apphost-pack-7.0        ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 100 k

 dotnet-host                    ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 190 k

 dotnet-hostfxr-7.0             ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 175 k

 dotnet-runtime-7.0             ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 7.8 M

 dotnet-targeting-pack-7.0      ppc64le 7.0.0-1.el8_7      rhel-8-for-ppc64le-appstream-rpms 2.9 M

 dotnet-templates-7.0           ppc64le 7.0.100-1.el8_7    rhel-8-for-ppc64le-appstream-rpms 3.1 M

 netstandard-targeting-pack-2.1 ppc64le 7.0.100-1.el8_7    rhel-8-for-ppc64le-appstream-rpms 1.5 M


Transaction Summary

===================================================================================================

Install  10 Packages


Total download size: 73 M

Installed size: 311 M

Is this ok [y/N]: y


...


Installed:

  aspnetcore-runtime-7.0-7.0.0-1.el8_7.ppc64le

  aspnetcore-targeting-pack-7.0-7.0.0-1.el8_7.ppc64le

  dotnet-apphost-pack-7.0-7.0.0-1.el8_7.ppc64le

  dotnet-host-7.0.0-1.el8_7.ppc64le

  dotnet-hostfxr-7.0-7.0.0-1.el8_7.ppc64le

  dotnet-runtime-7.0-7.0.0-1.el8_7.ppc64le

  dotnet-sdk-7.0-7.0.100-1.el8_7.ppc64le

  dotnet-targeting-pack-7.0-7.0.0-1.el8_7.ppc64le

  dotnet-templates-7.0-7.0.100-1.el8_7.ppc64le

  netstandard-targeting-pack-2.1-7.0.100-1.el8_7.ppc64le


Complete!


설치는 위와 같이 매우 간단합니다.  이제 "Hello, World!"를 프린트하는 샘플 프로그램을 돌려보도록 하겠습니다.


[cecuser@p1274-pvm1 ~]$ dotnet


Usage: dotnet [options]

Usage: dotnet [path-to-application]


Options:

  -h|--help         Display help.

  --info            Display .NET information.

  --list-sdks       Display the installed SDKs.

  --list-runtimes   Display the installed runtimes.


path-to-application:

  The path to an application .dll file to execute.



[cecuser@p1274-pvm1 ~]$ dotnet new console -o MyApp -f net7.0


Welcome to .NET 7.0!

---------------------

SDK Version: 7.0.100


----------------

Installed an ASP.NET Core HTTPS development certificate.

To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).

Learn about HTTPS: https://aka.ms/dotnet-https

----------------

Write your first app: https://aka.ms/dotnet-hello-world

Find out what's new: https://aka.ms/dotnet-whats-new

Explore documentation: https://aka.ms/dotnet-docs

Report issues and find source on GitHub: https://github.com/dotnet/core

Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli

--------------------------------------------------------------------------------------

The template "Console App" was created successfully.


Processing post-creation actions...

Restoring /home/cecuser/MyApp/MyApp.csproj:

  Determining projects to restore...

  Restored /home/cecuser/MyApp/MyApp.csproj (in 200 ms).

Restore succeeded.



[cecuser@p1274-pvm1 ~]$ cd MyApp


[cecuser@p1274-pvm1 MyApp]$  ls -la

total 12

drwxrwxr-x.  3 cecuser cecuser   55 Dec  7 02:24 .

drwx------. 23 cecuser cecuser 4096 Dec  7 02:24 ..

-rw-rw-r--.  1 cecuser cecuser  239 Dec  7 02:24 MyApp.csproj

drwxrwxr-x.  2 cecuser cecuser  168 Dec  7 02:24 obj

-rw-rw-r--.  1 cecuser cecuser  103 Dec  7 02:24 Program.cs


[cecuser@p1274-pvm1 MyApp]$ cat Program.cs

// See https://aka.ms/new-console-template for more information

Console.WriteLine("Hello, World!");


[cecuser@p1274-pvm1 MyApp]$ dotnet run

Hello, World!


[cecuser@p1274-pvm1 MyApp]$ ls -ltr

total 8

-rw-rw-r--. 1 cecuser cecuser 239 Dec  7 02:24 MyApp.csproj

-rw-rw-r--. 1 cecuser cecuser 103 Dec  7 02:24 Program.cs

drwxrwxr-x. 3 cecuser cecuser 181 Dec  7 02:26 obj

drwxrwxr-x. 3 cecuser cecuser  19 Dec  7 02:26 bin


[cecuser@p1274-pvm1 MyApp]$ ls -ltr bin/Debug/net7.0

total 168

-rw-rw-r--. 1 cecuser cecuser  10828 Dec  7 02:26 MyApp.pdb

-rw-rw-r--. 1 cecuser cecuser   4608 Dec  7 02:26 MyApp.dll

-rwxr-xr-x. 1 cecuser cecuser 139488 Dec  7 02:26 MyApp

-rw-rw-r--. 1 cecuser cecuser    385 Dec  7 02:26 MyApp.deps.json

-rw-rw-r--. 1 cecuser cecuser    139 Dec  7 02:26 MyApp.runtimeconfig.json


[cecuser@p1274-pvm1 MyApp]$ ./bin/Debug/net7.0/MyApp

Hello, World!




다만 아래의 MS 홈페이지의 .NET download 사이트에서는 ppc64le 관련 패키지는 별도로 제공되지 않네요.


https://devblogs.microsoft.com/dotnet/announcing-dotnet-7/







2022년 12월 5일 월요일

Power 서버 LPAR에서 "Compatibility Mode"란 대체 무엇인가?




 Processor compatibility mode란 신규 processor에서도 오래된 버전의 OS를 지원하기 위해 사용되는 mode로서, Power 서버에서 logical partition (LPAR)를 설정할 때 정하는 것입니다.  

이걸 그냥 default로 설정하면 hypervisor가 해당 LPAR를 부팅할 때, 그 OS 버전에 알맞은 최적의 mode를 자동으로 선정합니다.

POWER10에서는 OS 버전에 따라 p8 mode부터 p10 mode까지 사용이 가능하며, mode에 따른 성능 차이는 대부분의 경우 미미합니다.  따라서, 크게 신경 쓰지 않고 그냥 default로 두시는 것을 권고드립니다.






Power10의 경우 지원되는 OS에는 AIX 7.1도 있지만, AIX 7.3 또는 AIX 7.2 TL5 이상이 권고됩니다.  AIX 7.1도 TL5 이상일 경우 지원은 가능하지만, 물리적 I/O (NIC, HBA)를 사용할 수 없고 VIOS를 통한 가상 I/O만 사용이 가능하기 때문입니다.


Power10에서 AIX 7.3 + Power10 mode (Native mode)를 사용할 경우 AIX 7.2 + Power9 mode에 비해 더 얻을 수 있는 이익은 다음과 같습니다만, 192개 이상의 CPU core를 사용하는 경우가 아닌 이상 그 성능 차이는 크지 않습니다.


1. LPAR 하나당 최대 1920개의 logical CPU (AIX 7.2의 경우 최대 1536개)

2. Power10의 MMA (Matrix Multiply Assist) 엔진 지원 (인공지능 inference 업무에 사용)

3. Power10에 최적화된 memcpy 성능








Power10에서 AIX 7.2 + Power9 mode를 사용할 경우 LPAR 하나당 logical CPU 개수가 최대 1536개 (192 * 8) 로 제한됩니다.  이는 p9 시절 최대 확장성이 12-core * 16-socket = 192 core (SMT8) 였기 때문입니다.

XIVE (eXternal Interrupt Virtualization Engine)란 network 가상화의 최적화를 위한 기술입니다.

MMA (Matrix Multiply Assist)란 Power10에 탑재된 행렬 연산 엔진이며, 이는 인공지능 inference 업무에 사용됩니다.

P10 optimized memcpy를 쓸 경우 성능이 어느 정도 향상되는지에 대한 명확한 수치는 발표된 바가 없습니다.





2022년 3월 28일 월요일

AIX에서 ping의 속도를 msec 이하 단위로 측정하는 방법

 AIX에서는 ping의 응답 시간을 msec로만 보여줍니다.


/ # ping 10.10.14.121

PING 10.10.14.121 (10.10.14.121): 56 data bytes

64 bytes from 10.10.14.121: icmp_seq=0 ttl=255 time=0 ms

64 bytes from 10.10.14.121: icmp_seq=1 ttl=255 time=0 ms


이를 msec 이하의 좀 더 세밀한 단위로 볼 수 있는 방법이 필요할 경우, 아래와 같이 tcpdump를 이용하시면 됩니다.


1) 먼저 창을 2개 띄우시고, 한쪽에서는 목적지 server로 ping을 수행합니다.


/ # ping 10.10.14.121

PING 10.10.14.121 (10.10.14.121): 56 data bytes

64 bytes from 10.10.14.121: icmp_seq=0 ttl=255 time=0 ms

64 bytes from 10.10.14.121: icmp_seq=1 ttl=255 time=0 ms


2) 이어서 2번째 창에서는 아래와 같이 tcpdump 명령을 en0 interface를 통해 저 목적지로 오가는  ICMP protocol에 대해서만 수행합니다.

/ # tcpdump -i en0 ip proto \\icmp and host 10.10.14.100
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on en0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:56:34.807504 IP 10.10.14.100 > aix61: ICMP echo request, id 320, seq 35, length 64
18:56:34.807528 IP aix61 > 10.10.14.100: ICMP echo reply, id 320, seq 35, length 64
18:56:35.807606 IP 10.10.14.100 > aix61: ICMP echo request, id 320, seq 36, length 64
18:56:35.807633 IP aix61 > 10.10.14.100: ICMP echo reply, id 320, seq 36, length 64


이 경우 seq 35 packet의 경우 18:56:34.807504와 18:56:34.807528의 차이, 즉 0.024msec가 응답 시간입니다.

seq 36 packet은 18:56:35.807606와 18:56:35.807633의 차이, 즉 0.027msec가 응답 시간입니다.

** 이 값들은 같은 물리적 서버 위에 구성된 VM 간의 virtual ethernet의 속도이므로 실제 물리적 switch를 거치는 값에 비해 매우 빠른 값입니다.