JP5455111B2 - Flow control device and flow control method - Google Patents

Flow control device and flow control method Download PDF

Info

Publication number
JP5455111B2
JP5455111B2 JP2009075801A JP2009075801A JP5455111B2 JP 5455111 B2 JP5455111 B2 JP 5455111B2 JP 2009075801 A JP2009075801 A JP 2009075801A JP 2009075801 A JP2009075801 A JP 2009075801A JP 5455111 B2 JP5455111 B2 JP 5455111B2
Authority
JP
Japan
Prior art keywords
cpu
threads
usage rate
appropriate
cpu usage
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.)
Active
Application number
JP2009075801A
Other languages
Japanese (ja)
Other versions
JP2010231313A (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.)
Nihon Unisys Ltd
Original Assignee
Nihon Unisys Ltd
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 Nihon Unisys Ltd filed Critical Nihon Unisys Ltd
Priority to JP2009075801A priority Critical patent/JP5455111B2/en
Publication of JP2010231313A publication Critical patent/JP2010231313A/en
Application granted granted Critical
Publication of JP5455111B2 publication Critical patent/JP5455111B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は流量制御装置および流量制御方法に関し、特に、コンピュータが処理すべき情報処理量の単位であるスレッド数を制御する技術に関するものである。   The present invention relates to a flow control device and a flow control method, and more particularly to a technique for controlling the number of threads, which is a unit of information processing amount to be processed by a computer.

一般的に、オペレーティングシステム(OS)がプログラムを処理する単位として、プロセスという用語が用いられる。プロセスは、1つ以上のスレッドと呼ばれる処理単位で構成されている。そして、処理効率を上げる観点から、スレッドを多重化して処理することがよく行われる。しかし、システムのリソースを使い果たすほどスレッドを多重化すると、かえって処理効率が悪くなってしまう。   In general, the term process is used as a unit in which an operating system (OS) processes a program. A process is composed of processing units called one or more threads. From the viewpoint of increasing processing efficiency, it is often performed to multiplex threads for processing. However, if threads are multiplexed so that system resources are used up, the processing efficiency will be worse.

このようなスレッドの過度の多重化を防ぐために、システムのリソースの使用状況に応じて動的に処理スレッドの流量制御を行う方法が提案されている(例えば、特許文献1参照)。特許文献1に記載の技術では、文献1の図7に示すようなスレッド基本情報テーブルをあらかじめ作成して記憶しておき、実際に測定されるCPU使用率に応じて、上記スレッド基本情報テーブル内に格納されている限界多重度を動的に変更するようにしている。   In order to prevent such excessive multiplexing of threads, a method of dynamically controlling the flow rate of processing threads in accordance with the usage status of system resources has been proposed (see, for example, Patent Document 1). In the technique described in Patent Document 1, a thread basic information table as shown in FIG. 7 of Document 1 is created and stored in advance, and the above thread basic information table is stored in accordance with the CPU usage rate actually measured. The limit multiplicity stored in is dynamically changed.

特開2007−122527号公報JP 2007-122527 A

しかしながら、特許文献1に記載の技術では、スレッド基本情報テーブルをあらかじめ作成しておく必要がある。スレッド基本情報テーブルは、スレッド毎に限界多重度の設計値を求めて記憶したものである。ここで、例えば銀行のATMシステムのような大規模システムにおいては、同時に実行されるアプリケーションプログラムが数百〜数千種類に上ぼり、スレッド数が極めて多くなる。そのため、スレッド基本情報テーブルの作成に多大な労力と時間がかかり、管理上の負荷が大きくなるという問題が生じる。よって、このような大規模システムに特許文献1の技術を適用するのは現実的でない。   However, with the technique described in Patent Document 1, it is necessary to create a thread basic information table in advance. The thread basic information table is obtained by storing the design value of the limit multiplicity for each thread. Here, for example, in a large-scale system such as a bank ATM system, hundreds to thousands of application programs are executed simultaneously, and the number of threads is extremely large. Therefore, it takes a lot of labor and time to create the thread basic information table, and there arises a problem that a management load increases. Therefore, it is not realistic to apply the technique of Patent Document 1 to such a large-scale system.

また、特許文献1の技術では、最初にスレッド基本情報テーブルに記憶しておいた設計値と、実際に測定されるCPU使用率との比較で両者に大きな差がある場合には、限界多重度の値が一気に変更させられることがある。限界多重度の値が一気に大きくなると、同時に起動するスレッド数が一気に多くなる。そうなると、スレッドが過度に多重化してCPU使用率が急激に上がり、今度は上がり過ぎたCPU使用率を下げる必要が生じてしまう。このようにCPU使用率が上がったり下がったりを繰り返すことにより、かえってシステムの処理効率が悪くなってしまうという問題を生じる。逆に、限界多重度の値が一気に小さくなると、CPU使用率が急激に下がり、リソースを有効に活用できず全体としての処理効率が悪くなってしまうという問題を生じる。   In the technique of Patent Document 1, if there is a large difference between the design value initially stored in the thread basic information table and the CPU usage rate actually measured, the limit multiplicity is The value of may be changed at once. If the value of the limit multiplicity increases at a stretch, the number of threads activated simultaneously increases at a stretch. If this happens, the threads will be over-multiplexed and the CPU usage rate will rise rapidly, and this time it will be necessary to reduce the CPU usage rate that has risen too much. As described above, when the CPU usage rate is repeatedly increased or decreased, there arises a problem that the processing efficiency of the system is deteriorated. On the other hand, if the value of the limit multiplicity decreases at a stretch, the CPU usage rate decreases rapidly, causing a problem that resources cannot be used effectively and the overall processing efficiency deteriorates.

本発明は、このような問題を解決するために成されたものであり、流量制御のための管理上の負荷を減らすとともに、スレッドの流量制御を適切に行いシステムの処理効率をより向上させることができるようにすることを目的とする。   The present invention has been made to solve such a problem, and reduces the administrative burden for flow control, and appropriately improves the processing efficiency of the system by appropriately controlling the flow of threads. The purpose is to be able to.

上記した課題を解決するために、本発明では、スレッドの実行中にCPU使用率測定部により測定されたCPU使用率が最適使用範囲内に入っているか否かを判定し、入っていないと判断した場合に、スレッドを同時に起動可能な数を制限する適正スレッド数を所定の割合で変更する。このとき、CPU使用率がCPU最適使用範囲を下回っていると判断された場合は、適正スレッド数として採り得る最大値である最大スレッド数を超えない範囲で適正スレッド数を所定の割合で増加させる。また、CPU使用率がCPU最適使用範囲を上回っていると判断された場合は、適正スレッド数として採り得る最小値である最小スレッド数を下回らない範囲で適正スレッド数を所定の割合で減少させる。さらに、測定されたCPU使用率が最適使用範囲内に入ると、適正スレッド数をそのときの値に固定する。
In order to solve the above-described problem, in the present invention, it is determined whether or not the CPU usage rate measured by the CPU usage rate measuring unit during execution of the thread is within the optimum usage range, and is determined not to be entered. In this case, the appropriate number of threads that limit the number of threads that can be activated simultaneously is changed at a predetermined rate. At this time, if it is determined that the CPU usage rate is below the CPU optimum usage range, the appropriate thread count is increased by a predetermined ratio within a range not exceeding the maximum thread count that is the maximum value that can be taken as the proper thread count. . Also, if the CPU utilization is determined to exceed the CPU optimal range of use, reducing the number of appropriate threads in a predetermined ratio by the minimum value minimum number of threads to fall below it should not be a range which is can take a proper threads Let Further, when the measured CPU usage rate falls within the optimum usage range, the appropriate number of threads is fixed to the value at that time.

上記のように構成した本発明によれば、スレッド毎に設定した限界多重度に基づき流量制御が行われるのではなく、起動しているスレッドの全体で実際に使用しているCPUの使用率が最適使用範囲内に入っているか否かに基づき流量制御が行われるので、流量制御のためにスレッド毎の設計値を記憶したテーブル情報をあらかじめ作成する必要がない。本発明において流量制御に必要なのは、CPU最適使用範囲、最大スレッド数などのパラメータの設定だけであるから、管理上の負荷がほとんどない。   According to the present invention configured as described above, the flow rate control is not performed based on the limit multiplicity set for each thread, but the usage rate of the CPU actually used in the entire activated thread is Since the flow rate control is performed based on whether or not it is within the optimum use range, it is not necessary to previously create table information storing design values for each thread for the flow rate control. In the present invention, all that is required for the flow rate control is setting of parameters such as the optimum CPU usage range and the maximum number of threads, so that there is almost no administrative load.

また、本発明によれば、測定されたCPU使用率が最適使用範囲内に入っていないときは、実際のCPU使用率と最適使用範囲との差の大きさに関係なく、適正スレッド数が所定の割合で変更されていく。これにより、適正スレッド数が一気に大きく変わることがなくなり、同時に起動するスレッド数も徐々に増減し、それに伴いCPU使用率も最適使用範囲に徐々に近づいていく。したがって、CPU使用率が急激に上がることによってシステムの処理効率が悪くなってしまったり、CPU使用率が急激に下がることによってシステムのリソースを有効に活用できなくなったりする問題を抑制し、システムの処理効率を向上させることができる。   Further, according to the present invention, when the measured CPU usage rate is not within the optimum usage range, the appropriate number of threads is determined regardless of the difference between the actual CPU usage rate and the optimum usage range. Will be changed at a rate of. As a result, the number of appropriate threads does not change drastically, the number of threads activated simultaneously increases gradually, and the CPU usage rate gradually approaches the optimum usage range accordingly. Therefore, it is possible to suppress the problem that the system processing efficiency deteriorates due to the rapid increase in the CPU usage rate, or the system resources cannot be effectively utilized due to the rapid decrease in the CPU usage rate. Efficiency can be improved.

本実施形態による流量制御装置の機能構成例を示すブロック図である。It is a block diagram which shows the function structural example of the flow control apparatus by this embodiment. 本実施形態のパラメータ記憶部に記憶されるパラメータを示す図である。It is a figure which shows the parameter memorize | stored in the parameter memory | storage part of this embodiment. 本実施形態の適正スレッド数変更部の具体的な処理内容を説明するための図である。It is a figure for demonstrating the specific processing content of the appropriate thread number change part of this embodiment. 本実施形態のスレッド起動部による処理内容を説明するための図である。It is a figure for demonstrating the processing content by the thread starting part of this embodiment. 本実施形態による流量制御装置によって行われる適正スレッド数の変更(流量制御)に関する動作例を示すフローチャートである。It is a flowchart which shows the operation example regarding the change (flow control) of the number of appropriate threads performed by the flow control apparatus by this embodiment.

以下、本発明の一実施形態を図面に基づいて説明する。図1は、本実施形態による流量制御装置の機能構成例を示すブロック図である。図1に示すように、本実施形態の流量制御装置10は、その機能構成として、パラメータ記憶部11、CPU使用率測定部12、CPU使用率判定部13、適正スレッド数変更部14、変更回数測定部15、流量制御テーブル記憶部16およびスレッド起動部17を備えている。なお、流量制御装置10は、実際にはコンピュータのCPUまたはMPU、RAM、ROMなどを備えて構成され、RAMやROMに記憶された流量制御用プログラムが動作することによって上述の各機能構成が実現される。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating a functional configuration example of the flow control device according to the present embodiment. As shown in FIG. 1, the flow rate control device 10 of the present embodiment includes, as its functional configuration, a parameter storage unit 11, a CPU usage rate measurement unit 12, a CPU usage rate determination unit 13, an appropriate thread number changing unit 14, and the number of changes. A measurement unit 15, a flow rate control table storage unit 16, and a thread activation unit 17 are provided. The flow control device 10 is actually configured with a computer CPU or MPU, RAM, ROM, and the like, and the above-described functional configurations are realized by the operation of the flow control program stored in the RAM or ROM. Is done.

パラメータ記憶部11は、スレッドの流量制御を行う際に使用する各種パラメータを記憶する記録媒体である。図2は、パラメータ記憶部11に記憶されるパラメータを示す図である。図2に示すように、本実施形態においてパラメータ記憶部11は、最大スレッド数ThMAX、最小スレッド数ThMIN、CPU最適使用範囲RgOPT、変更確認間隔INTおよび最大変更回数CNTをパラメータとして記憶している。   The parameter storage unit 11 is a recording medium that stores various parameters used when performing thread flow control. FIG. 2 is a diagram illustrating parameters stored in the parameter storage unit 11. As shown in FIG. 2, in the present embodiment, the parameter storage unit 11 stores the maximum thread number ThMAX, the minimum thread number ThMIN, the CPU optimum usage range RgOPT, the change confirmation interval INT, and the maximum change count CNT as parameters.

最大スレッド数ThMAXは、スレッドの同時起動可能数を制限する適正スレッド数の最大値を表すパラメータである。一般的に、同時に起動されるスレッド数が多くなると、CPU使用率は増加する。そのため、CPU使用率が過度に大きくならないようにするためには、スレッドの同時起動可能数を制限する必要がある。このスレッドの同時起動可能数の上限を決めるのが適正スレッド数である。   The maximum thread number ThMAX is a parameter that represents the maximum value of the appropriate thread number that limits the number of threads that can be started simultaneously. In general, as the number of threads activated simultaneously increases, the CPU usage rate increases. Therefore, in order to prevent the CPU usage rate from becoming excessively large, it is necessary to limit the number of threads that can be activated simultaneously. The appropriate number of threads determines the upper limit of the number of threads that can be activated simultaneously.

スレッドの流量制御ではこの適正スレッド数の設定値をCPU使用率に応じて動的に変更するのであるが、設定可能な適正スレッド数の最大値を表すのが最大スレッド数ThMAXというパラメータである。逆に、設定可能な適正スレッド数の最小値を表すのが最小スレッド数ThMINというパラメータである。本実施形態では一例として、最大スレッド数ThMAX=20、最小スレッド数ThMIN=3とする。   In the thread flow control, the set value of the appropriate number of threads is dynamically changed according to the CPU usage rate, and a parameter called the maximum thread number ThMAX represents the maximum value of the settable appropriate number of threads. On the contrary, the minimum thread number ThMIN represents the minimum value of the appropriate number of threads that can be set. In this embodiment, as an example, the maximum thread number ThMAX = 20 and the minimum thread number ThMIN = 3.

CPU最適使用範囲RgOPTは、CPU使用率の最適範囲を表すパラメータである。すなわち、このCPU最適使用範囲RgOPTは、スレッドの流量制御によって維持したいCPU使用率の目標範囲を表す。本実施形態では一例として、CPU使用率=70±5%の範囲をCPU最適使用範囲RgOPTとする。変更確認間隔INTは、適正スレッド数の設定値を変更するか否かの確認を行う時間間隔を表すパラメータである。本実施形態では一例として、変更確認間隔INT=1秒とする。   The CPU optimum usage range RgOPT is a parameter that represents the optimum range of the CPU usage rate. That is, the CPU optimum usage range RgOPT represents a target range of CPU usage rate that is desired to be maintained by controlling the flow rate of the thread. In the present embodiment, as an example, the CPU usage rate = 70 ± 5% range is set as the CPU optimum usage range RgOPT. The change confirmation interval INT is a parameter representing a time interval for confirming whether or not to change the setting value of the appropriate number of threads. In this embodiment, as an example, the change confirmation interval INT = 1 second.

最大変更回数CNTは、後述するように適正スレッド数変更部14が適正スレッド数を所定の割合で連続して変更する回数の最大値を表すパラメータである。すなわち、適正スレッド数変更部14が適正スレッド数を所定の割合で連続して変更する回数は、この最大変更回数CNTというパラメータによって制限される。本実施形態では一例として、最大変更回数CNT=10回とする。   The maximum number of changes CNT is a parameter that represents the maximum value of the number of times that the appropriate thread number changing unit 14 continuously changes the appropriate thread number at a predetermined rate, as will be described later. That is, the number of times the appropriate thread number changing unit 14 continuously changes the appropriate thread number at a predetermined rate is limited by a parameter called the maximum change number CNT. In the present embodiment, as an example, the maximum change count CNT = 10.

CPU使用率測定部12は、CPUの実際の使用率を測定する。CPU使用率は、ある単位時間のうち、CPUが何も処理を実行していない待機状態の時間と、OSやアプリケーションプログラムに従ってCPUが何らかの処理を実行している時間との割合がどの程度であるかを示す値である。   The CPU usage rate measurement unit 12 measures the actual usage rate of the CPU. The CPU usage rate is the ratio of the time during which the CPU is not performing any processing within a certain unit time to the time during which the CPU is performing some processing according to the OS or application program. It is a value indicating

CPU使用率判定部13は、CPU使用率測定部12により測定されたCPU使用率が、パラメータ記憶部11に記憶されているCPU最適使用範囲RgOPTの中に入っているか否かを判定する。すなわち、本実施形態の場合、CPU使用率判定部13は、実際に測定されたCPU使用率が65〜75%の範囲内に入っているか否かを判定する。この判定は、パラメータ記憶部11に記憶されている変更確認間隔INTのパラメータに従って、1秒毎に行う。   The CPU usage rate determination unit 13 determines whether or not the CPU usage rate measured by the CPU usage rate measurement unit 12 is within the CPU optimum usage range RgOPT stored in the parameter storage unit 11. That is, in the present embodiment, the CPU usage rate determination unit 13 determines whether or not the actually measured CPU usage rate is within a range of 65 to 75%. This determination is performed every second according to the parameter of the change confirmation interval INT stored in the parameter storage unit 11.

適正スレッド数変更部14は、CPU使用率判定部13による判定結果に応じて、流量制御テーブル記憶部16に格納されている適正スレッド数の設定値を変更する。具体的には、適正スレッド数変更部14は、CPU使用率測定部12により測定されたCPU使用率が65〜75%のCPU最適使用範囲RgOPT内に入っているとCPU使用率判定部13により判断された場合は、適正スレッド数を現在値に固定する。すなわち、流量制御テーブル記憶部16に格納されている適正スレッド数の設定値は更新しない。   The appropriate thread number changing unit 14 changes the set value of the appropriate thread number stored in the flow rate control table storage unit 16 in accordance with the determination result by the CPU usage rate determining unit 13. Specifically, when the CPU usage rate measured by the CPU usage rate measurement unit 12 falls within the optimal CPU usage range RgOPT of 65 to 75%, the appropriate thread number changing unit 14 determines that the CPU usage rate determination unit 13 If it is determined, the appropriate number of threads is fixed to the current value. That is, the set value of the appropriate number of threads stored in the flow rate control table storage unit 16 is not updated.

一方、CPU使用率の測定値がCPU最適使用範囲RgOPT内に入っていないとCPU使用率判定部13により判断された場合、適正スレッド数変更部14は、パラメータ記憶部11に記憶されている最大スレッド数ThMAXおよび最小スレッド数ThMINを下回らない範囲で、流量制御テーブル記憶部16に格納されている適正スレッド数を所定の割合で変更する。   On the other hand, when the CPU usage rate determination unit 13 determines that the measured value of the CPU usage rate does not fall within the CPU optimum usage range RgOPT, the appropriate thread number changing unit 14 stores the maximum stored in the parameter storage unit 11. The appropriate number of threads stored in the flow rate control table storage unit 16 is changed at a predetermined rate within a range that does not fall below the number of threads ThMAX and the minimum number of threads ThMIN.

ここで、所定の割合は任意に定めることが可能であるが、適正スレッド数の変更によってスレッドの同時起動数が一気に多くならないように、所定の割合は比較的小さな値とするのが好ましい。本実施形態では、所定の割合=1とする。すなわち、適正スレッド数変更部14は、CPU使用率の測定値がCPU最適使用範囲RgOPT内に入っていないとCPU使用率判定部13により判断された場合に、適正スレッド数を1つ増加あるいは減少させる。   Here, the predetermined ratio can be arbitrarily determined, but it is preferable to set the predetermined ratio to a relatively small value so that the number of simultaneous activations of threads does not increase at a stretch by changing the appropriate number of threads. In the present embodiment, the predetermined ratio = 1. That is, the appropriate thread number changing unit 14 increases or decreases the appropriate thread number by one when the CPU usage rate determination unit 13 determines that the measured value of the CPU usage rate is not within the CPU optimum usage range RgOPT. Let

図3は、適正スレッド数変更部14の具体的な処理内容を説明するための図である。CPU使用率判定部13が1秒毎に行う判定において、CPU使用率がCPU最適使用範囲RgOPTを下回っていると判断された場合、つまり、図3においてCPU使用率が65%より小さいゾーンAに属している場合、適正スレッド数変更部14は、パラメータ記憶部11に記憶されている最大スレッド数ThMAX(=20)を超えない範囲で、流量制御テーブル記憶部16の適正スレッド数を判定の都度1つずつ増加させる。   FIG. 3 is a diagram for explaining specific processing contents of the appropriate thread number changing unit 14. In the determination performed by the CPU usage rate determination unit 13 every second, when it is determined that the CPU usage rate is below the CPU optimum usage range RgOPT, that is, in the zone A where the CPU usage rate is less than 65% in FIG. If it belongs, the appropriate thread number changing unit 14 determines the appropriate number of threads in the flow rate control table storage unit 16 every time it does not exceed the maximum thread number ThMAX (= 20) stored in the parameter storage unit 11. Increase by one.

一方、CPU使用率判定部13が1秒毎に行う判定において、CPU使用率がCPU最適使用範囲RgOPTを上回っていると判断された場合、つまり、図3においてCPU使用率が75%より大きいゾーンCに属している場合、適正スレッド数変更部14は、パラメータ記憶部11に記憶されている最小スレッド数ThMIN(=3)を下回らない範囲で、流量制御テーブル記憶部16の適正スレッド数を判定の都度1つずつ減少させる。   On the other hand, in the determination performed by the CPU usage rate determination unit 13 every second, if it is determined that the CPU usage rate exceeds the CPU optimum usage range RgOPT, that is, the zone where the CPU usage rate is higher than 75% in FIG. If it belongs to C, the appropriate thread number changing unit 14 determines the appropriate number of threads in the flow rate control table storage unit 16 within a range that does not fall below the minimum thread number ThMIN (= 3) stored in the parameter storage unit 11. Decrease by 1 each time.

CPU使用率がゾーンAに属しているときに適正スレッド数変更部14が適正スレッド数を1つずつ増やしていくと、スレッドの同時起動数は徐々に増えていく。それに伴い、CPU使用率も徐々に大きくなっていく。そして、CPU使用率がゾーンBのCPU最適使用範囲RgOPT内に入ると、適正スレッド数変更部14は、適正スレッド数の設定値を増やす処理を停止し、そのときの適正スレッド数を維持する。   If the appropriate thread number changing unit 14 increases the appropriate thread number one by one when the CPU usage rate belongs to the zone A, the simultaneous activation number of threads gradually increases. Accordingly, the CPU usage rate gradually increases. When the CPU usage rate falls within the CPU optimum usage range RgOPT of the zone B, the appropriate thread number changing unit 14 stops the process of increasing the set value of the appropriate thread number, and maintains the appropriate thread number at that time.

同様に、CPU使用率がゾーンCに属しているときに適正スレッド数変更部14が適正スレッド数を1つずつ減らしていくと、スレッドの同時起動数は徐々に減っていく。それに伴い、CPU使用率も徐々に小さくなっていく。そして、CPU使用率がゾーンBのCPU最適使用範囲RgOPT内に入ると、適正スレッド数変更部14は、適正スレッド数の設定値を減らす処理を停止し、そのときの適正スレッド数を維持する。   Similarly, when the CPU usage rate belongs to zone C and the appropriate thread number changing unit 14 decreases the appropriate thread number one by one, the number of simultaneous activations of threads gradually decreases. Along with this, the CPU usage rate gradually decreases. When the CPU usage rate falls within the CPU optimum usage range RgOPT of the zone B, the appropriate thread number changing unit 14 stops the process of reducing the set value of the appropriate thread number, and maintains the appropriate thread number at that time.

変更回数測定部15は、適正スレッド数変更部14により適正スレッド数の変更が行われた回数を測定する。すなわち、変更回数測定部15は、CPU使用率がゾーンAに属しているときに、適正スレッド数変更部14が適正スレッド数を1秒毎に1つずつ増加させた回数を測定する。また、変更回数測定部15は、CPU使用率がゾーンCに属しているときに、適正スレッド数変更部14が適正スレッド数を1秒毎に1つずつ減少させた回数を測定する。   The number-of-changes measurement unit 15 measures the number of times the appropriate number of threads has been changed by the appropriate number of threads changing unit 14. That is, when the CPU usage rate belongs to zone A, the change count measurement unit 15 measures the number of times that the appropriate thread number change unit 14 increases the appropriate thread number by one per second. In addition, when the CPU usage rate belongs to zone C, the change count measurement unit 15 measures the number of times that the appropriate thread number change unit 14 decreases the appropriate thread count by one per second.

上述の適正スレッド数変更部14は、CPU使用率の測定値がCPU最適使用範囲RgOPTを下回っているとCPU使用率判定部13により判断された場合において、適正スレッド数を1つずつ増加させる処理が行われた回数として変更回数測定部15により測定された値が最大変更回数CNT(=10回)に達したときに、適正スレッド数を1つずつ増加させることに代えて、流量制御テーブル記憶部16の適正スレッド数を最大スレッド数ThMAXに変更する。   The above-described appropriate thread number changing unit 14 increases the appropriate thread number by one when the CPU usage rate determining unit 13 determines that the measured value of the CPU usage rate is below the CPU optimum usage range RgOPT. When the value measured by the number-of-changes measurement unit 15 reaches the maximum number of changes CNT (= 10 times), the flow control table is stored instead of increasing the appropriate thread number by one. The appropriate number of threads of the unit 16 is changed to the maximum number of threads ThMAX.

また、適正スレッド数変更部14は、CPU使用率の測定値がCPU最適使用範囲RgOPTを上回っているとCPU使用率判定部13により判断された場合において、適正スレッド数を1つずつ減少させる処理が行われた回数として変更回数測定部15により測定された値が最大変更回数CNT(=10回)に達したときに、適正スレッド数を1つずつ減少させることに代えて、流量制御テーブル記憶部16の適正スレッド数を最小スレッド数ThMINに変更する。   Further, the appropriate thread number changing unit 14 reduces the appropriate thread number by one when the CPU usage rate determining unit 13 determines that the measured value of the CPU usage rate exceeds the CPU optimal usage range RgOPT. When the value measured by the number-of-changes measurement unit 15 reaches the maximum number of changes CNT (= 10 times), the flow control table is stored instead of decreasing the appropriate number of threads one by one. The appropriate number of threads in the unit 16 is changed to the minimum number of threads ThMIN.

上述のように、流量制御テーブル記憶部16の適正スレッド数は、スレッドの同時起動数が一気に増えたり減ったりしないように1つずつ変更していくのが原則である。しかし、適正スレッド数を10回連続して変更してもまだ、CPU使用率がCPU最適使用範囲RgOPT内に入らない場合は、より早くCPU使用率がCPU最適使用範囲RgOPTに入るようにすることを優先して、適正スレッド数として設定可能な範囲の最大値(最大スレッド数ThMAX)または最小値(最小スレッド数ThMIN)に適正スレッド数を変更する。   As described above, in principle, the appropriate number of threads in the flow rate control table storage unit 16 is changed one by one so that the number of simultaneous activations of threads does not increase or decrease all at once. However, if the CPU usage rate still does not fall within the CPU optimum usage range RgOPT even after the appropriate number of threads has been changed ten times continuously, the CPU usage rate should fall within the CPU optimum usage range RgOPT sooner. , The appropriate thread number is changed to the maximum value (maximum thread number ThMAX) or the minimum value (minimum thread number ThMIN) that can be set as the appropriate thread number.

スレッド起動部17は、流量制御テーブル記憶部16に記憶されている適正スレッド数を上限として、1つ以上のスレッドを起動する。起動されたスレッドは、OSやアプリケーションプログラムの処理を実行する。具体的には、起動中の各スレッドは、図4に示すように、先入れ先出し(FIFO:First In First Out)のリスト構造でデータを保持するキューに投入されたトランザクションを1つずつ取得し、取得したトランザクションを処理する。   The thread activation unit 17 activates one or more threads with the appropriate number of threads stored in the flow rate control table storage unit 16 as an upper limit. The activated thread executes processing of the OS and application program. Specifically, as shown in FIG. 4, each active thread acquires, one by one, transactions placed in a queue that holds data in a first-in first-out (FIFO) list structure. The completed transaction.

次に、上記のように構成した本実施形態による流量制御装置10の動作を説明する。図5は、本実施形態による流量制御装置10によって行われる適正スレッド数の変更(流量制御)に関する動作例を示すフローチャートである。図5に示すフローチャートは、流量制御装置10に電源が投入されたときに開始する。   Next, the operation of the flow control device 10 according to the present embodiment configured as described above will be described. FIG. 5 is a flowchart showing an operation example related to the change of the appropriate number of threads (flow rate control) performed by the flow rate control device 10 according to the present embodiment. The flowchart shown in FIG. 5 starts when the flow control device 10 is turned on.

図5において、まずCPU使用率測定部12は、CPU使用率を測定する(ステップS1)。次にCPU使用率判定部13は、ステップS1でCPU使用率測定部12により測定されたCPU使用率が、CPU最適使用範囲RgOPTの下限値である65%を下回っているか否かについて判定する(ステップS2)。ここで、CPU使用率が65%を下回っているとCPU使用率判定部13にて判断した場合、CPU使用率判定部13は、CPU使用率測定部12により前回測定されたCPU使用率(図示しないメモリに保存しておく)が、CPU最適使用範囲RgOPTの上限値である75%を超えていたか否かについて判定する(ステップS3)。   In FIG. 5, first, the CPU usage rate measuring unit 12 measures the CPU usage rate (step S1). Next, the CPU usage rate determination unit 13 determines whether or not the CPU usage rate measured by the CPU usage rate measurement unit 12 in step S1 is below 65%, which is the lower limit value of the CPU optimum usage range RgOPT ( Step S2). Here, when the CPU usage rate determination unit 13 determines that the CPU usage rate is less than 65%, the CPU usage rate determination unit 13 determines the CPU usage rate (illustrated) previously measured by the CPU usage rate measurement unit 12. It is determined whether or not (stored in the memory not to be stored) exceeds 75%, which is the upper limit value of the CPU optimum use range RgOPT (step S3).

ここで、前回のCPU使用率が75%を超えていたと判断した場合、前回のCPU使用率が図3のゾーンCにあって、今回のCPU使用率が急にゾーンAに移ったということになる。この場合、変更回数測定部15は適正スレッド数の変更回数のカウント値をゼロにクリアし(ステップS4)、その後処理はステップS7にジャンプする。   Here, when it is determined that the previous CPU usage rate has exceeded 75%, the previous CPU usage rate is in the zone C of FIG. 3 and the current CPU usage rate has suddenly moved to the zone A. Become. In this case, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S4), and the process jumps to step S7.

このように適正スレッド数の変更回数のカウント値をゼロにクリアするのは、以下の理由による。例えば、CPU使用率がゾーンCにあるときに適正スレッド数が9回変更された後、CPU使用率が急にゾーンAに移ったとする。この場合は、ゾーンAで適正スレッド数が1回変更されるだけで適正スレッド数の変更回数が最大変更回数CNT(=10回)となって、適正スレッド数の設定値が一気に最大スレッド数ThMAXとされてしまう(ステップS5→ステップS9の流れ)。よってこれを防ぐために、CPU使用率がゾーンCからゾーンAに急に移ったときは、適正スレッド数の変更回数のカウント値をゼロにクリアするようにしているのである。   The reason why the count value of the number of changes of the appropriate thread number is cleared to zero in this way is as follows. For example, when the CPU usage rate is in zone C, the CPU usage rate suddenly moves to zone A after the appropriate number of threads has been changed nine times. In this case, the number of changes of the appropriate thread number becomes the maximum change number CNT (= 10 times) only by changing the appropriate thread number once in the zone A, and the set value of the appropriate thread number is the maximum thread number ThMAX all at once. (The flow from step S5 to step S9). Therefore, in order to prevent this, when the CPU usage rate suddenly shifts from zone C to zone A, the count value of the number of changes of the appropriate number of threads is cleared to zero.

一方、上記ステップS3で前回のCPU使用率が75%を超えていないと判断した場合、適正スレッド数変更部14は、変更回数測定部15により測定されている適正スレッド数の変更回数が10回に達しているか否かを判定する(ステップS5)。   On the other hand, if it is determined in step S3 that the previous CPU usage rate does not exceed 75%, the appropriate thread number changing unit 14 has changed the appropriate thread number measured by the change number measuring unit 15 10 times. Is determined (step S5).

ここで、適正スレッド数の変更回数がまだ10回に達していないと判断した場合、適正スレッド数変更部14は、流量制御テーブル記憶部16を参照し、適正スレッド数の設定値が最大スレッド数ThMAXになっているか否かを判定する(ステップS6)。適正スレッド数の設定値が最大スレッド数ThMAXになっていなければ、適正スレッド数変更部14は、流量制御テーブル記憶部16の適正スレッド数を1つ増やす(ステップS7)。これに応じて変更回数測定部15は、適正スレッド数の変更回数のカウント値をインクリメントする(ステップS8)。   Here, when it is determined that the number of changes of the appropriate thread number has not yet reached 10, the appropriate thread number changing unit 14 refers to the flow rate control table storage unit 16 and the set value of the appropriate thread number is the maximum number of threads. It is determined whether or not it is ThMAX (step S6). If the setting value of the appropriate thread number is not equal to the maximum thread number ThMAX, the appropriate thread number changing unit 14 increases the appropriate thread number in the flow rate control table storage unit 16 by 1 (step S7). In response to this, the change count measurement unit 15 increments the count value of the change count of the appropriate thread count (step S8).

一方、適正スレッド数の設定値が最大スレッド数ThMAXになっているとステップS6にて判断した場合、適正スレッド数変更部14は流量制御テーブル記憶部16の適正スレッド数を更新せずにそのまま維持する。この場合に変更回数測定部15は、適正スレッド数の変更回数のカウント値をゼロにクリアする(ステップS20)。   On the other hand, if it is determined in step S6 that the setting value of the appropriate thread number is the maximum thread number ThMAX, the appropriate thread number changing unit 14 maintains the appropriate thread number in the flow control table storage unit 16 without updating it. To do. In this case, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S20).

また、上記ステップS5において適正スレッド数の変更回数が10回に達していると判断した場合、適正スレッド数変更部14は、流量制御テーブル記憶部16の適正スレッド数を最大スレッド数ThMAXに変更する(ステップS9)。その後、変更回数測定部15は、適正スレッド数の変更回数のカウント値をゼロにクリアする(ステップS10)。   If it is determined in step S5 that the number of changes of the appropriate thread number has reached 10, the appropriate thread number changing unit 14 changes the appropriate thread number in the flow control table storage unit 16 to the maximum thread number ThMAX. (Step S9). Thereafter, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S10).

上記ステップS2において、CPU使用率が65%を下回っていないとCPU使用率判定部13にて判断した場合、引き続きCPU使用率判定部13は、ステップS1でCPU使用率測定部12により測定されたCPU使用率が、CPU最適使用範囲RgOPTの上限値である75%を上回っているか否かについて判定する(ステップS11)。ここで、CPU使用率が75%を上回っているとCPU使用率判定部13にて判断した場合、CPU使用率判定部13は、CPU使用率測定部12により前回測定されたCPU使用率が、CPU最適使用範囲RgOPTの下限値である65%を下回っていたか否かについて判定する(ステップS12)。   When the CPU usage rate determination unit 13 determines in step S2 that the CPU usage rate is not less than 65%, the CPU usage rate determination unit 13 continues to measure the CPU usage rate measurement unit 12 in step S1. It is determined whether or not the CPU usage rate exceeds 75%, which is the upper limit value of the CPU optimum usage range RgOPT (step S11). Here, when the CPU usage rate determination unit 13 determines that the CPU usage rate exceeds 75%, the CPU usage rate determination unit 13 determines that the CPU usage rate measured last time by the CPU usage rate measurement unit 12 is It is determined whether or not the value is below 65%, which is the lower limit value of the CPU optimum usage range RgOPT (step S12).

ここで、前回のCPU使用率が65%を下回っていたと判断した場合、前回のCPU使用率が図3のゾーンAにあって、今回のCPU使用率が急にゾーンCに移ったということになる。この場合、変更回数測定部15は適正スレッド数の変更回数のカウント値をゼロにクリアし(ステップS13)、その後処理はステップS16にジャンプする。一方、上記ステップS12で前回のCPU使用率が65%を下回っていないと判断した場合、適正スレッド数変更部14は、変更回数測定部15により測定されている適正スレッド数の変更回数が10回に達しているか否かを判定する(ステップS14)。   Here, when it is determined that the previous CPU usage rate is less than 65%, the previous CPU usage rate is in zone A in FIG. 3, and the current CPU usage rate has suddenly moved to zone C. Become. In this case, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S13), and the process jumps to step S16. On the other hand, if it is determined in step S12 that the previous CPU usage rate has not fallen below 65%, the appropriate thread number changing unit 14 has changed the appropriate thread number measured by the change number measuring unit 15 10 times. Is determined (step S14).

ここで、適正スレッド数の変更回数がまだ10回に達していないと判断した場合、適正スレッド数変更部14は、流量制御テーブル記憶部16を参照し、適正スレッド数の設定値が最小スレッド数ThMINになっているか否かを判定する(ステップS15)。適正スレッド数の現在値が最小スレッド数ThMINになっていなければ、適正スレッド数変更部14は、流量制御テーブル記憶部16の適正スレッド数を1つ減らす(ステップS16)。これに応じて変更回数測定部15は、適正スレッド数の変更回数のカウント値をインクリメントする(ステップS17)。   Here, when it is determined that the number of changes of the appropriate thread number has not yet reached 10, the appropriate thread number changing unit 14 refers to the flow rate control table storage unit 16 and the setting value of the appropriate thread number is the minimum thread number. It is determined whether or not it is ThMIN (step S15). If the current value of the appropriate thread number is not equal to the minimum thread number ThMIN, the appropriate thread number changing unit 14 decreases the appropriate thread number in the flow rate control table storage unit 16 by 1 (step S16). In response to this, the change count measurement unit 15 increments the count value of the change count of the appropriate thread count (step S17).

一方、適正スレッド数の設定値が最小スレッド数ThMINになっているとステップS15にて判断した場合、適正スレッド数変更部14は流量制御テーブル記憶部16の適正スレッド数を更新せずにそのまま維持する。この場合に変更回数測定部15は、適正スレッド数の変更回数のカウント値をゼロにクリアする(ステップS20)。   On the other hand, if it is determined in step S15 that the setting value of the appropriate thread number is the minimum thread number ThMIN, the appropriate thread number changing unit 14 maintains the appropriate thread number in the flow control table storage unit 16 without updating it. To do. In this case, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S20).

また、上記ステップS14において適正スレッド数の変更回数が10回に達していると判断した場合、適正スレッド数変更部14は、流量制御テーブル記憶部16の適正スレッド数を最小スレッド数ThMINに変更する(ステップS18)。その後、変更回数測定部15は、適正スレッド数の変更回数のカウント値をゼロにクリアする(ステップS19)。   If it is determined in step S14 that the number of changes of the appropriate thread number has reached 10, the appropriate thread number changing unit 14 changes the appropriate thread number in the flow control table storage unit 16 to the minimum thread number ThMIN. (Step S18). Thereafter, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S19).

上記ステップS11において、CPU使用率が75%を上回ってもいないとCPU使用率判定部13にて判断した場合、CPU使用率はCPU最適使用範囲RgOPTに入っていることになる。この場合、適正スレッド数変更部14は流量制御テーブル記憶部16の適正スレッド数を更新せずにそのまま維持する。この場合に変更回数測定部15は、適正スレッド数の変更回数のカウント値をゼロにクリアする(ステップS20)。   When the CPU usage rate determination unit 13 determines in step S11 that the CPU usage rate does not exceed 75%, the CPU usage rate is within the CPU optimum usage range RgOPT. In this case, the appropriate thread number changing unit 14 maintains the appropriate number of threads in the flow rate control table storage unit 16 without updating it. In this case, the change count measurement unit 15 clears the count value of the change count of the appropriate thread count to zero (step S20).

上記ステップS8,S10,S17,S19,S20の処理の後、流量制御装置10は電源がオフになったか否かを判定する(ステップS21)。ここで、電源がオフになっていないと判断した場合、処理はステップS1に戻る。一方、電源がオフになったと判断した場合、図5に示すフローチャートの動作は終了する。   After the processes in steps S8, S10, S17, S19, and S20, the flow control device 10 determines whether or not the power is turned off (step S21). If it is determined that the power is not turned off, the process returns to step S1. On the other hand, when it is determined that the power is turned off, the operation of the flowchart shown in FIG. 5 ends.

以上詳しく説明したように、本実施形態では、スレッドの実行中にCPU使用率測定部12により測定されたCPU使用率がCPU最適使用範囲RgOPTに入っているか否かを判定し、入っていないと判断した場合に適正スレッド数を変更するようにしている。このように、本実施形態によれば、スレッド毎に設定した限界多重度に基づき流量制御が行われるのではなく、起動しているスレッドの全体で実際に使用しているCPUの使用率が最適使用範囲RgOPT内に入っているか否かに基づき流量制御が行われるので、流量制御のためにスレッド毎の設計値を記憶したテーブル情報をあらかじめ作成する必要がない。本実施形態において流量制御に設定が必要なのは、パラメータ記憶部11に記憶すべき数個のパラメータだけであるから、管理上の負荷を格段に減らすことができる。   As described above in detail, in this embodiment, it is determined whether or not the CPU usage rate measured by the CPU usage rate measurement unit 12 during execution of the thread is within the CPU optimum usage range RgOPT. When judged, the appropriate number of threads is changed. As described above, according to the present embodiment, the flow rate control is not performed based on the limit multiplicity set for each thread, but the usage rate of the CPU that is actually used in the entire activated thread is optimal. Since the flow rate control is performed based on whether or not it is within the use range RgOPT, it is not necessary to previously create table information storing design values for each thread for the flow rate control. In this embodiment, since only a few parameters to be stored in the parameter storage unit 11 need to be set for the flow rate control, the administrative load can be significantly reduced.

また、本実施形態では上述のようなテーブル情報を作成しなくて良いため、稼動するプログラムの数が多くCPU使用率が刻々と変化する大規模システムにも適用することが可能である。例えば、銀行のATMシステムなどで利用されているオンライントランザクション処理(以下、OLTPという)では、トランザクション当たりの処理時間が非常に短い上、単位時間当たりの処理量は時々刻々と変化する特性がある。トランザクションの要求数が時々刻々と変化するため、単位時間当たりの定量的な処理量を定めることができない。つまり、どの程度スレッドを多重化すれば良いのかをあらかじめ予測することが困難である。このため、OLTPでは、スレッド毎の限界多重度の設計値を記憶したテーブル情報をあらかじめ作成することは極めて困難である。これに対し、本実施形態では設計値のテーブル情報を作成しなくて良いため、OLTPのようにCPU使用率が刻々と変化する大規模システムにおいても、より最適化されたスレッドの流量制御を行うことが可能である。   Further, in the present embodiment, since it is not necessary to create the table information as described above, the present invention can be applied to a large-scale system in which the number of running programs is large and the CPU usage rate changes every moment. For example, in online transaction processing (hereinafter referred to as OLTP) used in a bank ATM system or the like, the processing time per transaction is very short, and the processing amount per unit time changes every moment. Since the number of transaction requests changes from moment to moment, it is not possible to determine a quantitative processing amount per unit time. That is, it is difficult to predict in advance how much threads should be multiplexed. For this reason, in OLTP, it is extremely difficult to create in advance table information that stores design values of limit multiplicity for each thread. On the other hand, in the present embodiment, it is not necessary to create table information of design values. Therefore, more optimized thread flow control is performed even in a large-scale system such as OLTP in which the CPU usage rate changes every moment. It is possible.

また、本実施形態によれば、測定されたCPU使用率がCPU最適使用範囲RgOPTに入っていないときは、実際のCPU使用率とCPU最適使用範囲RgOPTとの差の大きさに関係なく、適正スレッド数が原則として1つずつ変更されていく。これにより、適正スレッド数が一気に大きく変わることがなくなり、同時に起動するスレッド数も徐々に増減し、それに伴いCPU使用率もCPU最適使用範囲RgOPTに徐々に近づいていく。したがって、CPU使用率が急激に上がることによってシステムの処理効率がかえって悪くなってしまったり、CPU使用率が急激に下がることによってシステムのリソースを有効に活用できなくなったりすることなく、システムの処理効率を向上させることができる。   Further, according to the present embodiment, when the measured CPU usage rate is not within the CPU optimum usage range RgOPT, the CPU usage rate is appropriate regardless of the difference between the actual CPU usage rate and the CPU optimum usage range RgOPT. In principle, the number of threads is changed one by one. As a result, the number of appropriate threads does not change drastically, the number of threads activated simultaneously increases gradually, and the CPU usage rate gradually approaches the CPU optimum usage range RgOPT. Therefore, the system processing efficiency does not deteriorate when the CPU usage rate suddenly increases, and the system resources cannot be effectively used due to the CPU usage rate decreasing rapidly. Can be improved.

また、本実施形態では、適正スレッド数を10回連続して変更してもまだ、CPU使用率がCPU最適使用範囲RgOPT内に入らない場合は、流量制御テーブル記憶部16の適正スレッド数を最大スレッド数ThMAXまたは最小スレッド数ThMINに変更するようにしている。このような変更回数に応じた適正スレッド数の制御は必ずしも行う必要はないが、これを行うことにより、システムの処理効率をより向上させることができる。適正スレッド数を徐々に変更していくことによってシステムの処理効率を向上させつつ、ある程度まで適正スレッド数を徐々に変更した後は大きく値を変えることにより、CPU使用率がより早くCPU最適使用範囲RgOPTに入るようになるからである。   In this embodiment, if the CPU usage rate still does not fall within the CPU optimum usage range RgOPT even after the appropriate number of threads is changed ten times in succession, the optimum number of threads in the flow rate control table storage unit 16 is maximized. The number of threads is changed to ThMAX or the minimum number of threads ThMIN. It is not always necessary to control the appropriate number of threads according to the number of changes, but by doing so, the processing efficiency of the system can be further improved. By gradually changing the appropriate number of threads to improve the processing efficiency of the system and gradually changing the appropriate number of threads to some extent, the CPU usage rate becomes faster and the CPU optimum usage range This is because it enters RgOPT.

なお、上記実施形態では、適正スレッド数を1つずつ変更していく例について説明したが、これは単なる一例に過ぎない。適正スレッド数を徐々に変更していく所定の割合は、例えば、最大スレッド数ThMAXの値に対して1/x(xは最大スレッド数ThMAXの約数で2以上の値)の値を所定の割合とするなど、最大スレッド数ThMAXとの関係で所定の割合を定めてもよい。また、適正スレッド数を徐々に変更していく所定の割合は、適正スレッド数を増やす場合と減らす場合とで異なる値としてもよい。   In the above embodiment, the example in which the appropriate number of threads is changed one by one has been described, but this is merely an example. The predetermined ratio of gradually changing the appropriate number of threads is, for example, a predetermined value of 1 / x (x is a divisor of the maximum number of threads ThMAX, 2 or more) with respect to the value of the maximum number of threads ThMAX. A predetermined ratio may be determined in relation to the maximum number of threads ThMAX, such as a ratio. Further, the predetermined ratio of gradually changing the appropriate thread number may be different depending on whether the appropriate thread number is increased or decreased.

また、適正スレッド数を徐々に変更していく所定の割合は、変更回数測定部15により測定される適正スレッド数の変更回数に応じて異ならせるようにしてもよい。例えば、適正スレッド数の変更回数がn回までの場合(1≦n<CNT)、流量制御テーブル記憶部16に設定されている現在の適正スレッド数と、最大スレッド数ThMAXまたは最小スレッド数ThMINとの平均値を算出し、当該平均値に適正スレッド数を変更する。そして、適正スレッド数の変更回数がn回より多い場合は適正スレッド数を1つずつ変更するようにしてもよい。   Further, the predetermined ratio of gradually changing the appropriate number of threads may be varied according to the number of changes of the appropriate number of threads measured by the change count measuring unit 15. For example, when the number of changes of the appropriate thread number is up to n (1 ≦ n <CNT), the current appropriate thread number set in the flow control table storage unit 16 and the maximum thread number ThMAX or the minimum thread number ThMIN Is calculated, and the appropriate number of threads is changed to the average value. Then, when the number of changes of the appropriate thread number is more than n times, the appropriate thread number may be changed one by one.

これを具体例で説明する。ここではn=1とする。例えば、流量制御テーブル記憶部16に設定されている現在の適正スレッド数が6で、そのときのCPU使用率が図3のゾーンBにあったとする。その後、CPU使用率がゾーンBからゾーンAに遷移したとする。この場合、適正スレッド数変更部14は、流量制御テーブル記憶部16に設定されている現在の適正スレッド数(=6)と、最大スレッド数ThMAX(=20)の平均値(=13.5)を算出し、当該平均値の小数点以下を切り上げまたは切り下げた値に適正スレッド数を変更する。このように適正スレッド数を変更した後もCPU使用率がゾーンBに戻らずゾーンAのままであれば、その後は適正スレッド数を1つずつ増やしていく。   This will be described with a specific example. Here, n = 1. For example, it is assumed that the current number of appropriate threads set in the flow control table storage unit 16 is 6, and the CPU usage rate at that time is in the zone B in FIG. Thereafter, it is assumed that the CPU usage rate transitions from zone B to zone A. In this case, the appropriate thread number changing unit 14 is the average value (= 13.5) of the current appropriate thread number (= 6) set in the flow rate control table storage unit 16 and the maximum thread number ThMAX (= 20). And the appropriate number of threads is changed to a value obtained by rounding up or down the decimal point of the average value. If the CPU usage rate does not return to zone B and remains in zone A even after the appropriate number of threads is changed in this way, the appropriate number of threads is increased by one thereafter.

このようにすれば、CPU使用率がCPU最適使用範囲RgOPTに入っていないときに(図3のゾーンAまたはゾーンCにあるとき)、適正スレッド数を線形的に増加または減少させるのではなく、対数的に増加または減少させていくことができる。これにより、適正スレッド数を徐々に変更してCPU使用率を緩やかに増減させつつも、CPU使用率がより早くCPU最適使用範囲RgOPTに入るようにすることができる。   In this way, when the CPU usage rate is not within the CPU optimum usage range RgOPT (in the zone A or the zone C in FIG. 3), the appropriate number of threads is not increased or decreased linearly, It can be increased or decreased logarithmically. As a result, it is possible to make the CPU usage rate enter the CPU optimum usage range RgOPT earlier while gradually increasing or decreasing the CPU usage rate by gradually changing the appropriate number of threads.

このような動作は、流量制御装置10に電源が投入されてからCPU使用率が最初にゾーンBに入るまでの間に行うと有効である。電源投入直後は、CPU使用率のブレが大きいことが予想されるが、上述の動作を行うことにより、少しでも早くCPU使用率がゾーンBのCPU最適使用範囲RgOPTに入るようにすることができる。   Such an operation is effective when it is performed between when the flow rate control device 10 is powered on and when the CPU usage rate first enters the zone B. Immediately after the power is turned on, the CPU usage rate is expected to vary greatly. However, by performing the above-described operation, the CPU usage rate can enter the CPU optimum usage range RgOPT of the zone B as soon as possible. .

この場合、適正スレッド数変更部14は、電源投入時にCPU使用率測定部12により測定されたCPU使用率が65%より小さいゾーンAに属している場合、流量制御テーブル記憶部16に設定されているデフォルトの適正スレッド数と最大スレッド数ThMAX(=20)との平均値を算出し、当該平均値の小数点以下を切り上げまたは切り下げた値に適正スレッド数を変更する。また、電源投入時にCPU使用率測定部12により測定されたCPU使用率が75%より大きいゾーンCに属している場合、適正スレッド数変更部14は、流量制御テーブル記憶部16に設定されているデフォルトの適正スレッド数と最小スレッド数ThMIN(=3)との平均値を算出し、当該平均値の小数点以下を切り上げまたは切り下げた値に適正スレッド数を変更する。   In this case, the appropriate thread number changing unit 14 is set in the flow rate control table storage unit 16 when the CPU usage rate measured by the CPU usage rate measurement unit 12 at the time of power-on belongs to the zone A smaller than 65%. An average value of the default appropriate thread number and the maximum thread number ThMAX (= 20) is calculated, and the appropriate thread number is changed to a value obtained by rounding up or down the decimal point of the average value. When the CPU usage rate measured by the CPU usage rate measurement unit 12 when the power is turned on belongs to the zone C larger than 75%, the appropriate thread number changing unit 14 is set in the flow rate control table storage unit 16. An average value of the default appropriate thread number and the minimum thread number ThMIN (= 3) is calculated, and the appropriate thread number is changed to a value obtained by rounding up or down the decimal point of the average value.

また、上記実施形態では、最小スレッド数ThMINをパラメータとして設定しているが、これは必ずしも必要でない。すなわち、CPU使用率が過度に大きくなることを防ぐ目的で、最大スレッド数ThMAXの方だけをパラメータとして設定するようにしてもよい。   In the above embodiment, the minimum thread number ThMIN is set as a parameter, but this is not always necessary. That is, for the purpose of preventing the CPU usage rate from becoming excessively high, only the maximum thread number ThMAX may be set as a parameter.

また、上記実施形態では、CPU使用率測定部12により測定されるCPU使用率の現在値がCPU最適使用範囲RgOPTに入っていないときに適正スレッド数を変更する例について説明したが、本発明はこれに限定されない。例えば、CPU使用率測定部12により1秒毎に測定される直近数回分のCPU使用率の平均値がCPU最適使用範囲RgOPTに入っていないときに適正スレッド数を変更するようにしてもよい。または、CPU使用率測定部12によりCPU使用率を測定する単位回数(例えば、10回)の中で、CPU使用率がCPU最適使用範囲RgOPTに入っていないときの回数の割合が所定値を超えたときに適正スレッド数を変更するようにしてもよい。このような調整方法は、CPU使用率の変動振幅が比較的大きいシステムに適用するのが好適である。これに対して、CPU使用率の現在値に基づき適正スレッド数を調整する方法は、CPU使用率の変動振幅が比較的小さいシステムに適用するのが好適である。   Moreover, although the said embodiment demonstrated the example which changes an appropriate thread number when the present value of CPU usage rate measured by the CPU usage rate measurement part 12 is not in CPU optimal usage range RgOPT, this invention is described. It is not limited to this. For example, the appropriate number of threads may be changed when the average value of the CPU usage rate for the latest several times measured every second by the CPU usage rate measurement unit 12 is not within the CPU optimum usage range RgOPT. Alternatively, the ratio of the number of times when the CPU usage rate is not within the CPU optimum usage range RgOPT in the unit number of times (for example, 10 times) for measuring the CPU usage rate by the CPU usage rate measurement unit 12 exceeds a predetermined value. It is also possible to change the appropriate number of threads. Such an adjustment method is preferably applied to a system in which the fluctuation amplitude of the CPU usage rate is relatively large. On the other hand, the method of adjusting the appropriate number of threads based on the current value of the CPU usage rate is preferably applied to a system in which the fluctuation amplitude of the CPU usage rate is relatively small.

その他、上記実施形態は、何れも本発明を実施するにあたっての具体化の一例を示したものに過ぎず、これによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその精神、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。   In addition, each of the above-described embodiments is merely an example of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. In other words, the present invention can be implemented in various forms without departing from the spirit or main features thereof.

10 流量制御装置
11 パラメータ記憶部
12 CPU使用率測定部
13 CPU使用率判定部
14 適正スレッド数変更部
15 変更回数測定部
16 流量制御テーブル記憶部
17 スレッド起動部
DESCRIPTION OF SYMBOLS 10 Flow control apparatus 11 Parameter memory | storage part 12 CPU usage rate measurement part 13 CPU usage rate determination part 14 Appropriate thread number change part 15 Change frequency measurement part 16 Flow control table memory | storage part 17 Thread starting part

Claims (5)

スレッドの同時起動可能数を制限する適正スレッド数の最大値を表す最大スレッド数、上記適正スレッド数の最小値を表す最小スレッド数、CPU使用率の最適範囲を表すCPU最適使用範囲を含むパラメータを記憶したパラメータ記憶部と、
上記CPU使用率を測定するCPU使用率測定部と、
上記CPU使用率測定部により測定された上記CPU使用率が、上記パラメータ記憶部に記憶されている上記CPU最適使用範囲の中に入っているか否かを判定するCPU使用率判定部と、
上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲の中に入っていると判断された場合は、上記適正スレッド数を現在値に固定する一方、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲の中に入っていないと判断された場合は、上記パラメータ記憶部に記憶されている上記最大スレッド数を超えない範囲で上記適正スレッド数を所定の割合で変更する適正スレッド数変更部とを備え、
上記適正スレッド数変更部は、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲を下回っていると判断された場合は、上記パラメータ記憶部に記憶されている上記最大スレッド数を超えない範囲で上記適正スレッド数を所定の割合で増加させる一方、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲を上回っていると判断された場合は、上記パラメータ記憶部に記憶されている上記最小スレッド数を下回らない範囲で上記適正スレッド数を所定の割合で減少させることを特徴とする流量制御装置。
Parameters including the maximum number of threads that represents the maximum value of the appropriate number of threads that limit the number of threads that can be started simultaneously, the minimum number of threads that represents the minimum value of the appropriate number of threads , and the optimal range of CPU that represents the optimal range of CPU usage Stored parameter storage unit;
CPU usage rate measuring unit for measuring the CPU usage rate,
A CPU usage rate determination unit that determines whether the CPU usage rate measured by the CPU usage rate measurement unit is within the CPU optimum usage range stored in the parameter storage unit;
When the CPU usage rate determining unit determines that the CPU usage rate is within the CPU optimum usage range, the CPU usage rate determining unit fixes the appropriate number of threads to the current value. When it is determined that the CPU usage rate is not within the CPU optimum usage range, the appropriate thread count is changed at a predetermined ratio within a range not exceeding the maximum thread count stored in the parameter storage unit. and an appropriate number of threads changing unit that,
When the CPU usage rate determination unit determines that the CPU usage rate is below the CPU optimal usage range, the appropriate thread number changing unit sets the maximum thread number stored in the parameter storage unit. If the CPU usage rate determination unit determines that the CPU usage rate exceeds the CPU optimal usage range while increasing the appropriate number of threads at a predetermined rate within a range not exceeding, the parameter storage unit A flow rate control device, wherein the appropriate number of threads is decreased at a predetermined rate within a range not less than the minimum number of stored threads .
上記適正スレッド数変更部により上記適正スレッド数の変更が行われた回数を測定する変更回数測定部を更に備え、
上記適正スレッド数変更部は、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲を下回っていると判断された場合において、上記適正スレッド数を所定の割合で増加させる処理が行われた回数として上記変更回数測定部により測定された値が所定値に達したときに、上記適正スレッド数を所定の割合で増加させることに代えて、上記適正スレッド数を上記最大スレッド数に変更することを特徴とする請求項1に記載の流量制御装置。
A change number measuring unit that measures the number of times the appropriate thread number has been changed by the appropriate thread number changing unit;
The appropriate thread number changing unit performs a process of increasing the appropriate thread number at a predetermined rate when the CPU usage rate determining unit determines that the CPU usage rate is below the CPU optimal usage range. When the value measured by the number-of-changes measurement unit reaches a predetermined value, the appropriate number of threads is changed to the maximum number of threads instead of increasing the appropriate number of threads at a predetermined rate. The flow rate control device according to claim 1 .
上記適正スレッド数変更部により上記適正スレッド数の変更が行われた回数を測定する変更回数測定部を更に備え、
上記適正スレッド数変更部は、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲を上回っていると判断された場合において、上記適正スレッド数を所定の割合で減少させる処理が行われた回数として上記変更回数測定部により測定された値が所定値に達したときに、上記適正スレッド数を所定の割合で減少させることに代えて、上記適正スレッド数を上記最小スレッド数に変更することを特徴とする請求項1に記載の流量制御装置。
A change number measuring unit that measures the number of times the appropriate thread number has been changed by the appropriate thread number changing unit;
When the CPU usage rate determination unit determines that the CPU usage rate exceeds the CPU optimal usage range, the appropriate thread number changing unit performs a process of reducing the appropriate thread number at a predetermined rate. When the value measured by the number-of-changes measurement unit reaches a predetermined value, the appropriate number of threads is changed to the minimum number of threads instead of decreasing the appropriate number of threads at a predetermined rate. The flow rate control device according to claim 1 .
CPU使用率を測定する第1のステップと、
上記第1のステップで測定された上記CPU使用率が、CPU使用率の最適範囲を表すパラメータとしてパラメータ記憶部に記憶されているCPU最適使用範囲の中に入っているか否かを判定する第2のステップと、
上記第2のステップで測定された上記CPU使用率が上記CPU最適使用範囲を下回っているか上回っているかを判定する第3のステップと、
上記第3のステップで上記CPU使用率が上記CPU最適使用範囲を下回っていると判断された場合に、スレッドの同時起動可能数を制限する適正スレッド数の最大値を表すパラメータとして上記パラメータ記憶部に記憶されている最大スレッド数を超えない範囲で上記適正スレッド数を所定の割合で増加させる第4のステップと、
上記第3のステップで上記CPU使用率が上記CPU最適使用範囲を上回っていると判断された場合に、上記適正スレッド数の最小値を表すパラメータとして上記パラメータ記憶部に記憶されている最小スレッド数を下回らない範囲で上記適正スレッド数を所定の割合で減少させる第5のステップとを有することを特徴とする流量制御方法。
A first step of measuring CPU utilization;
A second determination is made as to whether or not the CPU usage rate measured in the first step is within the CPU optimal usage range stored in the parameter storage unit as a parameter representing the optimal range of CPU usage rate. And the steps
A third step of determining whether the CPU usage rate measured in the second step is below or above the CPU optimum usage range;
When it is determined in the third step that the CPU usage rate is below the CPU optimum usage range, the parameter storage unit is used as a parameter representing the maximum value of the appropriate number of threads that limits the number of threads that can be activated simultaneously. A fourth step of increasing the appropriate number of threads at a predetermined rate within a range not exceeding the maximum number of threads stored in
The minimum number of threads stored in the parameter storage unit as a parameter representing the minimum value of the appropriate number of threads when it is determined in the third step that the CPU usage rate exceeds the CPU optimum usage range And a fifth step of reducing the appropriate number of threads at a predetermined rate within a range not falling below .
CPU使用率を測定するCPU使用率測定手段、
上記CPU使用率測定手段により測定された上記CPU使用率が、CPU使用率の最適範囲を表すパラメータとしてパラメータ記憶部に記憶されているCPU最適使用範囲の中に入っているか否かを判定するCPU使用率判定手段、および
上記CPU使用率判定手段により上記CPU使用率が上記CPU最適使用範囲を下回っていると判断された場合は、スレッドの同時起動可能数を制限する適正スレッド数の最大値を表すパラメータとして上記パラメータ記憶部に記憶されている最大スレッド数を超えない範囲で上記適正スレッド数を所定の割合で増加させる一方、上記CPU使用率判定部により上記CPU使用率が上記CPU最適使用範囲を上回っていると判断された場合は、上記適正スレッド数の最小値を表すパラメータとして上記パラメータ記憶部に記憶されている最小スレッド数を下回らない範囲で上記適正スレッド数を所定の割合で減少させる適正スレッド数変更手段、
としてコンピュータを機能させるためのコンピュータ読み取り可能な流量制御用プログラム。
CPU usage rate measuring means for measuring CPU usage rate,
CPU for determining whether or not the CPU usage rate measured by the CPU usage rate measuring means is within the CPU optimal usage range stored in the parameter storage unit as a parameter representing the optimal range of CPU usage rate When the CPU usage rate is determined to be below the CPU optimum usage range by the usage rate determination unit and the CPU usage rate determination unit, the maximum value of the appropriate number of threads that limits the number of threads that can be started simultaneously is set. While the appropriate number of threads is increased at a predetermined rate within a range not exceeding the maximum number of threads stored in the parameter storage unit as a parameter to represent , the CPU usage rate is determined by the CPU usage rate determining unit. If it is determined that the number of An appropriate thread number changing means for reducing the appropriate thread number by a predetermined ratio within a range not less than the minimum thread number stored in the parameter storage unit;
A computer-readable flow control program for causing a computer to function as a computer.
JP2009075801A 2009-03-26 2009-03-26 Flow control device and flow control method Active JP5455111B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009075801A JP5455111B2 (en) 2009-03-26 2009-03-26 Flow control device and flow control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009075801A JP5455111B2 (en) 2009-03-26 2009-03-26 Flow control device and flow control method

Publications (2)

Publication Number Publication Date
JP2010231313A JP2010231313A (en) 2010-10-14
JP5455111B2 true JP5455111B2 (en) 2014-03-26

Family

ID=43047096

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009075801A Active JP5455111B2 (en) 2009-03-26 2009-03-26 Flow control device and flow control method

Country Status (1)

Country Link
JP (1) JP5455111B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6387747B2 (en) * 2013-09-27 2018-09-12 日本電気株式会社 Information processing apparatus, failure avoidance method, and computer program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4591310B2 (en) * 2005-10-31 2010-12-01 株式会社日立製作所 Flow control method

Also Published As

Publication number Publication date
JP2010231313A (en) 2010-10-14

Similar Documents

Publication Publication Date Title
US9501320B2 (en) Scheduling threads according to real time bit in predetermined time period or in variable time period of requested time ratio
US20110161978A1 (en) Job allocation method and apparatus for a multi-core system
CN105677000B (en) The system and method for dynamic voltage frequency adjustment
US9424212B2 (en) Operating system-managed interrupt steering in multiprocessor systems
WO2020248227A1 (en) Load prediction-based hadoop computing task speculative execution method
CN110795238B (en) Load calculation method and device, storage medium and electronic equipment
CN112256383A (en) Method, device, equipment and medium for adjusting CPU core number of virtual machine
CN101777009B (en) Load control method of application program
CN111274010B (en) Data control method, device, electronic equipment and storage medium
JP5455111B2 (en) Flow control device and flow control method
JP2010160715A (en) Electronic control unit for vehicle
JP5440937B2 (en) Thread number limiting device, thread number limiting method, and thread number limiting program
JP2010055296A (en) Load sharing program and apparatus
CN105373456A (en) Memory testing method for reducing cache hit rate
JP4591310B2 (en) Flow control method
JP2011108140A (en) Data processor
JP3974065B2 (en) Processor
CN115883357A (en) Soft load server processing method and device, electronic equipment and medium
KR101271854B1 (en) Apparatus and method for scheduling task period
US9152451B2 (en) Method of distributing processor loading between real-time processor threads
JP2006059052A (en) Virtual computer system
JP2016184315A (en) Electronic controller
KR101211817B1 (en) Apparatus and method for scheduling task period
JP2012155596A (en) Task control system and task control method
TW201945931A (en) Data processing device, monitoring method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120312

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130821

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130827

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131011

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: 20131217

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131227

R150 Certificate of patent or registration of utility model

Ref document number: 5455111

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250