Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5847746B2 - CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program - Google Patents
[go: Go Back, main page]

JP5847746B2 - CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program - Google Patents

CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program Download PDF

Info

Publication number
JP5847746B2
JP5847746B2 JP2013037094A JP2013037094A JP5847746B2 JP 5847746 B2 JP5847746 B2 JP 5847746B2 JP 2013037094 A JP2013037094 A JP 2013037094A JP 2013037094 A JP2013037094 A JP 2013037094A JP 5847746 B2 JP5847746 B2 JP 5847746B2
Authority
JP
Japan
Prior art keywords
thread
usage rate
cpu usage
group
bundle
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.)
Expired - Fee Related
Application number
JP2013037094A
Other languages
Japanese (ja)
Other versions
JP2014164662A (en
Inventor
幸生 小池
幸生 小池
裕士 黒田
裕士 黒田
大司 矢原
大司 矢原
箕浦 大祐
大祐 箕浦
佐藤 敦
敦 佐藤
理 塩野入
理 塩野入
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Inc
NTT Inc USA
Original Assignee
Nippon Telegraph and Telephone Corp
NTT Inc USA
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp, NTT Inc USA filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2013037094A priority Critical patent/JP5847746B2/en
Publication of JP2014164662A publication Critical patent/JP2014164662A/en
Application granted granted Critical
Publication of JP5847746B2 publication Critical patent/JP5847746B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、CPU使用率を制御する技術に関する。   The present invention relates to a technique for controlling a CPU usage rate.

コンピュータにおいて、OS上で単一プロセスとして動作するソフトウェアプログラム実行環境と、その実行環境上で動作する複数のソフトウェアプログラムとを具備することができる。例えば、そのような実行環境としてはJava(登録商標)VMがあり、ソフトウェアプログラムとしてはOSGiバンドルがある。   The computer can include a software program execution environment that operates as a single process on the OS, and a plurality of software programs that operate on the execution environment. For example, there is a Java (registered trademark) VM as such an execution environment, and an OSGi bundle as a software program.

JavaVM(Java Virtual Machine)は、OSから見て単一のプロセスで動作し、そのJavaVM上で動作するソフトウェアプログラムは、複数のJavaスレッドを生成可能であり、JavaVMによって時間並列的に複数の処理を実行することができる。   A Java VM (Java Virtual Machine) operates as a single process as viewed from the OS, and a software program operating on the Java VM can generate a plurality of Java threads, and a Java VM performs a plurality of processes in a time-parallel manner. Can be executed.

また、OSGi(Open Service Gateway initiative)とは、あるソフトウェアプログラムを複数のJavaソフトウェアモジュールで構成するための技術である(非特許文献1)。1つのJavaVM上でOSGiFW(OSGi Framework)を動作させ、当該OSGiFW上で複数のOSGiバンドル(以下、バンドル)を動作させることができる。このバンドルは、OSGiFWの動作中にインストール・アンインストール、スタート・ストップを動的に実行できる。   OSGi (Open Service Gateway initiative) is a technique for configuring a software program with a plurality of Java software modules (Non-patent Document 1). An OSGiFW (OSGi Framework) can be operated on one JavaVM, and a plurality of OSGi bundles (hereinafter referred to as bundles) can be operated on the OSGiFW. This bundle can dynamically execute installation / uninstallation and start / stop during the operation of OSGiFW.

ここで、エンドユーザ又はソフトウェアプログラム実行環境の運用者は、特定のバンドルを確実に動作させたい場合がある。例えば、他のバンドルの動作負荷状況に関わらず、重要なバンドルの動作を保証したい等である。具体的には、CPU負荷の高いゲーム用のアプリケーション動作時にも緊急地震速報計算を1秒以内に完了させたい場合や、作りの悪いアプリケーションによる無限ループ時によるCPU負荷増大時にも管理用Web画面を2秒以内に表示させたい場合である。   Here, the end user or the operator of the software program execution environment may want to operate a specific bundle with certainty. For example, it is desirable to guarantee the operation of an important bundle regardless of the operation load status of other bundles. Specifically, if you want to complete the earthquake early warning calculation within 1 second even when an application for a game with a high CPU load is operating, or when the CPU load increases due to an infinite loop caused by a poorly created application, the management Web screen is displayed. This is when you want to display within 2 seconds.

そのため、バンドル単位でCPU使用率を最低保証したいことが考えられる。その場合、Javaアプリケーションプログラムインタフェースの仕様書に定められたJavaスレッドの優先度変更方法を用いることが考えられる(非特許文献2)。   For this reason, it is conceivable that the CPU usage rate should be guaranteed at the minimum for each bundle. In that case, it is conceivable to use a Java thread priority changing method defined in the specification of the Java application program interface (Non-patent Document 2).

“OSGi Specifications”、OSGi Alliance、<URL: http://www.osgi.org/Download/File?url=/download/r5/osgi.core-5.0.0.pdf>“OSGi Specifications”, OSGi Alliance, <URL: http://www.osgi.org/Download/File?url=/download/r5/osgi.core-5.0.0.pdf> “クラス Thread、 java.land.Thread.setPriority(int)”、Java 2 Platform Std. Ed v1.4.0、<URL: http://docs.oracle.com/javase/jp/1.4/api/java/lang/Thread.html#setPriority(int)>“Class Thread, java.land.Thread.setPriority (int)”, Java 2 Platform Std. Ed v1.4.0, <URL: http://docs.oracle.com/javase/jp/1.4/api/java/lang /Thread.html#setPriority (int)>

しかしながら、そのような既存方法を利用しても、以下の理由から特定のバンドルの動作を確実に保証することは困難であった。   However, even if such an existing method is used, it is difficult to reliably guarantee the operation of a specific bundle for the following reasons.

(1)既存の優先度変更方法では、実際の動作が規定されていない。 (1) In the existing priority changing method, the actual operation is not defined.

(2)既存の優先度変更はバンドル自身が行うため、バンドルの作成者であるエンドユーザの思惑とソフトウェアプログラム実行環境の運用者の思惑とが異なる場合がある。つまり、その優先度変更を外部から制御できず、外部制御するにはバンドルをそれぞれ改修する必要があるため、とても対応しきれるものではない。 (2) Since the existing priority change is performed by the bundle itself, the speculation of the end user who is the creator of the bundle may differ from the speculation of the operator of the software program execution environment. In other words, the priority change cannot be controlled from the outside, and it is necessary to modify each bundle for external control.

(3)既存の優先度変更方法では、全体を総合的に俯瞰し、優先度の設定を制限する仕組みが定められていない。そのため、例えば全てのJavaスレッドに最高の優先度を設定してしまい、実質的に何の意味もなさない場合がある。 (3) The existing priority changing method does not define a mechanism for comprehensively overlooking the whole and restricting priority setting. For this reason, for example, the highest priority may be set for all Java threads, which may not have any meaning.

(4)ソフトウェアプログラム実行環境のJavaスレッドがバンドルを動作させる場合もあり、また、1つのバンドルが複数のJavaスレッドを動作させる場合もある。すなわち、必ずしも1つのバンドルに対し1つのJavaスレッドが存在するわけではなく、Javaスレッド単位での優先度設定はバンドル単位で優先度を設定することができない。 (4) A Java thread in the software program execution environment may operate a bundle, or a single bundle may operate a plurality of Java threads. That is, one Java thread does not necessarily exist for one bundle, and priority setting in Java thread units cannot be set in bundle units.

本発明は、上記事情を鑑みてなされたものであり、ソフトウェアプログラム単位でCPU使用率を保証することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to guarantee a CPU usage rate in software program units.

請求項1記載のCPU使用率制御装置は、単一プロセスの実行環境上で動作するソフトウェアプログラムのCPU使用率を制御するCPU使用率制御装置において、前記ソフトウェアプログラムを実行するために前記実行環境レイヤの第1スレッドを生成し、前記ソフトウェアプログラムを前記第1スレッドとして起動する起動手段と、前記第1スレッドが生成される毎に、OSレイヤの第2スレッドを生成して当該第1スレッドに1対1で対応付ける対応付け手段と、前記第2スレッドをソフトウェアプログラム毎のグループにまとめてグループ情報として記憶手段に記憶するグループ化手段と、各グループに対するCPU使用率の指定値の入力を受け付ける入力手段と、前記記憶手段からグループ情報を読み出して、各グループに対する前記CPU使用率の指定値に基づいて各グループに属する前記第2スレッドのCPU使用率を計算し、前記第2スレッドに対してCPU使用率を制御する制御手段と、を有することを要旨とする。 The CPU usage rate control device according to claim 1, wherein the CPU usage rate control device controls the CPU usage rate of a software program operating on an execution environment of a single process, and the execution environment layer is used to execute the software program. Generating a first thread and starting means for starting the software program as the first thread, and each time the first thread is generated, a second thread of the OS layer is generated and 1 is assigned to the first thread. Corresponding means for associating with each other, grouping means for grouping the second threads into groups for each software program and storing them in the storage means as group information, and input means for receiving input of a specified value of the CPU usage rate for each group If, reads the group information from the storage unit, for each group The serial CPU usage the CPU usage rate of the second thread belonging to each group based on the specified value of the calculated and summarized in that and a control means for controlling the CPU usage rate to the second thread .

請求項2記載のCPU使用率制御装置は、請求項1記載のCPU使用率制御装置において、前記実行環境は、JavaVirtualMachineであって、前記グループ化手段は、前記JavaVirtualMachine上で動作するソフトウェアプログラム以外のソフトウェアプログラムに係る前記第2スレッドを特定のグループで管理することを要旨とする。   The CPU usage rate control device according to claim 2 is the CPU usage rate control device according to claim 1, wherein the execution environment is Java Virtual Machine, and the grouping means is a software program other than a software program operating on the Java Virtual Machine. The gist is to manage the second thread related to the software program in a specific group.

請求項記載のCPU使用率制御装置は、請求項1又は2記載のCPU使用率制御装置において、自身を呼び出した前記第1スレッドに対応する前記第2スレッドの所属グループを他のグループに切り換える切替手段を更に有することを要旨とする。 CPU usage control apparatus according to claim 3, wherein, in the CPU utilization rate control apparatus according to claim 1 or 2, wherein switching the belonging group of the second thread corresponding to the first thread that calls itself to other groups The gist is to further include a switching means.

請求項記載のCPU使用率制御方法は、単一プロセスの実行環境上で動作するソフトウェアプログラムのCPU使用率を制御するCPU使用率制御方法において、コンピュータにより、前記ソフトウェアプログラムを実行するために前記実行環境レイヤの第1スレッドを生成し、前記ソフトウェアプログラムを前記第1スレッドとして起動する起動ステップと、前記第1スレッドが生成される毎に、OSレイヤの第2スレッドを生成して当該第1スレッドに1対1で対応付ける対応付けステップと、前記第2スレッドをソフトウェアプログラム毎のグループにまとめてグループ情報として記憶手段に記憶するグループ化ステップと、各グループに対するCPU使用率の指定値の入力を受け付ける入力ステップと、前記記憶手段からグループ情報を読み出して、各グループに対する前記CPU使用率の指定値に基づいて各グループに属する前記第2スレッドのCPU使用率を計算し、前記第2スレッドに対してCPU使用率を制御する制御ステップと、を有することを要旨とする。 5. The CPU usage rate control method according to claim 4, wherein the CPU usage rate control method controls the CPU usage rate of a software program that operates in an execution environment of a single process, in order to execute the software program by a computer. A first step of generating a first thread of an execution environment layer and starting the software program as the first thread, and a second thread of the OS layer are generated each time the first thread is generated. A step of associating the threads one-to-one, a grouping step of storing the second threads in groups for each software program and storing them in the storage means as group information, and inputting a specified value of the CPU usage rate for each group an input step of accepting, a group from the storage means Reads broadcast, a control step of the CPU usage rate of the second thread belonging to each group based on a specified value of the CPU utilization was calculated for each group, to control the CPU usage rate to the second thread The gist is to have.

請求項記載のCPU使用率制御プログラムは、コンピュータを請求項1乃至のいずれかに記載のCPU使用率制御装置として機能させることを要旨とする。 The gist of the CPU usage rate control program according to claim 5 is to cause a computer to function as the CPU usage rate control device according to any one of claims 1 to 3 .

以上より、本発明によれば、ソフトウェアプログラムを実行するために実行環境レイヤの第1スレッドを生成して起動し、その第1スレッドが生成される毎に、OSレイヤの第2スレッドを生成して当該第1スレッドに1対1で対応付け、その第2スレッドをソフトウェアプログラム毎のグループにまとめ、各グループに対するCPU使用率の指定値に基づいて各グループに属する第2スレッドのCPU使用率を計算し、第2スレッドに対してCPU使用率を制御するため、CPUを制御するOSレイヤが、当該OSレイヤの第2スレッドを通じて第1スレッドとして起動されるソフトウェアプログラムを間接的に制御可能となることから、ソフトウェアプログラム単位でCPU使用率を保証することができる。   As described above, according to the present invention, the first thread of the execution environment layer is generated and started to execute the software program, and the second thread of the OS layer is generated every time the first thread is generated. Thus, the second threads are grouped for each software program in a one-to-one correspondence with the first thread, and the CPU usage rate of the second thread belonging to each group is determined based on the specified CPU usage rate for each group. In order to calculate and control the CPU usage rate for the second thread, the OS layer that controls the CPU can indirectly control the software program that is started as the first thread through the second thread of the OS layer. Thus, the CPU usage rate can be guaranteed in software program units.

本発明によれば、ソフトウェアプログラム単位でCPU使用率を保証することができる。   According to the present invention, it is possible to guarantee the CPU usage rate in units of software programs.

CPU使用率制御装置の機能ブロック構成を示す図である。It is a figure which shows the functional block structure of a CPU usage rate control apparatus. グループ情報の例を示す図である。It is a figure which shows the example of group information. CPU使用率の制御フローを示す図である。It is a figure which shows the control flow of CPU usage rate. 設定画面の例を示す図である。It is a figure which shows the example of a setting screen. Javaスレッドのグループ切換フローを示す図である。It is a figure which shows the group switching flow of a Java thread. スレッド群グループ化機能部の保持情報(初期状態)を示す図である。It is a figure which shows the holding information (initial state) of a thread group grouping function part. スレッド群グループ化機能部の保持情報(OSGi起動状態)を示す図である。It is a figure which shows the holding information (OSGi starting state) of a thread group grouping function part. スレッド群グループ化機能部の保持情報(CPUリソース制御開始状態)を示す図である。It is a figure which shows the holding information (CPU resource control start state) of a thread group grouping function part. スレッド群グループ化機能部の保持情報(CPUリソース制御終了状態)を示す図である。It is a figure which shows the holding | maintenance information (CPU resource control completion state) of a thread group grouping function part. 作用効果説明時の参照図である。It is a reference figure at the time of effect description.

以下、本発明を実施する一実施の形態について図面を用いて説明する。但し、本発明は多くの異なる様態で実施することが可能であり、本実施の形態の記載内容に限定して解釈すべきではない。   Hereinafter, an embodiment for carrying out the present invention will be described with reference to the drawings. However, the present invention can be implemented in many different modes and should not be construed as being limited to the description of the present embodiment.

〔既存技術について〕
本発明は、前述したような既存技術を前提としている。以下、既存技術について更に補足説明する。
[Existing technology]
The present invention is based on the existing technology as described above. In the following, supplementary explanation will be given for the existing technology.

CPUはOSによってスケジューリングされており、そのスケジューリングの単位としては、プロセスや、OSレイヤにおけるスレッドであるLWP(Light Weight Process)がある。   The CPU is scheduled by the OS, and the unit of the scheduling is a process or a LWP (Light Weight Process) that is a thread in the OS layer.

また、プロセスやLWPはソフトウェアプログラムの処理を時間的に並列に動作させるための仕組みとしてOS内に存在し、JavaVMはOSから見ると1つのプロセスとして動作している。一方、JavaVMは、JavaVM内で処理を時間的に並列に動作させる仕組みとしてJavaスレッドを用意している。LWPは自身に対応するJavaスレッドを実行するが、JavaスレッドとLWPは、動作するレイヤが異なることからそれぞれ独立の存在である。   Processes and LWPs exist in the OS as a mechanism for operating software programs in parallel in time, and JavaVM operates as one process when viewed from the OS. JavaVM, on the other hand, prepares a Java thread as a mechanism for operating processes in parallel in JavaVM. The LWP executes the Java thread corresponding to itself, but the Java thread and the LWP are independent from each other because the operating layers are different.

〔CPU使用率制御装置の構成について〕
図1は、本実施の形態に係るCPU使用率制御装置1の機能ブロック構成を示す図である。このCPU使用率制御装置1は、LWP単位CPU制御機能部11と、Javaスレッド・LWP対応機能部12と、バンドルスレッド化機能部13と、スレッド群グループ化機能部14と、スレッドグループ切替機能部15と、バンドルCPU使用率設定部16とで構成される。以下詳述する。
[Configuration of CPU usage rate control device]
FIG. 1 is a diagram showing a functional block configuration of a CPU usage rate control device 1 according to the present embodiment. The CPU usage rate control device 1 includes an LWP unit CPU control function unit 11, a Java thread / LWP support function unit 12, a bundle threading function unit 13, a thread group grouping function unit 14, and a thread group switching function unit. 15 and a bundle CPU usage rate setting unit 16. This will be described in detail below.

LWP単位CPU制御機能部11は、OSレイヤで動作し、LWP単位やLWPのグループ単位でCPU使用率を制御する機能を有している。具体的には、各LWP又はLWPの各グループに対してのCPU使用時間の比の値を用いてCPUをスケジューリングすることにより、CPU使用率を制御する。   The LWP unit CPU control function unit 11 operates in the OS layer and has a function of controlling the CPU usage rate in units of LWP or LWP groups. Specifically, the CPU usage rate is controlled by scheduling the CPU using the value of the ratio of the CPU usage time for each LWP or each group of LWP.

尚、CPUをOSに対して直接制御する際には、例えば、Linux(登録商標)のcgroupsを利用することができる。cgroupsとは、プロセスやLWP単位、LWPのグループ単位でCPU使用率を制御するLinuxのカーネル機能である。   When the CPU is directly controlled by the OS, for example, Linux (registered trademark) cgroups can be used. The cgroups is a Linux kernel function that controls the CPU usage rate in units of processes, LWPs, and LWPs.

Javaスレッド・LWP対応機能部12は、JavaVMレイヤで動作し、1つのJavaスレッドを生成する毎にそれを実行するための1つのLWPを生成し、JavaVM上のJavaスレッドをOS上のLWPに1対1で対応させる機能を有している。   The Java thread / LWP support function unit 12 operates in the JavaVM layer, generates one LWP for executing it every time one Java thread is generated, and sets one Java thread on the JavaVM to the LWP on the OS. It has the function of making it correspond one-on-one.

バンドルスレッド化機能部13は、OSGiFWで動作し、OSGiFWによって生成されたJavaスレッドがあるバンドルの処理を呼び出す(バンドルを起動等する)際に、そのバンドルを実行するためのJavaスレッドを新規に生成し、そのバンドルをJavaスレッドとして起動する機能を有している。   The bundle threading function unit 13 operates on OSGiFW, and when a Java thread generated by OSGiFW calls a bundle process (starts a bundle or the like), a new Java thread is generated to execute the bundle. The bundle is activated as a Java thread.

尚、バンドルの処理を呼び出す処理としては、例えば、あるバンドルのスタートやストップ等のフレームワークから他のバンドルへのイベンティング等である。具体的には、OSGiFWからバンドルへのコールバックインタフェースとして、BundleActivator、ServiceFactory、Bundle−、Service−、FrameworkListener、Framework hook services等に対してスレッドを起動することが考えられる。これらには、例えば、バンドルの起動メソッドであるBundleActivator.start()が存在する。   Note that the processing for calling the bundle processing is, for example, eventing from a framework such as start or stop of a certain bundle to another bundle. Specifically, as a callback interface from the OSGiFW to the bundle, it is possible to start a thread for BundleActivator, ServiceFactory, Bundle-, Service-, FrameworkListener, Framework hook services, and the like. These include, for example, BundleActivator. There is start ().

また、Javaスレッド・LWP対応機能部12によりJavaスレッドはLWPと対応付けられるため、バンドルスレッド化機能部13は、新規のJavaスレッドを生成すると同時にそれに対応するLWPのIDをOSから取得することができる。   In addition, since the Java thread is associated with the LWP by the Java thread / LWP correspondence function unit 12, the bundle threading function unit 13 may generate a new Java thread and simultaneously obtain the corresponding LWP ID from the OS. it can.

また、OSGiFWは、Javaスレッドが呼び出そうとしているバンドルのIDを取得できるので、バンドルスレッド化機能部13は、呼び出そうとするバンドルのIDを取得し、Javaスレッド・LWP対応機能部12によって生成されたLWPのIDと紐付けてスレッド群グループ化機能部14に引き渡す機能も有している。   Also, since OSGiFW can acquire the ID of the bundle that the Java thread intends to call, the bundle threading function unit 13 acquires the ID of the bundle that is to be called, and the Java thread / LWP support function unit 12 It also has a function of associating with the generated LWP ID and handing it over to the thread group grouping function unit 14.

更に、バンドルスレッド化機能部13は、バンドルが新たにインストール又はアンインストールされた場合に、それをスレッド群グループ化機能部14へ通知する機能も有している。ここでの通知情報は、インストール又はアンインストールされたことや、そのバンドルのIDである。   Further, the bundle threading function unit 13 has a function of notifying the thread group grouping function unit 14 when a bundle is newly installed or uninstalled. The notification information here is information indicating that installation or uninstallation has been performed and the bundle ID.

スレッド群グループ化機能部14は、OSレイヤ(他のレイヤでも可)で動作し、バンドルスレッド化機能部13によってLWPに対応付けられたJavaスレッド群をバンドル毎にグループとして束ねて扱い、LWP単位CPU制御機能部11を呼び出す機能を有している。   The thread group grouping function unit 14 operates in the OS layer (other layers may be used) and handles the Java thread group associated with the LWP by the bundle threading function unit 13 as a group for each bundle. It has a function of calling the CPU control function unit 11.

具体的には、バンドルスレッド化機能部13から新たなバンドルのインストール情報が通知されると、その新たにインストールされたバンドルのID毎にグループを生成し、バンドルスレッド化機能部13からLWPのIDとバンドルのIDが送られる毎に、つまり新規のJavaスレッドが生成される毎に、そのLWPのIDを該当するバンドルIDのグループに所属させ、グループ情報として記憶する。   Specifically, when the installation information of the new bundle is notified from the bundle threading function unit 13, a group is generated for each newly installed bundle ID, and the LWP ID is generated from the bundle threading function unit 13. Each time a bundle ID is sent, that is, each time a new Java thread is generated, the LWP ID belongs to the corresponding bundle ID group and is stored as group information.

ここで、グループ情報の例を図2に示す。グループ情報には、1つのグループに対応するバンドルのIDと、そのグループ(=バンドル)に含まれるLWPのIDと、ユーザにより指定、設定されたグループ(=バンドル)に対する動作保証用の設定値(例えば、CPU使用率)と、グループ(=バンドル)に設定されたCPU使用率制御用の設定値とが関連付けて保存されている。   Here, an example of the group information is shown in FIG. The group information includes an ID of a bundle corresponding to one group, an ID of an LWP included in the group (= bundle), and an operation guarantee setting value for the group (= bundle) designated and set by the user (= bundle). For example, a CPU usage rate) and a setting value for CPU usage rate control set for a group (= bundle) are stored in association with each other.

尚、CPU使用率制御用の設定値とは、後述するように、動作保証用の設定値に基づいて計算される。そして、上述したcgroupsを利用する場合には、その計算値がcpu.sharesの値として設定される。尚、cpu.sharesとは、cgroupsにおいて、該当するグループに配分されるCPU使用時間の整数値である。   The set value for CPU usage rate control is calculated based on the set value for operation guarantee, as will be described later. When using the above cgroups, the calculated value is cpu. Set as the value of shares. In addition, cpu. “shares” is an integer value of CPU usage time allocated to a corresponding group in cgroups.

課題で説明したように、通常、CPUをスケジューリングするOSは、単一のプロセスで動作しているJavaVM内のバンドルの動作を把握することができない。一方、本実施の形態では、上記のグループ情報を用いてCPU使用時間をLWP単位又はLWPのグループ単位で制御するようにしている。LWPはJavaスレッドに対応付いているため、LWPを通じてJavaスレッド単位、つまりバンドルという塊の単位で扱うことが可能となり、結果として、特定のバンドルの動作を保証することが可能となる。   As described in the problem, the OS that schedules the CPU cannot normally grasp the operation of the bundle in the Java VM operating in a single process. On the other hand, in the present embodiment, the CPU usage time is controlled in units of LWPs or LWP groups using the group information. Since LWP is associated with Java threads, it can be handled in units of Java threads, that is, in units of bundles called bundles, through LWP, and as a result, the operation of a specific bundle can be guaranteed.

尚、図2では、OSから見て単一のプロセスで動作するJavaVMのプロセスについて例示しているが、スレッド群グループ化機能部14は、JavaVM以外のプロセス(図1の右側に示すような、JavaVMを介することなくOS上で直接動作するプロセス)についても同じグループ情報内で特定のグループで同時に管理している。   2 illustrates a Java VM process that operates as a single process as viewed from the OS. However, the thread group grouping function unit 14 uses a process other than the Java VM (as shown on the right side of FIG. Processes that operate directly on the OS without going through JavaVM are also managed simultaneously in a specific group within the same group information.

ここで、OSレイヤで動作するプロセス(LWPを含む)をどのグループに所属させるかについて説明しておく。本実施の形態では、以下(1)〜(6)のルールに基づいて所属グループを決定する。   Here, a group to which a process (including LWP) operating in the OS layer belongs will be described. In the present embodiment, the affiliation group is determined based on the following rules (1) to (6).

(1)JavaVM以外のプロセスについては、ある1つのグループ(以下、ルートグループ)に所属させる。これは新たなプロセスが発生するたびに行う。 (1) Processes other than JavaVM belong to a certain group (hereinafter referred to as a root group). This is done each time a new process occurs.

(2)バンドルスレッド化機能部13から引き渡されたLWPのIDについては、それと同時に引き渡されたバンドルIDのグループに所属させる。 (2) The LWP ID delivered from the bundle threading function unit 13 belongs to the bundle ID group delivered at the same time.

(3)いずれかのグループに所属しているLWPが生成したLWPについては、生成元のLWPと同じグループに所属させる。これは、あるJavaスレッドが別のJavaスレッドを生成した場合が該当する。 (3) An LWP generated by an LWP belonging to one of the groups is made to belong to the same group as the source LWP. This corresponds to the case where a certain Java thread generates another Java thread.

(4)スレッドグループ切替機能部15があるLWPを別のバンドルIDのグループに所属させるよう指定した場合には、そこで指定されたグループに所属させる。 (4) When the LWP having the thread group switching function unit 15 is designated to belong to a group with another bundle ID, the thread group switching function unit 15 belongs to the group designated there.

(5)上記(1)〜(4)以外のLWPは、ルートグループに所属させる。 (5) LWPs other than the above (1) to (4) belong to the root group.

(6)プロセスやLWPが停止又は消滅した場合は、所属していたグループから削除する。 (6) When a process or LWP stops or disappears, it is deleted from the group to which it belongs.

また、グループやグループ情報は、以下(A)〜(D)のルールに基づいて生成又は消滅させる。   Moreover, a group and group information are produced | generated or eliminated based on the following rules (A)-(D).

(A)ルートグループについては、スレッド群グループ化機能部14の起動時に1つだけ生成する。 (A) Only one root group is generated when the thread group grouping function unit 14 is activated.

(B)各バンドルIDのグループについては、バンドルスレッド化機能部13からインストール情報が通知された際に生成する。既に保持しているグループと同じバンドルIDの場合には生成しない。 (B) Each bundle ID group is generated when installation information is notified from the bundle threading function unit 13. It is not generated when the bundle ID is the same as the group already held.

(C)グループやグループ情報については、各バンドルの動作状況やOSGiFWの動作状況とは関係なく保持し続ける。尚、バンドルIDのグループに属するLWPのIDはバンドルやOSGiの停止時に削除されるが、それ以外の情報は保持し続ける。 (C) The group and group information are kept regardless of the operation status of each bundle and the OSGiFW operation status. The IDs of LWPs belonging to the bundle ID group are deleted when the bundle or OSGi is stopped, but other information is retained.

(D)グループの削除については、以下のいずれかのタイミングで実行する。 (D) Group deletion is executed at any of the following timings.

(D−1)CPU使用率制御装置1の初期化時。 (D-1) When the CPU usage rate control device 1 is initialized.

(D−2)バンドルスレッド化機能部13からアンインストール情報の通知を受けた直後。 (D-2) Immediately after receiving notification of uninstallation information from the bundle threading function unit 13.

(D−3)バンドルスレッド化機能部13からアンインストール情報の通知を受けてから一定期間後。例えば、1か月後等である。 (D-3) After a certain period of time after receiving the uninstall information notification from the bundle threading function unit 13. For example, after one month.

(D−4)OSGiFWの動作停止時に、ルートグループ以外の全てのグループを削除する。 (D-4) When the OSGiFW operation stops, all groups other than the root group are deleted.

スレッドグループ切替機能部15は、OSGiレイヤで動作し、自身を呼び出したJavaスレッドが所属しているバンドルIDのグループを、LWPのIDを利用して他のグループに切り替える機能を有している。この機能は、バンドルに対するインタフェースとして提供される。   The thread group switching function unit 15 operates in the OSGi layer, and has a function of switching a bundle ID group to which a Java thread that calls itself belongs to another group using an LWP ID. This function is provided as an interface to the bundle.

具体的には、切替先のバンドルIDを引数としてバンドルによりコールされると、スレッドグループ切替機能部15は、コール元のバンドルのバンドルIDと、コール元のJavaスレッドに対応するLWPのIDとを取得し、それらを合わせてスレッド群グループ化機能部14に引き渡すことにより、所属グループを切り換える。   Specifically, when called by a bundle with the bundle ID of the switching destination as an argument, the thread group switching function unit 15 obtains the bundle ID of the calling source bundle and the ID of the LWP corresponding to the calling Java thread. The acquired groups are combined and handed over to the thread group grouping function unit 14 to switch the belonging group.

バンドルCPU使用率設定部16は、OSGiレイヤ(他のレイヤでも可)で動作し、オペレータやエンドユーザ向けの設定用Webユーザインタフェースを持つ機能を有している。例えば、GUI生成時にインストール済みのバンドル一覧とそのバンドルの動作状態(動作中・非動作中)をOSGiFWから取得してユーザ端末に表示する。   The bundle CPU usage rate setting unit 16 operates in the OSGi layer (other layers may be used) and has a function having a setting Web user interface for operators and end users. For example, a list of bundles already installed at the time of GUI generation and the operating state (operating / not operating) of the bundle are acquired from the OSGiFW and displayed on the user terminal.

具体的には、ユーザがあるバンドル(動作状態を問わない)に対して割り当てたいCPUリソースをCPU使用率(%)で指定し設定すると、その設定内容をスレッド群グループ化機能部14に投入する。また、合計したCPU使用率が事前に定めた閾値を超える場合には、ユーザに警告を発する機能も備えている。例えば、CPU使用率の合計値が99%を超えると警告メッセージを表示する等である。   Specifically, when the CPU resource to be allocated to a certain bundle (regardless of the operation state) is specified and set by the CPU usage rate (%), the setting content is input to the thread group grouping function unit 14. . In addition, when the total CPU usage rate exceeds a predetermined threshold, a function for issuing a warning to the user is also provided. For example, a warning message is displayed when the total CPU usage rate exceeds 99%.

〔CPU使用率制御装置の動作について〕
次に、CPU使用率制御装置1の動作について説明する。最初に、図3を参照しながら、各バンドルに対するCPUリソースの制御方法について説明する。
[Operation of CPU usage rate control device]
Next, the operation of the CPU usage rate control device 1 will be described. First, a CPU resource control method for each bundle will be described with reference to FIG.

まず、バンドルCPU使用率設定部16は、ユーザにより選択されたバンドルと、設定入力された当該バンドルに割り当てるCPU使用率との入力を受け付ける(ステップS101)。   First, the bundle CPU usage rate setting unit 16 receives input of the bundle selected by the user and the CPU usage rate to be assigned to the bundle that has been set and input (step S101).

ここで、その設定画面の例を図4に示す。「バンドルシンボリックネーム」の列がバンドルの一覧を表している。「バンドル状態」の列は各バンドルの動作状態を表しているが、この列は無くてもよい。バンドル状態には動作中(ACTIVE)、停止中(RESOLVED)、インストール済みだが未動作(INSTALLED)等がある。ユーザは、一覧存在されたどの状態のバンドルに対しても設定することができる。   An example of the setting screen is shown in FIG. The “bundle symbolic name” column represents a list of bundles. The “bundle state” column represents the operation state of each bundle, but this column may be omitted. The bundle state includes operating (ACTIVE), stopping (RESOLVED), installed but not operating (INSTALLED), and the like. The user can set the bundle for any state in the list.

「最低品質保証CPU使用率」の列は、動作保証を行いたいバンドルに対して設定するCPU使用率(%)の最低値を投入するテキストボックスである。コンピュータの負荷が大きくなった際にも、最低限、この設定値のCPU使用率が該当するバンドルに与えられることを示している。一方、コンピュータの負荷が小さい場合には、この設定値を超えてCPUを使用する場合もあるし、逆に、設定されたバンドルが処理を行っていない際には、他のバンドルがCPUを使用する場合もある。   The column of “minimum quality assurance CPU usage rate” is a text box for inputting a minimum value of CPU usage rate (%) set for a bundle for which operation guarantee is to be performed. Even when the load on the computer increases, the CPU usage rate of this set value is given to the corresponding bundle at a minimum. On the other hand, when the load on the computer is small, the CPU may be used exceeding this setting value. Conversely, when the set bundle is not processing, another bundle uses the CPU. There is also a case.

「CPUリソース制御適用フラグ」の列は、CPUリソース制御機能が有効であるか否かを示している。「制御開始」および「制御終了」の列は、ラジオボタンで選択可能に表示され、CPUリソース制御機能をON又はOFFすることができる。最下段の「合計」の行は、「CPUリソース制御適用フラグ」がONであるバンドルの「最低品質保証CPU使用率」によって設定されたCPU使用率の合計値を表している。   The column “CPU resource control application flag” indicates whether or not the CPU resource control function is valid. The columns “control start” and “control end” are displayed so as to be selectable by radio buttons, and the CPU resource control function can be turned on or off. The “total” line at the bottom represents the total value of the CPU usage rate set by the “minimum quality assurance CPU usage rate” of the bundle whose “CPU resource control application flag” is ON.

次に、バンドルCPU使用率設定部16は、ステップS101で受け付けられたユーザの設定情報をスレッド群グループ化機能部14に投入する(ステップS102)。   Next, the bundle CPU usage rate setting unit 16 inputs the user setting information received in step S101 into the thread group grouping function unit 14 (step S102).

ここでの投入情報は、ユーザにより選択され「制御開始」がONとなっているバンドルのIDと、それに対応する「最低品質保証CPU使用率」である。尚、バンドルの状態がACTIVEであってもそれ以外であっても投入される。   The input information here is an ID of a bundle that is selected by the user and whose “control start” is ON, and a corresponding “minimum quality assurance CPU usage rate”. The bundle is inserted regardless of whether the bundle state is ACTIVE or not.

次に、スレッド群グループ化機能部14は、各バンドルIDの各グループに対し、投入されたCPU使用率(図2に示した動作保証用の設定値)に対応する、LWP単位CPU制御機能部11への設定値(図2に示したCPU使用率制御用の設定値)を計算し、LWP単位CPU制御機能部11に投入する(ステップS103)。   Next, the thread group grouping function unit 14 is an LWP unit CPU control function unit corresponding to the CPU usage rate (the setting value for operation guarantee shown in FIG. 2) input to each group of each bundle ID. 11 is calculated (set value for CPU usage rate control shown in FIG. 2) and is input to the LWP unit CPU control function unit 11 (step S103).

具体的には、後述するように、ユーザによって指定されたCPU使用率に基づいてLWP単位CPU制御機能部11への設定値を計算する。つまり、各グループに属するLWPのCPU使用率を計算する。   Specifically, as described later, a setting value for the LWP unit CPU control function unit 11 is calculated based on the CPU usage rate designated by the user. That is, the CPU usage rate of the LWP belonging to each group is calculated.

例えば、LWP単位CPU制御機能部11が上述したcgroupsを利用する場合、cpu.sharesの値を計算することになる。また、Linuxのniceを利用する場合には、独自に実装されたOS上のCPUスケジューリング機能を利用して計算することになる。尚、ここでの計算及び投入は、全てのグループに属するLWPに対して、バンドルの状態がACTIVEであるかどうかとは無関係に行われる。   For example, when the LWP unit CPU control function unit 11 uses the above-mentioned cgroups, cpu. The value of shares will be calculated. Further, when using the Linux nice, the calculation is performed by using the CPU scheduling function on the OS that is uniquely implemented. Note that the calculation and input here are performed for LWPs belonging to all groups regardless of whether the bundle state is ACTIVE.

次に、LWP単位CPU制御機能部11は、スレッド群グループ化機能部14から投入された設定値を用いて、グループ(=バンドル)に属するLWPのCPU使用率を制御する(ステップS104)。   Next, the LWP unit CPU control function unit 11 controls the CPU usage rate of the LWP belonging to the group (= bundle) using the set value input from the thread group grouping function unit 14 (step S104).

具体的には、cgroupsのカーネル機能を用いて、各グループ(=バンドル)に属しているLWPのCPU使用時間の比が、各グループ(=バンドル)に投入された「最低品質保証CPU使用率」の比と同等になるように、コンピュータ内のCPUをスケジューリングする。尚、cgroupsでは、プロセスグループ毎にcpu.sharesとして与えられた整数の比に応じてCPU使用時間を相対的に配分する制御を行う機能を有している。   Specifically, using the cgroups kernel function, the CPU usage time ratio of the LWP belonging to each group (= bundle) is “minimum quality assurance CPU usage rate” input to each group (= bundle). The CPU in the computer is scheduled so as to be equal to the ratio. In cgroups, the cpu. It has a function of performing control to relatively distribute CPU usage time according to an integer ratio given as shares.

但し、グループに属するLWPが1つも存在しない場合には、そのグループに対してはCPUスケジューリングを行わない。このとき、スケジューリングは行うが、該当するLWPが1つも存在しないので、次のスケジューリングにスキップするようにしても構わない。   However, if there is no LWP belonging to a group, CPU scheduling is not performed for that group. At this time, scheduling is performed, but since there is no corresponding LWP, it may be skipped to the next scheduling.

以上の処理により、各バンドルのCPU使用時間が、ステップS101で投入されたCPU使用率となるように制御されることになる。これにより、特定のバンドルの動作を保証することができる。   Through the above processing, the CPU usage time of each bundle is controlled to be the CPU usage rate input in step S101. Thereby, the operation of a specific bundle can be guaranteed.

続いて、図5を参照しながら、Javaスレッドのグループ切替方法について説明する。但し、いくつかのバンドルが既に動作しており、いくつかのバンドルには「最低品質保証CPU使用率」が設定されているとする。   Next, a Java thread group switching method will be described with reference to FIG. However, it is assumed that some bundles are already operating and “minimum quality assurance CPU usage rate” is set in some bundles.

まず、動作中のバンドル1が、切替先のバンドルIDを引数としてスレッドグループ切替機能部15をコールする(ステップS201)。このとき、バンドル1からは、コールを行ったJavaスレッドをどの動作中の他のバンドルに所属させるかの指定情報が投入される。   First, the operating bundle 1 calls the thread group switching function unit 15 using the bundle ID of the switching destination as an argument (step S201). At this time, the bundle 1 is input with designation information as to which other bundle in which the running Java thread belongs.

次に、スレッドグループ切替機能部15は、コール元(切換元)のバンドルのバンドルIDと、コール元のバンドルのJavaスレッドに対応するLWPのIDとを取得し、切替先のバンドルのバンドルIDと共に切換情報としてスレッド群グループ化機能部14へ投入する(ステップS202)。   Next, the thread group switching function unit 15 acquires the bundle ID of the call source (switch source) bundle and the ID of the LWP corresponding to the Java thread of the call source bundle, together with the bundle ID of the switch destination bundle. The switching information is input to the thread group grouping function unit 14 (step S202).

次に、スレッド群グループ化機能部14は、切換元のバンドルIDのグループに所属するLWPのIDを、切換先のバンドルIDのグループに移動する(ステップS203)。   Next, the thread group grouping function unit 14 moves the ID of the LWP belonging to the group of the bundle ID of the switching source to the group of the bundle ID of the switching destination (step S203).

次に、スレッド群グループ化機能部14は、ステップS203で更新された、全てのグループとそれに属するLWPのIDに関する情報をLWP単位CPU制御機能部11へ通知する(ステップS204)。   Next, the thread group grouping function unit 14 notifies the LWP unit CPU control function unit 11 of the information related to all groups and the IDs of LWPs belonging to the group updated in step S203 (step S204).

最後に、LWP単位CPU制御機能部11は、通知された更新後の情報に基づいてグループに属するLWPのCPU使用率を制御する(ステップS205)。   Finally, the LWP unit CPU control function unit 11 controls the CPU usage rate of the LWP belonging to the group based on the notified updated information (step S205).

〔スレッド群グループ化機能部について〕
続いて、スレッド群グループ化機能部14について詳述する。図6〜図9は、スレッド群グループ化機能部14が保持する保持情報の遷移を示している。
[About thread group grouping function]
Next, the thread group grouping function unit 14 will be described in detail. 6 to 9 show transitions of retained information retained by the thread group grouping function unit 14.

図6に、JavaVM及びOSGiが起動する前の状態を示す。この初期状態では、OS上の全てのプロセス(LWPを含む)はルートグループに属している。   FIG. 6 shows a state before JavaVM and OSGi are activated. In this initial state, all processes (including LWP) on the OS belong to the route group.

ここで、そのルートグループに設定されているcpu.sharesの値を固定値Nとする。初期状態であることから、その固定値Nを任意の値で設定してもよいが、他のバンドルへ設定するCPU使用率とのバランスを考慮して、ここでは1024とする。以下の例ではこの値を基準に計算を行う。   Here, cpu. Set in the route group. The value of shares is a fixed value N. Since it is in the initial state, the fixed value N may be set as an arbitrary value, but here it is set to 1024 in consideration of the balance with the CPU usage rate set to other bundles. In the following example, calculation is performed based on this value.

また、図6ではルートグループ以外のグループが存在しないが、過去にOSGiFWが起動しており、スレッド群グループ化機能部14がグループを既に生成していた場合であって、かつ、OSGiが終了してもグループを保持するような実装の場合には、ルートグループ以外のグループも存在しても構わない。   In FIG. 6, there is no group other than the root group, but OSGiFW has been activated in the past, and the thread group grouping function unit 14 has already generated a group, and OSGi is terminated. However, in the case of an implementation that holds groups, groups other than the root group may exist.

次に、図7に、JavaVM及びOSGiが起動した後の状態を示す。インストールされたバンドル毎にグループ(図中ではProcessGroupと表記)を作成する。すなわち、バンドルスレッド化機能部13によりインストールされたバンドルのIDとLWPのIDが通知されるので、それらを対応付けたグループ情報を生成する。   Next, FIG. 7 shows a state after JavaVM and OSGi are activated. A group (indicated as ProcessGroup in the figure) is created for each installed bundle. That is, the bundle threading function unit 13 notifies the ID of the installed bundle and the ID of the LWP, and therefore generates group information that associates them.

そして、過去にバンドルCPU使用率設定部16により設定され、スレッド群グループ化機能部14がグループ情報を既に保持している場合は、その情報を参照し、CPUリソースの制御非対象のバンドルのグループに対しては、cpu.sharesの値としてルートグループと同じ1024の固定値Nを設定する。   If the bundle CPU usage rate setting unit 16 has set the group information in the past and the thread group grouping function unit 14 has already held the group information, the group of bundles that are not targeted for control of the CPU resource is referred to. For cpu. A fixed value N of 1024, which is the same as the route group, is set as the value of shares.

一方、CPUリソースの制御対象のバンドルのグループに対しては、「CPUリソース制御対象バンドルの最低品質保証CPU使用率」と「CPUリソース制御非対象の全てのプロセス(LWPを含む)が利用可能なCPU使用率」の比が、「CPUリソース制御対象バンドルのcpu.sharesの値」と「CPUリソース制御非対象の全てのプロセス(LWPを含む)に設定されているcpu.sharesの値の合計」の比と同一になるように、例えば、以下の式(1)を用いて「CPUリソース制御対象バンドルのcpu.sharesの値」を計算する。

Figure 0005847746
On the other hand, for a group of CPU resource control target bundles, “the minimum quality assurance CPU usage rate of the CPU resource control target bundle” and “all processes (including LWP) that are not subject to CPU resource control can be used. The ratio of “CPU utilization” is “the value of cpu.shares of the CPU resource control target bundle” and “the sum of the values of cpu.shares set for all processes (including LWP) that are not subject to CPU resource control”. For example, the “value of cpu.shares of the CPU resource control target bundle” is calculated using the following equation (1) so as to be equal to the ratio of:
Figure 0005847746

尚、Cは「CPUリソース制御対象バンドルのcpu.sharesの値」であり、Gcpuは「CPUリソース制御対象バンドルの最低品質保証CPU使用率」であり、nはCPUリソース制御非対象のバンドルの数であり、KはCPUリソース制御対象バンドルの数であり、iはCPUリソース制御対象バンドルの識別子である。 Incidentally, C S is the "value of cpu.shares of CPU resource control object bundles ', G cpu is" minimum quality assurance CPU use rate of the CPU resource control object bundles', n represents CPU resource control non-target bundle K is the number of CPU resource control target bundles, and i is the identifier of the CPU resource control target bundle.

尚、「CPUリソース制御非対象の全てのプロセス(LWPを含む)が利用可能なCPU使用率」は右辺分母に相当している。また、「CPUリソース制御非対象の全てのプロセス(LWPを含む)に設定されているcpu.sharesの値の合計」は、右辺分子の括弧部分に相当している。CPUリソース制御非対象バンドルにはそれぞれ1024の固定値Nが設定され、ルートグループにも同じ固定値Nが固定的に設定されているため、当該括弧部分に示すような式としている。尚、この計算は、バンドルの動作状態に関わらず計算される。   The “CPU usage rate that can be used by all processes (including LWP) that are not subject to CPU resource control” corresponds to the denominator on the right side. Further, “the sum of the values of cpu.shares set for all processes (including LWP) that are not subject to CPU resource control” corresponds to the parenthesis part of the numerator on the right side. Since a fixed value N of 1024 is set for each of the CPU resource control non-target bundles, and the same fixed value N is also fixedly set for the route group, the formula shown in the parentheses is used. This calculation is performed regardless of the operating state of the bundle.

最後に、図8に、CPUリソースの制御を開始した状態を示し、図9に、CPUリソースの制御を終了した状態を示す。どちらの場合であっても、全てのバンドルのグループに対してcpu.sharesの値を再計算し直す。また、バンドルのグループが増減した場合にも、全てのグループに対して再計算する。   Finally, FIG. 8 shows a state where the control of the CPU resource is started, and FIG. 9 shows a state where the control of the CPU resource is finished. In either case, cpu. Recalculate the value of shares. Also, when the number of bundle groups increases or decreases, recalculation is performed for all groups.

以上より、本実施の形態によれば、バンドルを実行するためにJavaスレッドを生成して起動し、そのJavaスレッドが生成される毎に、OSレイヤのLWPを生成して当該Javaスレッドに1対1で対応付け、そのLWPをバンドル毎のグループにまとめ、各グループに対するCPU使用率の指定値に基づいて各グループに属するLWPのCPU使用率を計算し、LWPに対してCPU使用率を制御するので、図10に示すように、CPUを制御するOSレイヤが、当該OSレイヤのLWPを通じてJavaスレッドとして起動されるバンドルを間接的に制御可能となることから、バンドル単位でCPU使用率を保証することができる。   As described above, according to the present embodiment, a Java thread is generated and started in order to execute a bundle, and each time the Java thread is generated, an OS layer LWP is generated and a pair of the Java thread is generated. 1, the LWPs are grouped for each bundle, the CPU usage rates of the LWPs belonging to each group are calculated based on the specified CPU usage rates for each group, and the CPU usage rates are controlled for the LWPs. Therefore, as shown in FIG. 10, since the OS layer that controls the CPU can indirectly control the bundle that is activated as a Java thread through the LWP of the OS layer, the CPU usage rate is guaranteed in units of bundles. be able to.

最後に、本実施の形態では、ソフトウェアプログラム実行環境としてJavaVMを用い、ソフトウェアプログラムとしてバンドル用いて説明したが、OS上で単一プロセスとして動作するソフトウェアプログラム実行環境と、その実行環境上で動作するソフトウェアプログラムとを具備するコンピュータであれば、同様に適用することができ、同様の効果を得ることができる。   Finally, in this embodiment, JavaVM is used as the software program execution environment and bundled as the software program. However, the software program execution environment that operates as a single process on the OS and the execution environment operate. Any computer provided with a software program can be applied in the same manner, and the same effect can be obtained.

また、本実施の形態で説明したCPU使用率制御装置1は、メモリやCPUを備えたコンピュータで実現することができる。また、その処理はプログラムによって実行可能である。   The CPU usage rate control device 1 described in the present embodiment can be realized by a computer having a memory and a CPU. The process can be executed by a program.

1…CPU使用率制御装置
11…LWP単位CPU制御機能部
12…Javaスレッド・LWP対応機能部
13…バンドルスレッド化機能部
14…スレッド群グループ化機能部
15…スレッドグループ切替機能部
16…バンドルCPU使用率設定部
S101〜S104、S201〜S205…ステップ
DESCRIPTION OF SYMBOLS 1 ... CPU usage rate control apparatus 11 ... LWP unit CPU control function part 12 ... Java thread and LWP corresponding | compatible function part 13 ... Bundle threading function part 14 ... Thread group grouping function part 15 ... Thread group switching function part 16 ... Bundle CPU Usage rate setting unit S101 to S104, S201 to S205 ... step

Claims (5)

単一プロセスの実行環境上で動作するソフトウェアプログラムのCPU使用率を制御するCPU使用率制御装置において、
前記ソフトウェアプログラムを実行するために前記実行環境レイヤの第1スレッドを生成し、前記ソフトウェアプログラムを前記第1スレッドとして起動する起動手段と、
前記第1スレッドが生成される毎に、OSレイヤの第2スレッドを生成して当該第1スレッドに1対1で対応付ける対応付け手段と、
前記第2スレッドをソフトウェアプログラム毎のグループにまとめてグループ情報として記憶手段に記憶するグループ化手段と、
各グループに対するCPU使用率の指定値の入力を受け付ける入力手段と、
前記記憶手段からグループ情報を読み出して、各グループに対する前記CPU使用率の指定値に基づいて各グループに属する前記第2スレッドのCPU使用率を計算し、前記第2スレッドに対してCPU使用率を制御する制御手段と、
を有することを特徴とするCPU使用率制御装置。
In a CPU usage rate control device that controls the CPU usage rate of a software program that operates on the execution environment of a single process,
Starting means for generating a first thread of the execution environment layer to execute the software program, and starting the software program as the first thread;
An association unit that generates a second thread of the OS layer and associates the first thread with the first thread each time the first thread is generated;
Grouping means for grouping the second threads into groups for each software program and storing them in the storage means as group information;
An input means for receiving an input of a specified value of the CPU usage rate for each group;
Reads the group information from the storage means, a CPU usage rate of the second thread belonging to each group based on a specified value of the CPU utilization was calculated for each group, the CPU utilization rate with respect to the second thread Control means for controlling;
A CPU usage rate control device comprising:
前記実行環境は、JavaVirtualMachineであって、
前記グループ化手段は、
前記JavaVirtualMachine上で動作するソフトウェアプログラム以外のソフトウェアプログラムに係る前記第2スレッドを特定のグループで管理することを特徴とする請求項1記載のCPU使用率制御装置。
The execution environment is Java Virtual Machine,
The grouping means includes
The CPU usage rate control apparatus according to claim 1, wherein the second thread related to a software program other than a software program operating on the Java Virtual Machine is managed in a specific group.
自身を呼び出した前記第1スレッドに対応する前記第2スレッドの所属グループを他のグループに切り換える切替手段を更に有することを特徴とする請求項1又は2記載のCPU使用率制御装置。3. The CPU usage rate control apparatus according to claim 1, further comprising switching means for switching a group to which the second thread corresponding to the first thread that has called itself belongs to another group. 単一プロセスの実行環境上で動作するソフトウェアプログラムのCPU使用率を制御するCPU使用率制御方法において、In a CPU usage rate control method for controlling the CPU usage rate of a software program operating on an execution environment of a single process,
コンピュータにより、By computer
前記ソフトウェアプログラムを実行するために前記実行環境レイヤの第1スレッドを生成し、前記ソフトウェアプログラムを前記第1スレッドとして起動する起動ステップと、Generating a first thread of the execution environment layer to execute the software program, and starting the software program as the first thread;
前記第1スレッドが生成される毎に、OSレイヤの第2スレッドを生成して当該第1スレッドに1対1で対応付ける対応付けステップと、An association step of generating a second thread of the OS layer and associating with the first thread on a one-to-one basis each time the first thread is generated;
前記第2スレッドをソフトウェアプログラム毎のグループにまとめてグループ情報として記憶手段に記憶するグループ化ステップと、A grouping step in which the second threads are grouped into groups for each software program and stored in the storage means as group information;
各グループに対するCPU使用率の指定値の入力を受け付ける入力ステップと、An input step for receiving an input of a specified value of the CPU usage rate for each group;
前記記憶手段からグループ情報を読み出して、各グループに対する前記CPU使用率の指定値に基づいて各グループに属する前記第2スレッドのCPU使用率を計算し、前記第2スレッドに対してCPU使用率を制御する制御ステップと、The group information is read from the storage means, the CPU usage rate of the second thread belonging to each group is calculated based on the specified value of the CPU usage rate for each group, and the CPU usage rate is calculated for the second thread. Control steps to control;
を有することを特徴とするCPU使用率制御方法。A CPU usage rate control method comprising:
コンピュータを請求項1乃至3のいずれかに記載のCPU使用率制御装置として機能させるためのCPU使用率制御プログラム。A CPU usage rate control program for causing a computer to function as the CPU usage rate control device according to claim 1.
JP2013037094A 2013-02-27 2013-02-27 CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program Expired - Fee Related JP5847746B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013037094A JP5847746B2 (en) 2013-02-27 2013-02-27 CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013037094A JP5847746B2 (en) 2013-02-27 2013-02-27 CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program

Publications (2)

Publication Number Publication Date
JP2014164662A JP2014164662A (en) 2014-09-08
JP5847746B2 true JP5847746B2 (en) 2016-01-27

Family

ID=51615183

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013037094A Expired - Fee Related JP5847746B2 (en) 2013-02-27 2013-02-27 CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program

Country Status (1)

Country Link
JP (1) JP5847746B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6426495B2 (en) * 2015-02-18 2018-11-21 Necプラットフォームズ株式会社 Computer system, CPU resource management method, and CPU resource management program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012064025A (en) * 2010-09-16 2012-03-29 Hitachi Ltd Gateway control device, gateway unit and system

Also Published As

Publication number Publication date
JP2014164662A (en) 2014-09-08

Similar Documents

Publication Publication Date Title
CN110351384B (en) Big data platform resource management method, device, equipment and readable storage medium
CN106775977B (en) Task scheduling method, device and system
CN102426533B (en) Software installation method and device
CN110704185B (en) Cluster system sharding scheduled task scheduling method and cluster system
WO2011150777A1 (en) Development device of web applications and development method thereof
US20160034315A1 (en) Information processing system, deployment method, processing device, and deployment device
CN107168779A (en) A kind of task management method and system
CN101694633A (en) Equipment, method and system for dispatching of computer operation
CN111064746A (en) Resource allocation method, device, equipment and storage medium
CN119781961A (en) Task management method, system, device and medium based on graph structure
CN110750343B (en) Cluster system timing task scheduling control method and cluster system
US10305817B1 (en) Provisioning system and method for a distributed computing environment using a map reduce process
JP5847746B2 (en) CPU usage rate control device, CPU usage rate control method, and CPU usage rate control program
JP2017027367A (en) Image forming apparatus, resource management device, resource management method, image forming apparatus, and program
CN102831494A (en) Scheduling method, scheduling device and scheduling system
CN111104331B (en) Software management method, terminal device, and computer-readable storage medium
CN104166573B (en) Software installation method and device
US9195515B1 (en) Method and system for process load balancing
CN102455917B (en) The startup control method of a kind of Web TV and device
CN104572144A (en) Application downloading method and device
JP5458147B2 (en) Event notification method, program, and apparatus
JP2014235580A (en) Cpu usage rate control device, cpu usage rate control method, and cpu usage rate control program
CN108089919B (en) Method and system for concurrently processing API (application program interface) requests
CN110737533A (en) task scheduling method and device, electronic equipment and storage medium
JP5444900B2 (en) Job execution management system, job execution management method, job execution management program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150206

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150813

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151006

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151106

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20151124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151125

R150 Certificate of patent or registration of utility model

Ref document number: 5847746

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees