JP2018028769A - Conversion program and conversion method - Google Patents
Conversion program and conversion method Download PDFInfo
- Publication number
- JP2018028769A JP2018028769A JP2016159801A JP2016159801A JP2018028769A JP 2018028769 A JP2018028769 A JP 2018028769A JP 2016159801 A JP2016159801 A JP 2016159801A JP 2016159801 A JP2016159801 A JP 2016159801A JP 2018028769 A JP2018028769 A JP 2018028769A
- Authority
- JP
- Japan
- Prior art keywords
- cpu
- application
- conversion
- identification information
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明は変換プログラムおよび変換方法に関する。 The present invention relates to a conversion program and a conversion method.
現在、様々な処理の実行に情報処理装置が利用されている。情報処理装置では、NUMA(Non-Uniform Memory Access)と呼ばれる手法によりプロセッサとメモリとが実装されることがある。NUMAでは、複数のプロセッサとメモリとを備えるノードを複数設け、各プロセッサから自ノード上のメモリ(ローカルメモリ)、および、他ノード上のメモリ(リモートメモリ)にアクセス可能にする。プロセッサは、ローカルメモリを、リモートメモリよりも高速にアクセスできる。 Currently, information processing apparatuses are used to execute various processes. In an information processing apparatus, a processor and a memory may be mounted by a technique called NUMA (Non-Uniform Memory Access). In NUMA, a plurality of nodes including a plurality of processors and memories are provided, and each processor can access a memory (local memory) on its own node and a memory (remote memory) on another node. The processor can access local memory faster than remote memory.
例えば、複数のノードがインターコネクトで接続されたシステムにおいて、ハイパーバイザが、仮想計算機に割り当てる論理CPU(Central Processing Unit)を実行する物理CPUを、論理CPUから物理メモリへのアクセス性能により決定する提案がある。 For example, in a system in which a plurality of nodes are connected by an interconnect, there is a proposal that a hypervisor determines a physical CPU that executes a logical CPU (Central Processing Unit) allocated to a virtual machine based on access performance from the logical CPU to the physical memory. is there.
また、仮想マシンに関する特性を示すリクエストを受信すると、当該特性とシステムの物理トポロジーに基づいて、仮想マシンの仮想NUMAノード数を決定し、決定した仮想NUMAノード数を有する仮想マシンをインスタンス化するシステムの提案もある。 In addition, upon receiving a request indicating characteristics related to a virtual machine, the system determines the number of virtual NUMA nodes of the virtual machine based on the characteristics and the physical topology of the system, and instantiates a virtual machine having the determined number of virtual NUMA nodes There is also a proposal.
また、仮想マシン・ブート時、バーチャライザが、ゲスト物理メモリおよびゲスト仮想プロセッサを仮想ノード中にグループ分けした後、仮想ノード背後のホスト物理メモリを変更し、当該ノード内の仮想プロセッサに適切な物理プロセッサを提供する提案もある。 Also, when the virtual machine boots, the virtualizer groups the guest physical memory and guest virtual processors into virtual nodes, then changes the host physical memory behind the virtual nodes to ensure that the physical processors appropriate for the virtual processors in the nodes There are also proposals to provide a processor.
更に、新しいプロセスに論理プロセッサを割り当てる際に、このプロセスと既に論理プロセッサを割当済のプロセスとの依存関係に応じて物理プロセッサの性能を引き出すように論理プロセッサを割り当てる計算機システムの提案もある。 Further, there is a proposal of a computer system that assigns a logical processor so as to extract the performance of a physical processor according to the dependency relationship between this process and a process that has already been assigned a logical processor when assigning a logical processor to a new process.
異なる情報処理装置では、NUMAの構造(例えば、1つのノードにおけるプロセッサの数や各ノード上のプロセッサに割り振られる識別情報など)が異なることがある。また、情報処理装置により実行されるアプリケーションは、ある情報処理装置におけるNUMAの構造に配慮して作成されていることがある。このため、ある情報処理装置では適切に動作していたアプリケーションでも、別の情報処理装置により実行すると、期待する性能を発揮できない、正しく動作しないなどの問題が生じ得る。別の情報処理装置への配備を見越して、アプリケーションを予め修正することも考えられるが、配備先の情報処理装置のNUMAの構造を、配備前に予め知ることは難しい。このため、アプリケーションの配備後に、ユーザは設定の修正作業を強いられることがあるという問題がある。 Different information processing apparatuses may have different NUMA structures (for example, the number of processors in one node and identification information allocated to processors on each node). An application executed by the information processing apparatus may be created in consideration of the NUMA structure of the information processing apparatus. For this reason, even if an application that has been operating properly in one information processing apparatus is executed by another information processing apparatus, problems such as inability to exhibit the expected performance or malfunction. Although it is conceivable to modify the application in advance in anticipation of deployment to another information processing apparatus, it is difficult to know the NUMA structure of the information processing apparatus at the deployment destination before deployment. For this reason, there is a problem that the user may be forced to correct the setting after the application is deployed.
1つの側面では、本発明は、アプリケーションを変更することなしに、アプリケーションに割り当てるプロセッサの識別情報を変換可能にすることを目的とする。 In one aspect, an object of the present invention is to enable conversion of identification information of a processor assigned to an application without changing the application.
1つの態様では、変換プログラムが提供される。この変換プログラムは、複数のプロセッサを有するコンピュータに、第1のプロセッサの第1の識別情報を含む設定情報をアプリケーションから取得し、複数のプロセッサの配置および複数のプロセッサの利用状況に基づいて、アプリケーションに割り当てる第2のプロセッサの第2の識別情報を決定し、第1の識別情報と第2の識別情報とを対応付けた変換情報をコンピュータのオペレーティングシステムに通知する。 In one aspect, a conversion program is provided. This conversion program acquires setting information including first identification information of a first processor from an application to a computer having a plurality of processors, and based on the arrangement of the plurality of processors and the usage status of the plurality of processors, 2nd identification information of the 2nd processor allocated to 2 is determined, and the conversion information which matched 1st identification information and 2nd identification information is notified to the operating system of a computer.
また、1つの態様では、変換プログラムが提供される。この変換プログラムは、複数のプロセッサを有するコンピュータに、アプリケーションの設定情報に含まれる第1のプロセッサの第1の識別情報とアプリケーションに割り当てる第2のプロセッサの第2の識別情報とを対応付けた変換情報を取得し、変換情報に基づいて、第1の識別情報に代えて、第2の識別情報に対応する第2のプロセッサをアプリケーションに割り当てる。 In one aspect, a conversion program is provided. The conversion program converts a computer having a plurality of processors in association with the first identification information of the first processor included in the application setting information and the second identification information of the second processor to be assigned to the application. Information is acquired, and based on the conversion information, a second processor corresponding to the second identification information is assigned to the application instead of the first identification information.
また、1つの態様では、変換方法が提供される。この変換方法では、複数のプロセッサを有するコンピュータが、第1のプロセッサの第1の識別情報を含む設定情報をアプリケーションから取得し、複数のプロセッサの配置および複数のプロセッサの利用状況に基づいて、アプリケーションに割り当てる第2のプロセッサの第2の識別情報を決定し、第1の識別情報と第2の識別情報とを対応付けた変換情報をコンピュータのオペレーティングシステムに通知し、オペレーティングシステムにより、変換情報に基づいて、第1の識別情報に代えて、第2の識別情報に対応する第2のプロセッサをアプリケーションに割り当てる。 In one aspect, a conversion method is provided. In this conversion method, a computer having a plurality of processors acquires setting information including the first identification information of the first processor from the application, and based on the arrangement of the plurality of processors and the usage status of the plurality of processors, the application 2nd identification information of the 2nd processor assigned to 2 is determined, the conversion information which matched the 1st identification information and the 2nd identification information is notified to the operating system of a computer, and it is converted into conversion information by an operating system. Based on this, instead of the first identification information, the second processor corresponding to the second identification information is assigned to the application.
1つの側面では、アプリケーションを変更することなしに、アプリケーションに割り当てるプロセッサの識別情報を変換できる。 In one aspect, processor identification information assigned to an application can be converted without changing the application.
以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
図1は、第1の実施の形態の情報処理装置を示す図である。情報処理装置10は、複数のプロセッサおよび複数のメモリを有する。ここで、メモリは、例えばRAM(Random Access Memory)である。プロセッサは、例えばCPUである。プロセッサは、複数のプロセッサの集合(マルチプロセッサ)も含み得る。情報処理装置10は、コンピュータと呼ばれてもよい。プロセッサおよびメモリは、NUMAの技術を用いて実装されている。情報処理装置10は、ノード11,12を有する。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating the information processing apparatus according to the first embodiment. The information processing apparatus 10 includes a plurality of processors and a plurality of memories. Here, the memory is, for example, a RAM (Random Access Memory). The processor is, for example, a CPU. The processor may also include a set of multiple processors (multiprocessor). The information processing apparatus 10 may be called a computer. The processor and memory are implemented using NUMA technology. The information processing apparatus 10 includes
ノード11は、プロセッサ11a,11b,11c,11dおよびメモリ11eを有する。ノード12は、プロセッサ12a,12b,12c,12dおよびメモリ12eを有する。ノード11,12は、情報処理装置10のハードウェアである。また、ノード11,12は、NUMAノードと呼ばれてもよい。
The
ここで、プロセッサ11aの識別情報は“1”(ID(IDentifier)=1)である。プロセッサ11bの識別情報は“2”である。プロセッサ11cの識別情報は“3”である。プロセッサ11dの識別情報は“4”である。プロセッサ12aの識別情報は“5”である。プロセッサ12bの識別情報は“6”である。プロセッサ12cの識別情報は“7”である。プロセッサ12dの識別情報は“8”である。
Here, the identification information of the
情報処理装置10は、上記のハードウェアを用いて、オペレーティングシステム(OS:Operating System)15、変換部16およびアプリケーション17を実行する。OS15、変換部16およびアプリケーション17は、情報処理装置10のソフトウェアである。OS15は、情報処理装置10のOSであり、ノード11,12を用いて実行される。アプリケーション17は、ユーザの業務処理を実行する。
The information processing apparatus 10 executes an operating system (OS) 15, a
変換部16は、アプリケーション17へ割り当てるプロセッサの識別情報の変換を行うための変換情報を生成する。変換部16は、ノード11,12に属する何れかのプロセッサにより実行される。変換部16は、アプリケーション17の外部の機能(例えば、動的共有ライブラリやスケジューラなど)として実装される。変換部16は、アプリケーション17の実行に用いるプロセッサを決定するために次のような処理を実行する。
The
変換部16は、第1のプロセッサの第1の識別情報を含む設定情報D1をアプリケーション17から取得する。例えば、設定情報D1は、アプリケーション17の動作方法をチューニングするために、アプリケーション17に対して予め付与される情報である。例えば、設定情報D1は、第1のプロセッサの第1の識別情報として、プロセッサ11c,11d,12a,12bそれぞれのID=3,4,5,6を含む。
The
変換部16は、複数のプロセッサの配置および複数のプロセッサの利用状況に基づいて、アプリケーション17に割り当てる第2のプロセッサの第2の識別情報を決定する。例えば、変換部16は、ノード11,12における複数のプロセッサの配置に基づいて、同一のノードに属するプロセッサをアプリケーション17に割り当てるようにする。各プロセッサが共通のローカルメモリにアクセスした方が処理を高速化できるからである。また、変換部16は、ノード11の負荷およびノード12の負荷に偏りが生じないように、アプリケーション17にプロセッサを割り当てるようにする。
The
例えば、設定情報D1は、プロセッサのID=3,4,5,6を含む。ID=3,4で識別されるプロセッサ11c,11dは、ノード11に属する。ID=5,6で識別されるプロセッサ12a,12bは、ノード12に属する。プロセッサ11c,11d,12a,12bは、所属先がノード11,12に跨っている。このため、変換部16は、ノード11またはノード12の何れか一方から、プロセッサを割り当てるようにする。例えば、ノード12の負荷が、ノード11の負荷よりも大きい場合、変換部16は、ノード11に属するプロセッサ11a,11b,11c,11dをアプリケーション17に割り当てると決定する。この場合、第2の識別情報は、ID=1,2,3,4である。
For example, the setting information D1 includes processor IDs = 3, 4, 5, and 6. The
変換部16は、第1の識別情報と第2の識別情報とを対応付けた変換情報D2を情報処理装置10のOS15に通知する。上記の例では、第1の識別情報は、ID=3,4,5,6である。第2の識別情報は、ID=1,2,3,4である。すなわち、変換情報D2は、プロセッサのID=3,4,5,6を、ID=1,2,3,4に変換することを示す。
The
OS15は、変換部16から変換情報D2を取得する。OS15は、変換情報D2に基づいて、第1の識別情報に代えて、第2の識別情報に対応する第2のプロセッサをアプリケーション17に割り当てる。上記の例の場合、OS15は、プロセッサのID=3,4,5,6に代えて、ID=1,2,3,4に対応するプロセッサ11a,11b,11c,11dをアプリケーション17に割り当てる。
The
情報処理装置10によれば、アプリケーション17を変更することなしに、プロセッサの識別情報を変換できる。具体的には、変換部16は、アプリケーション17から取得した設定情報D1に基づいて、変換情報D2をOS15に通知する。このため、アプリケーション17側では設定情報D1の変更を意識しなくてもよい。
According to the information processing apparatus 10, the processor identification information can be converted without changing the
特に、NUMAを意識して作成されたアプリケーション17では、アプリケーション17の実行に用いるプロセッサの識別情報が予め定義されている。しかし、予め定義された識別情報が、実際に実行する情報処理装置10のNUMAの構造(NUMA構造)と必ずしも一致しているとは限らない。例えば、予め定義された識別情報のプロセッサが該当の情報処理装置上に存在しないこともある。また、予め定義された識別情報の組み合わせに対応するプロセッサ群が同一のノード上にない可能性もある。別の情報処理装置への配備を見越して、アプリケーションを予め修正することも考えられるが、配備先の情報処理装置のNUMAの構造を、配備前に予め知ることは難しい。このため、アプリケーションの配備後に、ユーザはアプリケーションに対する設定の修正作業を強いられることがあるという問題がある。
In particular, in the
変換部16は、情報処理装置10におけるNUMAの実装に応じて、アプリケーション17に割り当てるプロセッサを決定する。このため、情報処理装置10は、NUMAを意識して作成されたアプリケーション17に対して期待される性能を発揮させて、適切に動作させることができる。また、ユーザに対してアプリケーション17の変更作業を強いずに済み、ユーザの作業の負担を軽減できる。
The
次に、アプリケーションを実行するサーバコンピュータ(単に、サーバと称することがある)を例示して、上記の機能をより詳細に説明する。
[第2の実施の形態]
図2は、第2の実施の形態のサーバのハードウェア例を示す図である。サーバ100は、NUMAの技術によりCPUやRAMが実装されている。サーバ100は、ノード101,102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107を有する。各ユニットはサーバ100のバスに接続されている。
Next, the above function will be described in more detail by exemplifying a server computer (sometimes simply referred to as a server) that executes an application.
[Second Embodiment]
FIG. 2 is a diagram illustrating a hardware example of the server according to the second embodiment. The
ノード101は、CPU11p,12p,・・・およびRAM1mを有する。ノード102は、CPU21p,22p,・・・およびRAM2mを有する。ノード101,102は、NUMAノードと呼ばれてもよい。
The
CPU11p,12p,・・・およびCPU21p,22p,・・・は、サーバ100の演算装置である。
RAM1m,2mは、サーバ100の主記憶装置である。RAM1m,2mは、OSのプログラムやアプリケーションのプログラムの少なくとも一部を一時的に記憶する。また、RAM1mは、CPU11p,12p,・・・のローカルメモリである。RAM1mは、CPU21p,22p,・・・のリモートメモリである。RAM2mは、CPU21p,22p,・・・のローカルメモリである。RAM2mは、CPU11p,12p,・・・のリモートメモリである。サーバ100は、ノード101,102に加えて、更に1以上のノードを有してもよい。
The
HDD103は、サーバ100の補助記憶装置である。HDD103は、内蔵した磁気ディスクに対して、磁気的にデータの書き込みおよび読み出しを行う。HDD103は、OSのプログラム、アプリケーションのプログラム、および各種データを記憶する。サーバ100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の補助記憶装置を備えてもよく、複数の補助記憶装置を備えてもよい。
The
画像信号処理部104は、各CPUからの命令に従って、サーバ100に接続されたディスプレイ21に画像を出力する。ディスプレイ21としては、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。
The image
入力信号処理部105は、サーバ100に接続された入力デバイス22から入力信号を取得し、各CPUに出力する。入力デバイス22としては、例えば、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。
The input
媒体リーダ106は、記録媒体23に記録されたプログラムやデータを読み取る装置である。記録媒体23として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDD(Hard Disk Drive)などの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)を使用できる。また、記録媒体23として、例えば、フラッシュメモリカードなどの不揮発性の半導体メモリを使用することもできる。媒体リーダ106は、例えば、各CPUからの命令に従って、記録媒体23から読み取ったプログラムやデータをRAM1m,2mまたはHDD103に格納する。
The
通信インタフェース107は、ネットワーク24を介して他の装置と通信を行う。通信インタフェース107は、有線通信インタフェースでもよいし、無線通信インタフェースでもよい。
The
図3は、第2の実施の形態のソフトウェア例を示す図である。サーバ100は、記憶部110、OSカーネル120、CPU名変換部130およびアプリケーション140を有する。記憶部110は、RAM1m,2mまたはHDD103に確保された記憶領域として実現される。OSカーネル120およびCPU名変換部130は、RAM1m,2mに格納されたプログラムを、CPU11p,12p,・・・およびCPU21p,22p,・・・の少なくとも1つが実行することで実現される。アプリケーション140は、後述するように、可能な限り1つのノードに属するCPU群およびRAMを用いて実行される。
FIG. 3 is a diagram illustrating an example of software according to the second embodiment. The
記憶部110は、変換テーブル111を記憶する。変換テーブル111は、CPU名変換部130の処理に用いられるテーブルである。変換テーブル111は、変換元のCPU名と変換先のCPU名との対応関係が記録された情報である。例えば、ユーザは、変換テーブル111を予め作成して記憶部110に格納しておける。
The
ここで、CPU名は、CPUの識別情報に相当する。第2の実施の形態では、CPU名は、CPUの番号(CPU番号)である。CPU番号は、“0”を起点とした昇順の整数である。CPU番号は、CPUのファームウェアやOSにより、所定のアルゴリズムを用いて各CPUに付与される。すなわち、CPU番号の付与ルールは、サーバコンピュータに応じて異なることもある。例えば、所定数の連続の番号が同一ノードに属することもあるし、所定数の不連続の番号が同一ノードに属することもある。 Here, the CPU name corresponds to the identification information of the CPU. In the second embodiment, the CPU name is a CPU number (CPU number). The CPU number is an integer in ascending order starting from “0”. The CPU number is assigned to each CPU using a predetermined algorithm by the CPU firmware and OS. That is, the CPU number assignment rule may differ depending on the server computer. For example, a predetermined number of consecutive numbers may belong to the same node, or a predetermined number of discontinuous numbers may belong to the same node.
OSカーネル120は、サーバ100のOSのカーネルである。OSカーネル120は、サーバ100上で実行されるアプリケーション140に対してCPUを割り当てる。
CPU名変換部130は、アプリケーション140の起動時における所定のシステムコール(CPU設定用のシステムコール)を検出し、アプリケーション140からCPU番号の指定を受け付ける。CPU名変換部130は、記憶部110に記憶された変換テーブル111に基づいて、CPU番号を変換し、OSカーネル120に通知する。
The
The CPU
アプリケーション140は、ユーザの業務に関する処理を行うソフトウェアである。アプリケーション140は、NUMAを意識して作成されており、アプリケーション140の実行に用いるCPU番号が予め定義されている。ただし、予め定義されたCPU番号が必ずしも、実際に実行するサーバのNUMA構造と一致しているとは限らない。例えば、予め定義されたCPU番号が該当のサーバ上に存在しないこともあるし、予め定義されたCPU番号の組み合わせが同一ノード上にないこともある。なお、以下の説明では、「アプリケーション」を、「アプリ」と略記することがある。
The
図4は、第2の実施の形態の変換テーブルの例を示す図である。変換テーブル111は、記憶部110に格納される。変換テーブル111は、アプリ指定CPU番号および変換後CPU番号の項目を含む。
FIG. 4 is a diagram illustrating an example of a conversion table according to the second embodiment. The conversion table 111 is stored in the
アプリ指定CPU番号の項目には、アプリケーション140により指定されたCPU番号が登録される。変換後CPU番号の項目には、変換後のCPU番号が登録される。例えば、変換テーブル111には、アプリ指定CPU番号が“0”、変換後CPU番号が“2”という情報が登録される。これは、アプリケーション140によりCPU番号“0”が指定された場合、CPU番号“2”に変換することを示す。
In the application designation CPU number item, the CPU number designated by the
変換テーブル111には、他のCPU番号についても同様に、アプリ指定CPU番号と、CPU番号との組み合わせが予め登録される。特に、変換後のCPU番号の項目には、同一ノード上のCPUのCPU番号が予め登録される。 Similarly, the combination of the application designated CPU number and the CPU number is registered in advance in the conversion table 111 for other CPU numbers. In particular, the CPU number of the CPU on the same node is registered in advance in the item of the converted CPU number.
次に、サーバ100によるアプリ起動時の処理手順を説明する。
図5は、第2の実施の形態のアプリ起動例を示すフローチャートである。以下、図5に示す処理をステップ番号に沿って説明する。
Next, a processing procedure at the time of application activation by the
FIG. 5 is a flowchart illustrating an application activation example according to the second embodiment. Hereinafter, the process illustrated in FIG. 5 will be described in order of step number.
(S11)CPU名変換部130は、ユーザによるアプリ指定CPU番号と変換後CPU番号との組み合わせの入力を受け付け、変換テーブル111を作成する。CPU名変換部130は、作成した変換テーブル111を記憶部110に格納する。CPU名変換部130は、アプリケーション毎に変換テーブルを作成し、アプリケーションの識別情報に対応付けて、作成した変換テーブルを記憶部110に格納する。変換テーブル111は、アプリケーション140の識別情報に対応付けられる。
(S11) The CPU
(S12)CPU名変換部130は、アプリ起動時のCPU設定を行うシステムコールを検出する。例えば、CPU名変換部130は、アプリケーション140の起動時に、当該アプリケーション140の実行に用いるCPUを設定するためのシステムコールを検出する。
(S12) The CPU
(S13)CPU名変換部130は、システムコールをフックする。
(S14)CPU名変換部130は、記憶部110に記憶された変換テーブル111に基づいて、システムコールに含まれるCPU設定情報のCPU名を変換する。例えば、変換テーブル111は、アプリ指定CPU番号“0”を、変換後CPU番号“2”に変換する旨の情報を含む。このため、CPU名変換部130は、CPU設定情報に含まれるCPU番号“0”を、CPU番号“2”に変換する。CPU名変換部130は、CPU設定情報に含まれる他のCPU番号も、変換テーブル111に基づいて同様に変換する。
(S13) The CPU
(S14) The CPU
(S15)CPU名変換部130は、変換後のCPU名をOSに通知する。具体的には、CPU名変換部130は、ステップS14により変換したCPU設定情報を、OSカーネル120に通知する。OSカーネル120は、CPU名変換部130から受け付けたCPU設定情報に基づいて、アプリケーション140へのCPUの割り当てを行う。
(S15) The CPU
これにより、OSカーネル120は、同一ノード上のCPUを適切にアプリケーション140に割り当てることができる。
図6は、第2の実施の形態のCPU番号の変換例を示す図である。図6(A)は、アプリケーション140により複数ノードに跨るCPU番号が指定された場合を例示している。例えば、ノード101は、10個のCPUを含むCPU群P1を有するとする。CPU群P1に属するCPU番号は“0”〜“9”である(図中“0−9”と表記している。以下同様)。また、ノード102は、10個のCPUを含むCPU群P2を有するとする。CPU群P2に属するCPU番号は“10”〜“19”である。また、変換テーブル111には、CPU番号“8,9,10,11”それぞれを、CPU番号“4,5,6,7”に変換するよう定義されているものとする。
As a result, the
FIG. 6 is a diagram illustrating a conversion example of the CPU number according to the second embodiment. FIG. 6A illustrates a case where a CPU number that spans multiple nodes is designated by the
この場合、アプリケーション140が、起動時にCPU番号“8,9,10,11”の設定を含むシステムコールを発行したとする。CPU番号“8,9,10,11”に対応する4つのCPUのうち、CPU番号“8,9”のCPUは、ノード101に属する。CPU番号“10,11”のCPUは、ノード102に属する。
In this case, it is assumed that the
CPU名変換部130は、当該システムコールをフックし、変換テーブル111に基づいて、CPU番号“8,9,10,11”を、CPU番号“4,5,6,7”に変換する。CPU名変換部130は、当該変換後のCPU設定情報をOSカーネル120に通知する(図6では、OSカーネル120の図示を省略している)。OSカーネル120は、CPU名変換部130からの通知により、CPU番号“4,5,6,7”に対応する4つのCPUを、アプリケーション140に割り当てる。当該4つのCPUは、何れもノード101に属する。
The CPU
図6(B)は、ノード101上で、あるCPU(一例として、CPU番号“9”のCPU)で障害が発生している場合を例示している。この場合、サーバ100は、ノード101において、CPU番号“9”の利用を停止し、縮退運転を行う。変換テーブル111には、CPU番号“6,7,8,9”それぞれを、CPU番号“5,6,7,8”に変換するよう定義されているものとする。
FIG. 6B illustrates a case where a failure occurs in a certain CPU (a CPU having a CPU number “9” as an example) on the
このとき、アプリケーション140が、起動時にCPU番号“6,7,8,9”の設定を含むシステムコールを発行したとする。図6(B)の例では、CPU番号“9”は、障害により利用できない。CPU名変換部130は、当該システムコールをフックし、変換テーブル111に基づいて、CPU番号“6,7,8,9”を、CPU番号“5,6,7,8”に変換する。CPU名変換部130は、当該変換後のCPU設定情報をOSカーネル120に通知する。OSカーネル120は、CPU名変換部130からの通知により、CPU番号“5,6,7,8”に対応する4つのCPUを、アプリケーション140に割り当てる。当該4つのCPUは、何れもノード101に属する。
At this time, it is assumed that the
こうして、CPU名変換部130は、単一のノード101からアプリケーション140に割り当てるCPUを決定することで、アプリケーション140による処理性能の向上を図れ、アプリケーション140を適切に動作させることができる。
In this way, the CPU
上記のCPU名変換部130の機能は、アプリケーション140を実行するサーバのNUMA構成が変化し得る場合に有用である。
図7は、CPU番号の割り当ての比較例を示す図である。例えば、サーバ200は、CPU名変換部130の機能を有していない。サーバ200は、CPUとRAMとを備えるノード201、および、CPUとRAMとを備えるノード202を有している。ノード201,202は、それぞれ12個のCPUを有する。ノード201のCPU群P3に属するCPU番号は“0“〜“11”である。ノード202のCPU群P4に属するCPU番号は“12”〜“23”である。サーバ200上のアプリケーション240は、実行するCPUを固定する設定がなされており、CPU番号“8,9,10,11”が予め定義されている。
The function of the CPU
FIG. 7 is a diagram illustrating a comparative example of CPU number assignment. For example, the
例えば、アプリケーション240を別のサーバ300に移動して(配備先を変更して)動作させることを考える(図7(A)のケース)。サーバ300は、ノード301,302を有する。ノード301,302は、それぞれ10個のCPUを有する。ノード301のCPU群P5に属するCPU番号は“0”〜“9”である。ノード302のCPU群P6に属するCPU番号は“10”〜“19”である。
For example, consider moving the
一方、アプリケーション240では、CPU番号“8,9,10,11”が予め定義されている。サーバ300のOSカーネルがアプリケーション240の定義に従って割り当てるCPUを決定すると、アプリケーション240を実行するCPUがノード301,302に跨ることになる。前述のように、NUMAでは、リモートメモリにアクセスするよりも、ローカルメモリにアクセスする方が処理を高速化できる。逆にいえば、CPUがリモートメモリへアクセスする場合、期待する処理性能を発揮できないことになる。このため、アプリケーション240を実行する複数のCPUが複数のノードに跨ると、処理性能を十分に発揮できない。
On the other hand, in the
続いて、サーバ200でハードウェアエラーが発生し、CPU番号“9”のCPU(図中“CPU9”と表記)が縮退している場合を考える(図7(B)のケース)。この場合、サーバ200のOSカーネルは、アプリケーション240側のCPU番号“8,9,10,11”の指定に対して、CPU番号“9”のCPUの割り当てを行えない。このため、OSカーネルは、CPU番号“9”のCPUの代替となるCPUを任意に決定して、アプリケーション240に割り当てる。OSカーネルは、ノード202から代替のCPUを、アプリケーション240に割り当てることもある。この場合も、図7(A)と同様に、期待する処理性能を発揮できないことになる。
Next, consider a case where a hardware error has occurred in the
図7(A)および図7(B)で例示した各ケースの場合、ノード上のCPUの配置が変更されるたびに、ユーザにより、アプリケーション240によるCPUの指定を変更することも考えられる。しかし、このような作業をユーザに強いると、ユーザの作業負担が増す。
In each case illustrated in FIG. 7A and FIG. 7B, it is conceivable that the user changes the designation of the CPU by the
一方、サーバ100では、CPU名変換部130は、変換テーブル111に基づいて、サーバ100におけるNUMAの実装に応じて、アプリケーション140に割り当てるCPUを決定する。このため、サーバ100は、NUMAを意識して作成されたアプリケーション140に対して期待される性能を発揮させて、適切に動作させることができる。また、ユーザは、変換テーブル111の設定を行えばよく、アプリケーション140の変更を行わずに済む。ユーザに対してアプリケーション140の変更を強いずに済むので、ユーザによる作業の負担を軽減できる。
On the other hand, in the
[第3の実施の形態]
以下、第3の実施の形態を説明する。前述の第2の実施の形態と相違する事項を主に説明し、共通する事項の説明を省略する。
[Third Embodiment]
Hereinafter, a third embodiment will be described. Items that differ from the second embodiment described above will be mainly described, and descriptions of common items will be omitted.
第2の実施の形態では、サーバ100は、変換テーブル111に基づいて、アプリケーション140の起動時に、アプリケーション140に割り当てるCPUを決定するものとした。一方、アプリケーション140に割り当てるCPUを、起動時および起動後にも動的に変更することも考えられる。各ノードにおいて利用可能なCPUやCPUの負荷は運用に応じて変わり得るからである。そこで、第3の実施の形態では、アプリケーション140に割り当てるCPUを動的に変更する機能を提供する。
In the second embodiment, the
ここで、第3の実施の形態では、サーバ100に代えて、サーバ100aを用いる。サーバ100aのハードウェアは、図2で例示した第2の実施の形態のサーバ100と同様である。このため、サーバ100aのハードウェアを、サーバ100と同様の符号・名称を用いて指し示す。
Here, in the third embodiment, a server 100 a is used instead of the
図8は、第3の実施の形態のソフトウェア例を示す図である。サーバ100aは、記憶部110、OSカーネル120、アプリケーション140およびスケジューラ150を有する。記憶部110は、RAM1m,2mまたはHDD103に確保された記憶領域として実現される。OSカーネル120およびスケジューラ150は、RAM1m,2mに格納されたプログラムを、CPU11p,12p,・・・およびCPU21p,22p,・・・の少なくとも1つが実行することで実現される。アプリケーション140は、後述するように、可能な限り1つのノードに属するCPU群およびRAMを用いて実行される。
FIG. 8 is a diagram illustrating an example of software according to the third embodiment. The server 100a includes a
サーバ100aは、変換テーブル111に代えてプロセステーブル112を記憶部110に格納する点がサーバ100と異なる。また、サーバ100aは、CPU名変換部130に代えてスケジューラ150を有する点がサーバ100と異なる。また、記憶部110は、サーバ100aが有するCPUのCPU番号、および、CPU番号と当該CPU番号に対応するCPUが属するノードとの対応関係を示すCPUの構成情報を記憶する。
The server 100 a is different from the
プロセステーブル112は、スケジューラ150によるCPU番号の変換対象とするプロセスを識別するための情報を記録したテーブルである。プロセステーブル112は、スケジューラ150により作成され、記憶部110に格納される。
The process table 112 is a table in which information for identifying a process to be converted into a CPU number by the
スケジューラ150は、アプリケーション140のプロセスに対して、CPU番号の再設定を行う。スケジューラ150は、各CPUのノード上の配置および各CPUの利用状況に基づいて、アプリケーション140に割り当てるCPUのCPU番号を決定する。スケジューラ150は、決定したCPU番号をOSカーネル120に通知する。
The
また、スケジューラ150は、CPUの構成情報、各アプリケーションの現在のCPU割り当て状況、および、各ノードにおけるCPUおよびRAMの負荷に関する情報を収集し、記憶部110に格納する。
In addition, the
OSカーネル120は、スケジューラ150から通知されたCPU番号に基づいて、アプリケーション140にCPUを割り当てる。
図9は、第3の実施の形態のプロセステーブルの例を示す図である。プロセステーブル112は、記憶部110に格納される。プロセステーブル112は、プロセスIDおよび指定CPU番号の項目を含む。
The
FIG. 9 illustrates an example of a process table according to the third embodiment. The process table 112 is stored in the
プロセスIDの項目には、アプリケーション140のプロセスのプロセスIDが登録される。指定CPU番号の項目には、アプリケーション140により指定されたCPU番号が登録される。例えば、プロセステーブル112には、プロセスIDが“10203”、指定CPU番号が“0,1”という情報が登録されている。これは、プロセスID“10203”のプロセスに対応するアプリケーション140により指定されたCPU番号が“0,1”であることを示す。
In the process ID item, the process ID of the process of the
次に、サーバ100aによるアプリ起動時の処理手順を説明する。
図10は、第3の実施の形態のアプリ起動例を示すフローチャートである。以下、図10に示す処理をステップ番号に沿って説明する。
Next, a processing procedure at the time of application activation by the server 100a will be described.
FIG. 10 is a flowchart illustrating an application activation example according to the third embodiment. In the following, the process illustrated in FIG. 10 will be described in order of step number.
(S21)スケジューラ150は、アプリ起動時にCPU情報を取得する。例えば、サーバ100aは、アプリケーション140を起動する際、次のような起動コマンドを用いてアプリケーション140を起動することができる。
(S21) The
“#set−cpu−run −cpu <cpu名リスト> コマンド”
ここで、“<cpu名リスト>”の箇所は、指定CPU番号のリストが挿入される。また、“コマンド”の箇所は、アプリケーション140を起動するための任意のコマンドが挿入される。スケジューラ150は、上記の起動コマンドにより入力された指定CPU番号のリストを取得する。
"# Set-cpu-run-cpu <cpu name list>command"
Here, a list of designated CPU numbers is inserted in the place of “<cpu name list>”. In addition, an arbitrary command for starting the
(S22)スケジューラ150は、アプリケーション140のプロセスIDに対して、ステップS21で取得したCPU情報(すなわち、指定CPU番号のリスト)を記録する。例えば、スケジューラ150は、アプリケーション140のプロセスID“10203”に対して、指定CPU番号“0,1”を、記憶部110に記憶されたプロセステーブル112に登録する。なお、OSカーネル120は、アプリケーション140の起動後、内部論理にしたがってアプリケーション140に割り当てるCPUの設定を行う。
(S22) The
(S23)スケジューラ150は、各ノードに対するCPUの配置状況やサーバ100aの各ノードのCPU負荷の監視に応じて、アプリケーション140に対して割り当てるCPUの再設定を行う。スケジューラ150は、CPUの再設定の結果をOSカーネル120に通知する。ステップS23の処理の詳細は後述される。
(S23) The
OSカーネル120は、スケジューラ150から受け付けたCPUの再設定の結果に基づいて、アプリケーション140に対するCPUの割り当てを変更する。
図11は、第3の実施の形態のCPU再設定例を示すフローチャートである。以下、図11に示す処理をステップ番号に沿って説明する。以下の手順は、図10のステップS23に相当する。
The
FIG. 11 is a flowchart illustrating an example of CPU resetting according to the third embodiment. In the following, the process illustrated in FIG. 11 will be described in order of step number. The following procedure corresponds to step S23 in FIG.
(S31)スケジューラ150は、ホスト情報を取得する。ホスト情報は、サーバ100aの負荷に関する情報を含む。また、ホスト情報は、サーバ100aにおけるCPUの構成情報(各CPUが何れのノードに属しているか)を示す情報を含む。更に、ホスト情報は、各アプリケーションに対して現在割り当てられているCPUのCPU番号の情報を含む。
(S31) The
(S32)スケジューラ150は、プロセステーブル112に記録された全てのプロセスを確認済であるか否かを判定する。全てのプロセスを確認済である場合、処理を終了する(次にCPU再設定を行うタイミングまで待機する)。全てのプロセスを確認済でない場合、処理をステップS33に進める。
(S32) The
(S33)スケジューラ150は、プロセステーブル112からプロセス(プロセスID)を1つ選択する。
(S34)スケジューラ150は、ステップS33で選択したプロセスに割り当てられたCPUとホスト情報とを照会する。例えば、スケジューラ150は、該当のプロセスに割り当てられたCPUのCPU番号をOSカーネル120に問い合わせることで、該当のプロセスに割り当てられたCPUを照会できる。また、スケジューラ150は、ホスト情報を照会することで、各CPUの負荷を把握する。
(S33) The
(S34) The
(S35)スケジューラ150は、アプリケーション140に対するCPU番号の変換先を変更し、変更結果をOSカーネル120に通知する。ステップS35の処理の詳細は後述される。
(S35) The
なお、スケジューラ150は、上記のステップS31〜S35の手順を定期的に(所定の周期で)実行してもよい。
図12は、第3の実施の形態のCPU割り当て変更例を示すフローチャートである。以下、図12に示す処理をステップ番号に沿って説明する。以下の手順は、図11のステップS35に相当する。
In addition, the
FIG. 12 is a flowchart illustrating an example of CPU allocation change according to the third embodiment. In the following, the process illustrated in FIG. 12 will be described in order of step number. The following procedure corresponds to step S35 in FIG.
(S41)スケジューラ150は、アプリ指定のCPUが存在するか否かを判定する。アプリ指定のCPUが存在する場合、処理をステップS42に進める。アプリ指定のCPUが存在しない場合、処理をステップS44に進める。ここで、スケジューラ150は、プロセステーブル112およびサーバ100aにおけるCPUの構成情報(CPU番号やCPU番号のノードへの所属を示す情報)を照合することで、アプリ指定のCPUが存在するか否かを判定する。前述のように、CPUの構成情報は、スケジューラ150により収集されて、記憶部110に格納される。スケジューラ150は、アプリケーション140のプロセスIDに対応する指定CPU番号をプロセステーブル112上で特定することで、アプリ指定のCPUのCPU番号を取得できる。アプリ指定のCPUが複数の場合、スケジューラ150は、全てのCPUがサーバ100a上に存在する場合に、処理をステップS42に進める。一方、スケジューラ150は、少なくとも1つのCPUがサーバ100a上に存在しない場合に、処理をステップS44に進める。
(S41) The
(S42)スケジューラ150は、アプリ指定の全CPUが同一ノード上にあるか否かを判定する。全CPUが同一ノード上にある場合、処理をステップS43に進める。全CPUが同一ノード上にない場合、処理をステップS44に進める。例えば、スケジューラ150は、前述のCPUの構成情報に基づいて、アプリ指定の全CPUが同一ノード上にあるか否かを判定することができる。
(S42) The
(S43)スケジューラ150は、アプリ指定のCPUのうち、何れかのCPUが高負荷であるか否かを判定する。アプリ指定のCPUのうち、何れかのCPUが高負荷である場合、処理をステップS46に進める。アプリ指定の何れのCPUも高負荷でない場合、処理を終了する。後者の場合、CPU番号の変換を行わない。すなわち、OSカーネル120は、アプリケーション140から指定されたCPU群をそのままアプリケーション140に割り当てることになる。ここで、スケジューラ150は、例えば、CPUのビジー率が所定の閾値を超過しているか否かに応じて、該当のCPUが高負荷であるか否かを判定できる。CPUのビジー率が閾値を超過している場合、該当のCPUは高負荷である。CPUのビジー率が閾値を超過していない場合、該当のCPUは高負荷でない。
(S43) The
(S44)スケジューラ150は、アプリケーション140が所要するCPU数を供給できるノードがあるか否かを判定する。アプリケーション140が所要するCPU数を供給できるノードがない場合、処理をステップS45に進める。アプリケーション140が所要するCPU数を供給できるノードがある場合、処理をステップS46に進める。ここで、スケジューラ150は、アプリケーション140のプロセスIDに対応する指定CPU番号の数をプロセステーブル112上でカウントすることで、アプリケーション140が所要するCPU数を取得できる。また、各ノードが有するCPU数は、記憶部110に記憶されたCPUの構成情報から取得できる。所要するCPU数のCPUを含むノードが、アプリケーション140が所要するCPU数を提供できるノードである。
(S44) The
(S45)スケジューラ150は、ホスト上(すなわち、サーバ100a上)のCPU一覧を取得する。CPU一覧は、CPU番号のリストである。そして、処理をステップS48に進める。
(S45) The
(S46)スケジューラ150は、サーバ100aのノード101,102のうち、CPU/RAMに空きのあるノードを選択する。例えば、スケジューラ150は、何れのアプリケーションの実行にも使用されていないCPUおよびRAMをもつノードを選択する。また、例えば、スケジューラ150は、CPUおよびRAMの負荷が所定の閾値よりも低いノードを選択してもよい。選択対象として複数のノードが候補になるなら、スケジューラ150は、複数の候補ノードのうち、CPUおよびRAMの負荷が最も低いノードを選択してもよい。CPUの負荷としては前述のビジー率が考えられる。RAMの負荷としては、RAMの記憶領域の使用率が考えられる。スケジューラ150は、CPUのビジー率およびRAMの使用率それぞれに重み付けして加算することで、ノード単位の負荷を評価してもよい。例えば、スケジューラ150は、ノード単位の負荷が最小のノードを割り当てるCPUの選択に用いるノードと決定してもよい。
(S46) The
(S47)スケジューラ150は、ステップS46で選択したノード上のCPU一覧を取得する。そして、処理をステップS48に進める。
(S48)スケジューラ150は、取得したCPU一覧のCPU番号を、当該CPU番号に対応するCPUの負荷の低い順にソートする。
(S47) The
(S48) The
(S49)スケジューラ150は、ソート結果に基づいて、負荷の低いCPUのCPU番号を選択する。例えば、スケジューラ150は、対応するCPUの負荷が小さい方から順番に、アプリケーション140が所要するCPU数の分だけ、アプリケーション140に割り当てるCPU番号を選択する。
(S49) The
(S50)スケジューラ150は、アプリケーション140に割り当てるCPU番号を、ステップS49で選択したCPU番号に変更する(変換先CPU番号を変更する)。スケジューラ150は、アプリケーション140のプロセスIDと、指定CPU番号と、変更後の変換先CPU番号とをOSカーネル120に通知する。
(S50) The
OSカーネル120は、スケジューラ150からの通知に応じて、アプリケーション140へのCPUの割り当てを変更する。
このように、スケジューラ150を用いて、アプリケーション140に対するCPUの割り当てを動的に変更することもできる。このとき、スケジューラ150は、同一ノード上にあるCPUを優先してアプリケーション140に割り当てるように変換先のCPU番号を決定する。これにより、NUMAを意識して作成されたアプリケーション140の処理性能を適切に発揮して、アプリケーション140を動作させることができる。
In response to the notification from the
As described above, the
また、スケジューラ150は、ノード単位の負荷に応じて、負荷が最小のノードを、アプリケーション140に割り当てるCPUの抽出対象とすることで、特定のノードに処理負荷が偏ることを防げる。更に、スケジューラ150は、同一ノード内において、負荷の低い方から順に、アプリケーション140により要求された数のCPUを選択することで、ノード内のCPUの負荷の平準化も図れる。これにより、サーバ100aにおけるリソース利用の効率化を図れる。その結果、サーバ100aで実行される複数のアプリケーションの処理を高速化できる。更に、ユーザに対してアプリケーション140の変更作業を強いずに済み、ユーザの作業の負担を軽減できる。
Further, the
[第4の実施の形態]
以下、第4の実施の形態を説明する。前述の第2,第3の実施の形態と相違する事項を主に説明し、共通する事項の説明を省略する。
[Fourth Embodiment]
Hereinafter, a fourth embodiment will be described. Items different from the second and third embodiments described above will be mainly described, and description of common items will be omitted.
第3の実施の形態では、スケジューラ150が、プロセスID毎に変換先のCPU番号を、OSカーネル120に通知するものとした。一方、OSカーネル120が内部にもつCPU番号の変換テーブルを外部から書き換えることで、OSカーネル120によるCPU番号の変換を制御することも考えられる。そこで、第4の実施の形態では、OSカーネル120内の変換テーブルを書き換える機能を提供する。
In the third embodiment, the
ここで、第4の実施の形態では、サーバ100aに代えて、サーバ100bを用いる。サーバ100bのハードウェアは、図2で例示した第2の実施の形態のサーバ100と同様である。このため、サーバ100bのハードウェアを、サーバ100と同様の符号・名称を用いて指し示す。
Here, in the fourth embodiment, a server 100b is used instead of the server 100a. The hardware of the server 100b is the same as that of the
図13は、第4の実施の形態のソフトウェア例を示す図である。サーバ100bは、記憶部110、OSカーネル120、アプリケーション140およびスケジューラ160を有する。記憶部110は、RAM1m,2mまたはHDD103に確保された記憶領域として実現される。OSカーネル120およびスケジューラ160は、RAM1m,2mに格納されたプログラムを、CPU11p,12p,・・・およびCPU21p,22p,・・・の少なくとも1つが実行することで実現される。アプリケーション140は、後述するように、可能な限り1つのノードに属するCPU群およびRAMを用いて実行される。
FIG. 13 is a diagram illustrating an example of software according to the fourth embodiment. The server 100b includes a
サーバ100bは、プロセステーブル112に加えて、変換テーブル113を記憶部110に格納する点がサーバ100aと異なる。また、サーバ100bは、スケジューラ150に代えてスケジューラ160を有する点がサーバ100aと異なる。
The server 100b is different from the server 100a in that the conversion table 113 is stored in the
変換テーブル113は、OSカーネル120によるCPU番号の変換に用いられる情報である。変換テーブル113は、スケジューラ160により作成され、記憶部110に格納される。
The conversion table 113 is information used for CPU number conversion by the
スケジューラ160は、アプリケーション140のプロセスに対して、CPU番号の再設定を行う。スケジューラ160は、各CPUのノード上の配置および各CPUの利用状況に基づいて、アプリケーション140に割り当てるCPUのCPU番号を決定する。スケジューラ160は、決定したCPU番号を、プロセスIDおよび変換元CPU番号(アプリケーション140により指定されたCPU番号)に対応付けて、変換テーブル113に登録する。
The
また、スケジューラ160は、CPUの構成情報、各アプリケーションの現在のCPU割り当て状況、および、各ノードにおけるCPUおよびRAMの負荷に関する情報を収集し、記憶部110、または、他の記憶部に格納する。
In addition, the
OSカーネル120は、記憶部110に記憶された変換テーブル113に基づいて、アプリケーション140にCPUを割り当てる。
図14は、第4の実施の形態の変換テーブルの例を示す図である。変換テーブル113は、記憶部110に格納される。変換テーブル113は、プロセスID、変換元CPU番号および変換先CPU番号の項目を含む。
The
FIG. 14 is a diagram illustrating an example of a conversion table according to the fourth embodiment. The conversion table 113 is stored in the
プロセスIDの項目には、アプリケーション140のプロセスのプロセスIDが登録される。変換元CPU番号の項目には、アプリケーション140により指定されたCPU番号が登録される。変換先CPU番号の項目には、変換元CPU番号に対する変換先のCPU番号が登録される。
In the process ID item, the process ID of the process of the
例えば、変換テーブル113には、プロセスIDが“10203”、変換元CPU番号が“0,1”、変換先CPU番号が“2,3”という情報が登録されている。これは、プロセスID“10203”のプロセスに対応するアプリケーション140により指定された変換元CPU番号が“0,1”であることを示す。また、変換先CPU番号が“2,3”であることを示す。すなわち、プロセスID“10203”に対して、変換先CPU番号“2,3”に対応するCPUを割り当てることを示す。変換テーブル113にプロセスIDを含めることで、サーバ100b上で実行されるアプリケーションが複数存在する場合でも、OSカーネル120は、CPU番号の変換対象とするアプリケーションを適切に識別することができる。
For example, information indicating that the process ID is “10203”, the conversion source CPU number is “0, 1”, and the conversion destination CPU number is “2, 3” is registered in the conversion table 113. This indicates that the conversion source CPU number designated by the
次に、サーバ100bによるアプリ起動時の処理手順を説明する。
図15は、第4の実施の形態のアプリ起動例を示すフローチャートである。以下、図15に示す処理をステップ番号に沿って説明する。
Next, a processing procedure at the time of application activation by the server 100b will be described.
FIG. 15 is a flowchart illustrating an application activation example according to the fourth embodiment. In the following, the process illustrated in FIG. 15 will be described in order of step number.
(S51)スケジューラ160は、アプリ起動時にCPU情報を取得する。例えば、第3の実施の形態と同様に、サーバ100bは、アプリケーション140を起動する際、次のような起動コマンドを用いてアプリケーション140を起動することができる。
(S51) The
“#set−cpu−run −cpu <cpu名リスト> コマンド”
スケジューラ160は、上記の起動コマンドにより入力された指定CPU番号のリストを取得する。
"# Set-cpu-run-cpu <cpu name list>command"
The
(S52)スケジューラ160は、アプリケーション140のプロセスIDに対して、ステップS51で取得したCPU情報(すなわち、指定CPU番号のリスト)を記録する。例えば、スケジューラ160は、アプリケーション140のプロセスID“10203”に対して、指定CPU番号“0,1”を、記憶部110に記憶されたプロセステーブル112に登録する。なお、OSカーネル120は、アプリケーション140の起動後、内部論理にしたがってアプリケーション140に割り当てるCPUの設定を行う。
(S52) The
(S53)スケジューラ160は、アプリケーション140について、OSカーネル120内に変換テーブル113を作成する。具体的には、スケジューラ160は、変換テーブル113を作成し、OSカーネル120およびスケジューラ160からアクセス可能な記憶部110に登録する。例えば、スケジューラ160は、変換テーブル113における変換元CPU番号の設定値を、プロセステーブル112の該当のプロセスIDに対応する指定CPU番号とする。また、スケジューラ160は、変換テーブル113における変換先CPU番号の初期設定値を、ステップS52でOSカーネル120によりアプリケーション140に割り当てられたCPUのCPU番号とすることが考えられる。
(S53) The
(S54)スケジューラ160は、図11および図12の手順により、アプリケーション140に割り当てるCPU番号の再設定を行う(CPU再設定)。ただし、スケジューラ160は、再設定の結果に応じて、ステップS53で作成した変換テーブル113の変換先CPU番号のエントリを更新する。OSカーネル120は、変換テーブル113に基づいて、アプリケーション140に対するCPUの割り当てを変更する。
(S54) The
なお、第3の実施の形態と同様に、スケジューラ160は、当該CPU再設定を、所定の周期で繰り返し実行する。
このように、スケジューラ160を用いて、アプリケーション140に対するCPUの割り当てを動的に変更することもできる。このとき、第3の実施の形態と同様に、スケジューラ160は、同一ノード上にあるCPUを優先してアプリケーション140に割り当てるように変換先のCPU番号を決定する。これにより、NUMAを意識して作成されたアプリケーション140の処理性能を適切に発揮して、アプリケーション140を動作させることができる。
Similar to the third embodiment, the
As described above, the
また、スケジューラ160は、ノード単位の負荷に応じて、負荷が最小のノードを、アプリケーション140に割り当てるCPUの抽出対象とすることで、特定のノードに処理負荷が偏ることを防げる。更に、スケジューラ160は、同一ノード内において、負荷の低い方から順に、アプリケーション140により要求された数のCPUを選択することで、ノード内のCPUの負荷の平準化も図れる。これにより、サーバ100bにおけるリソース利用の効率化を図れる。その結果、サーバ100bで実行される複数のアプリケーションの処理を高速化できる。更に、ユーザに対してアプリケーション140の変更作業を強いずに済み、ユーザの作業の負担を軽減できる。
Further, the
[第5の実施の形態]
以下、第5の実施の形態を説明する。前述の第2〜第4の実施の形態と相違する事項を主に説明し、共通する事項の説明を省略する。
[Fifth Embodiment]
Hereinafter, a fifth embodiment will be described. Items that are different from the second to fourth embodiments described above are mainly described, and descriptions of common items are omitted.
第2〜第4の実施の形態で例示した機能を、仮想マシンに適用することもできる。そこで、第5の実施の形態では、一例として、スケジューラ160の機能を仮想マシンに組み込む例を説明する。
The functions exemplified in the second to fourth embodiments can also be applied to a virtual machine. Therefore, in the fifth embodiment, an example in which the function of the
ここで、第5の実施の形態では、サーバ100bに代えて、サーバ100cを用いる。サーバ100cのハードウェアは、図2で例示した第2の実施の形態のサーバ100と同様である。このため、サーバ100cのハードウェアを、サーバ100と同様の符号・名称を用いて指し示す。
Here, in the fifth embodiment, a
サーバ100cは、1以上の仮想マシンを実行可能である。例えば、サーバ100cは、ハイパーバイザと呼ばれるソフトウェアにより、サーバ100cが有するCPUおよびRAMなどのリソースを、仮想マシンに割り当てる。例えば、ハイパーバイザは、CPUのリソースを時間軸上のタイムスロットで区切って、仮想マシンに割り当てる。仮想マシンに割り当てられるCPUのリソースの一単位を仮想CPU(vCPU:virtual CPU)と呼ぶことがある。仮想CPUも、仮想CPUのCPU番号により識別される。また、ハイパーバイザは、RAMの記憶領域の一部を仮想マシンに割り当てる。
The
図16は、第5の実施の形態のソフトウェア例を示す図である。サーバ100cは、仮想マシン170を有する。仮想マシン170は、サーバ100c上で動作する仮想マシンである。仮想マシン170は、記憶部171、OSカーネル172、アプリケーション173およびスケジューラ174を有する。
FIG. 16 is a diagram illustrating an example of software according to the fifth embodiment. The
記憶部171は、RAM1m,2mまたはHDD103において、仮想マシン170用に確保された記憶領域として実現される。OSカーネル172、アプリケーション173およびスケジューラ174は、RAM1m,2mに格納されたプログラムを、仮想マシン170に割り当てられた仮想CPUが実行することで実現される。
The
記憶部171は、プロセステーブル171aおよび変換テーブル171bを有する。プロセステーブル171aは、第4の実施の形態のプロセステーブル112に相当する。変換テーブル171bは、第4の実施の形態の変換テーブル113に相当する。ただし、プロセステーブル171aおよび変換テーブル171bに登録されるCPU番号は、仮想CPUのCPU番号である。
The
OSカーネル172は、仮想マシン170のOSのカーネルである。OSカーネル172は、仮想マシン170上で実行されるアプリケーション173に対して仮想CPUを割り当てる。OSカーネル172は、記憶部171に記憶された変換テーブル171bに基づいて、アプリケーション173に対する仮想CPUの割り当てを変更する。
The
アプリケーション173は、ユーザの業務に関する処理を行うソフトウェアである。アプリケーション173は、アプリケーション140と同様に、実行に用いるCPU番号が予め定義されている。
The
スケジューラ174は、アプリケーション173のプロセスに対して、CPU番号の再設定を行う。例えば、スケジューラ174は、各仮想CPUのノード上の配置および各仮想CPUの利用状況に基づいて、アプリケーション140に割り当てるCPUのCPU番号を決定する。ここで、例えば、スケジューラ174は、共通のノードに属する複数のCPUに対応する複数の仮想CPUを同一のノードに属する仮想CPUとして扱うことができる。スケジューラ174は、決定したCPU番号を、プロセスIDおよび変換元CPU番号(アプリケーション173により指定されたCPU番号)に対応付けて、変換テーブル171bに登録する。
The
また、スケジューラ174は、仮想CPUの構成情報、各アプリケーションの現在の仮想CPU割り当て状況、および、仮想マシン170における仮想CPUおよびRAMの負荷に関する情報を収集し、記憶部171、または、他の記憶部に格納する。ここで、仮想CPUの構成情報は、どの仮想CPUがどのノードに属しているかを示す情報である。
Also, the
ここで、スケジューラ174は、第4の実施の形態で例示したスケジューラ160と同様の方法で、アプリケーション173に割り当てる仮想CPUのCPU番号を決定することができる。例えば、スケジューラ160が実行する手順(図15および図11,図12に相当)において説明した「CPU」(物理CPU)を、仮想マシン170に割り当てられた「仮想CPU」と読み替えることができる。そして、スケジューラ160と同様の手順を、スケジューラ174により実行する。
Here, the
図17は、第5の実施の形態のCPU番号の変換例を示す図である。まず、アプリ指定のCPU番号が存在しない場合を考える(図17(A))。例えば、仮想マシン170に対する仮想CPU群P11は、8つの仮想CPUを含むとする。各仮想CPUのCPU番号は“0”〜“7”である。このとき、アプリケーション173が、CPU番号“8,9,10,11”を指定して起動したとする。ところが、仮想CPU群P11には、CPU番号“8,9,10,11”の仮想CPUは含まれていない。
FIG. 17 is a diagram illustrating an example of CPU number conversion according to the fifth embodiment. First, consider a case where there is no application-specified CPU number (FIG. 17A). For example, it is assumed that the virtual CPU group P11 for the
そこで、スケジューラ174は、アプリケーション173のプロセスIDに対して、変換元CPU番号“8,9,10,11”および変換先CPU番号“0,1,2,3”を変換テーブル171bに登録する。OSカーネル172は、変換テーブル171bに基づいて、アプリケーション173に対してCPU番号“0,1,2,3”に対応する仮想CPUを割り当てることができる。
Therefore, the
次に、アプリ指定のCPU番号が競合する場合を考える(図17(B))。例えば、仮想マシン170上で、アプリケーション173a,173bが実行されている。
アプリケーション173aは、CPU番号“0,1”を指定して動作するよう予め定義されている。また、アプリケーション173bも、CPU番号“0,1”を指定して動作するよう予め定義されている。すなわち、アプリケーション173a,173bが指定するCPU番号は何れも“0,1”で競合している。
Next, consider a case in which the application-specified CPU numbers conflict (FIG. 17B). For example,
The
この場合、スケジューラ174は、例えば、アプリケーション173aから要求されたCPU番号“0,1”をそのままOSカーネル172に通知する。OSカーネル172は、スケジューラ174からの通知に応じて、仮想CPU群P11に含まれる仮想CPUのうち、CPU番号“0,1”の仮想CPUを、アプリケーション173aに割り当てる。
In this case, for example, the
一方、スケジューラ174は、例えば、アプリケーション173bから要求されたCPU番号“0,1”を、空いているCPU番号“2,3”に変換するようOSカーネル172に通知する。具体的には、スケジューラ174は、アプリケーション173bのプロセスIDと、変換元CPU番号“0,1”と、変換先CPU番号“2,3”との対応関係を、変換テーブル171bに登録する。OSカーネル172は、変換テーブル171bに基づいて、アプリケーション173bに対してCPU番号“2,3”に対応する仮想CPUを割り当てることができる。
On the other hand, for example, the
図18は、仮想マシンにおけるCPU番号の割り当ての比較例を示す図である。図18では、スケジューラ174の機能を有していないサーバ400上の仮想マシン410を例示して、CPU番号の割り当ての比較例を説明する。サーバ400は、仮想マシン410に割り当てる仮想CPU群P21を有する。仮想CPU群P21には8つの仮想CPUが属しており、8つの仮想CPUのCPU番号は“0”〜“7”である。
FIG. 18 is a diagram illustrating a comparative example of CPU number assignment in a virtual machine. In FIG. 18, a
図18(A)は、アプリケーションにより要求されるCPU番号に対応する仮想CPUが仮想CPU群P21に含まれていない場合を例示している。例えば、アプリケーションはCPU番号“8”〜“11”を要求する。しかし、仮想CPU群P21は、CPU番号“8”〜“11”に対応する仮想CPUを含まない。仮想マシン410は、仮想CPUのCPU番号を変換する機能を有していない。したがって、OSカーネルは、当該アプリケーションに対して、要求されたCPU番号に対応する仮想CPUを適切に割り当てることができない。すなわち、要求されるCPU番号と提供するCPU番号とが不整合となり、アプリケーションの動作に影響が及ぶおそれがある。
FIG. 18A illustrates a case where a virtual CPU corresponding to a CPU number requested by an application is not included in the virtual CPU group P21. For example, the application requests CPU numbers “8” to “11”. However, the virtual CPU group P21 does not include virtual CPUs corresponding to the CPU numbers “8” to “11”. The
図18(B)は、2つのアプリケーションにより要求されるCPU番号が競合する場合を例示している。例えば、仮想マシン410で動作する2つのアプリケーションは、何れも、CPU番号“0,1”を要求する。仮想マシン410は、仮想CPUのCPU番号を変換する機能を有していない。したがって、OSカーネルは、2つのアプリケーションに対して、要求されたCPU番号に対応する仮想CPUを割り当てる。しかし、この場合、CPU番号“0,1”の仮想CPUが両アプリケーションに重複して割り当てられることになる。このため、当該仮想CPUの負荷が増大して、両アプリケーションの動作に影響が及ぶおそれがある。
FIG. 18B illustrates a case where CPU numbers requested by two applications conflict. For example, two applications running on the
一方、図17で例示したように、サーバ100cでは、スケジューラ174によりアプリケーションから要求されるCPU番号の変換テーブル171bを作成し、OSカーネル172により変換テーブル171bを基にCPU番号の変換を行う。このため、OSカーネル172は、仮想マシン170が有していないCPU番号に対応する仮想CPUをアプリケーションに提供することができる。また、OSカーネル172は、仮想CPUの負荷が偏らないように、複数のアプリケーションに対して仮想CPUを割り当てることができる。これにより、各アプリケーションを適切に動作させることができる。更に、ユーザに対してアプリケーションの変更作業を強いずに済み、ユーザの作業の負担を軽減できる。
On the other hand, as illustrated in FIG. 17, in the
なお、前述の第2の実施の形態の手法は、第3〜第5の実施の形態と組み合わせて利用されてもよい。例えば、サーバ100に、スケジューラ150またはスケジューラ160の機能を追加してもよい。そうすると、サーバ100は、アプリ起動時の最初の段階では、変換テーブル111に基づいてアプリケーション140に対する割り当てを行う。そして、サーバ100は、その後の運用に応じて、スケジューラ150またはスケジューラ160の機能により、アプリケーション140に割り当てるCPUのCPU番号を変更することもできる。
Note that the technique of the second embodiment described above may be used in combination with the third to fifth embodiments. For example, the function of the
また、第1の実施の形態の情報処理は、演算部1bにプログラムを実行させることで実現できる。また、第2〜第5の実施の形態の情報処理は、サーバ100,100a,100b,100cが備えるCPUにプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体23に記録できる。
The information processing according to the first embodiment can be realized by causing the computing unit 1b to execute a program. In addition, the information processing of the second to fifth embodiments can be realized by causing a CPU included in the
例えば、プログラムを記録した記録媒体23を配布することで、プログラムを流通させることができる。また、プログラムを他のコンピュータに格納しておき、ネットワーク経由でプログラムを配布してもよい。コンピュータは、例えば、記録媒体23に記録されたプログラムまたは他のコンピュータから受信したプログラムを、RAM1m,2mやHDD102などの記憶装置に格納し(インストールし)、当該記憶装置からプログラムを読み込んで実行してもよい。
For example, the program can be distributed by distributing the
10 情報処理装置
11,12 ノード
11a,11b,11c,11d,12a,12b,12c,12d プロセッサ
11e,12e メモリ
15 OS
16 変換部
17 アプリケーション
D1 設定情報
D2 変換情報
10
16
Claims (7)
第1のプロセッサの第1の識別情報を含む設定情報をアプリケーションから取得し、前記複数のプロセッサの配置および前記複数のプロセッサの利用状況に基づいて、前記アプリケーションに割り当てる第2のプロセッサの第2の識別情報を決定し、
前記第1の識別情報と前記第2の識別情報とを対応付けた変換情報を前記コンピュータのオペレーティングシステムに通知する、
処理を実行させる変換プログラム。 In a computer having a plurality of processors,
A setting information including the first identification information of the first processor is obtained from the application, and the second of the second processors to be assigned to the application based on the arrangement of the plurality of processors and the usage status of the plurality of processors Determine the identity,
Notifying the operating system of the computer of conversion information in which the first identification information and the second identification information are associated with each other;
Conversion program that executes processing.
アプリケーションの設定情報に含まれる第1のプロセッサの第1の識別情報と前記アプリケーションに割り当てる第2のプロセッサの第2の識別情報とを対応付けた変換情報を取得し、
前記変換情報に基づいて、前記第1の識別情報に代えて、前記第2の識別情報に対応する前記第2のプロセッサを前記アプリケーションに割り当てる、
処理を実行させる変換プログラム。 In a computer having a plurality of processors,
Obtaining conversion information in which the first identification information of the first processor included in the setting information of the application is associated with the second identification information of the second processor assigned to the application;
Based on the conversion information, instead of the first identification information, the second processor corresponding to the second identification information is allocated to the application.
Conversion program that executes processing.
第1のプロセッサの第1の識別情報を含む設定情報をアプリケーションから取得し、前記複数のプロセッサの配置および前記複数のプロセッサの利用状況に基づいて、前記アプリケーションに割り当てる第2のプロセッサの第2の識別情報を決定し、
前記第1の識別情報と前記第2の識別情報とを対応付けた変換情報を前記コンピュータのオペレーティングシステムに通知し、
前記オペレーティングシステムにより、前記変換情報に基づいて、前記第1の識別情報に代えて、前記第2の識別情報に対応する前記第2のプロセッサを前記アプリケーションに割り当てる、
変換方法。 A computer having a plurality of processors
A setting information including the first identification information of the first processor is obtained from the application, and the second of the second processors to be assigned to the application based on the arrangement of the plurality of processors and the usage status of the plurality of processors Determine the identity,
Notifying the operating system of the computer of conversion information that associates the first identification information with the second identification information;
The operating system assigns the second processor corresponding to the second identification information to the application instead of the first identification information based on the conversion information.
Conversion method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016159801A JP2018028769A (en) | 2016-08-17 | 2016-08-17 | Conversion program and conversion method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016159801A JP2018028769A (en) | 2016-08-17 | 2016-08-17 | Conversion program and conversion method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2018028769A true JP2018028769A (en) | 2018-02-22 |
Family
ID=61249121
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016159801A Pending JP2018028769A (en) | 2016-08-17 | 2016-08-17 | Conversion program and conversion method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2018028769A (en) |
-
2016
- 2016-08-17 JP JP2016159801A patent/JP2018028769A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200401437A1 (en) | Methods and apparatus to manage virtual machines | |
US10404614B2 (en) | Multi-cloud resource allocation | |
US10942760B2 (en) | Predictive rightsizing for virtual machines in cloud computing systems | |
US10977086B2 (en) | Workload placement and balancing within a containerized infrastructure | |
JP5577412B2 (en) | Computer system, migration method and management server | |
JP4980792B2 (en) | Virtual machine performance monitoring method and apparatus using the method | |
JP5400482B2 (en) | Management computer, resource management method, resource management program, recording medium, and information processing system | |
US9397953B2 (en) | Operation managing method for computer system, computer system and computer-readable storage medium having program thereon | |
KR102419704B1 (en) | Security protection methods and devices | |
JPWO2018002991A1 (en) | Control device, VNF placement destination selection method, and program | |
JP2021048513A (en) | Information processing device, information processing method, and virtual machine connection management program | |
JP2016170669A (en) | Load distribution function deployment method, load distribution function deployment device, and load distribution function deployment program | |
JPWO2017183565A1 (en) | Network system, patch file application method, and program | |
JPWO2014147802A1 (en) | Information processing apparatus, resource allocation method, and program | |
JP2019061359A (en) | Program and information processing device | |
CN107528871B (en) | Data analysis in storage systems | |
JP2011192049A (en) | Virtual machine system, automatic migration method, and automatic migration program | |
JP5597293B2 (en) | Computer system and program | |
JP6666553B2 (en) | Information processing apparatus, job management method, and job management program | |
CN112631994A (en) | Data migration method and system | |
US10097431B1 (en) | Routing to tenant services utilizing a service directory | |
WO2015161804A1 (en) | Cache partitioning method and device | |
JP2018028769A (en) | Conversion program and conversion method | |
KR102014246B1 (en) | Mesos process apparatus for unified management of resource and method for the same | |
JP2012181673A (en) | Resource allocation device, resource allocation method, and program |