TWI763650B - A method and apparatus for obtaining application cluster capacity - Google Patents

A method and apparatus for obtaining application cluster capacity

Info

Publication number
TWI763650B
TWI763650B TW106102248A TW106102248A TWI763650B TW I763650 B TWI763650 B TW I763650B TW 106102248 A TW106102248 A TW 106102248A TW 106102248 A TW106102248 A TW 106102248A TW I763650 B TWI763650 B TW I763650B
Authority
TW
Taiwan
Prior art keywords
capacity
application cluster
application
machine
test
Prior art date
Application number
TW106102248A
Other languages
Chinese (zh)
Other versions
TW201828063A (en
Inventor
劉岳嘉
Original Assignee
香港商阿里巴巴集團服務有限公司
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 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Priority to TW106102248A priority Critical patent/TWI763650B/en
Publication of TW201828063A publication Critical patent/TW201828063A/en
Application granted granted Critical
Publication of TWI763650B publication Critical patent/TWI763650B/en

Links

Images

Abstract

本申請實施例提供了一種獲得應用集群容量的方法和裝置,其中的方法具體包括:設置仿真的待測試的應用集群,所述應用集群包括至少兩個測試機器;對所述應用集群的測試機器進行整體壓測,獲得所述測試機器的平均單機能力;根據所述應用集群的壓力總值及所述測試機器的平均單機能力,計算獲得所述應用集群的容量。本申請實施例透過設置仿真的待測試的應用集群,並對整個仿真的應用集群的多個測試機器進行整體壓測,可以獲得更準確更真實的平均單機能力,進而可以獲得更準確的應用集群的容量。 Embodiments of the present application provide a method and apparatus for obtaining the capacity of an application cluster, wherein the method specifically includes: setting a simulated application cluster to be tested, the application cluster includes at least two test machines; Perform an overall pressure measurement to obtain the average single-machine capacity of the test machine; and calculate and obtain the capacity of the application cluster according to the total pressure of the application cluster and the average single-machine capacity of the test machine. In the embodiment of the present application, by setting up a simulated application cluster to be tested, and performing an overall stress test on multiple test machines of the entire simulated application cluster, a more accurate and more realistic average single-machine capability can be obtained, and a more accurate application cluster can be obtained. capacity.

Description

一種獲得應用集群容量的方法和裝置 A method and apparatus for obtaining application cluster capacity

本申請涉及計算機技術領域,特別是涉及一種獲得應用集群容量的方法和一種獲得應用集群容量的裝置。 The present application relates to the field of computer technology, and in particular, to a method for obtaining the capacity of an application cluster and an apparatus for obtaining the capacity of an application cluster.

在確定各個應用的容量配比時,需要首先計算各應用集群的容量,其中,容量是應用集群所需要的資源實例數(或機器數)。目前,計算應用集群的容量大多是採用人工估算或單機壓測的方法。 When determining the capacity ratio of each application, it is necessary to first calculate the capacity of each application cluster, where the capacity is the number of resource instances (or the number of machines) required by the application cluster. At present, the capacity of computing application clusters is mostly calculated manually or by means of single-machine pressure measurement.

其中,人工估算法是首先預估應用集群要達到的能力或者承受的壓力總值,以及單機的能力,然後用預期要達到的能力(或預估的壓力總值)除以預估單機能力,獲得應用集群的整體容量。在按照該方法求出所有應用的容量後,即可進行各應用的容量配比計算。 Among them, the manual estimation method is to first estimate the capacity to be achieved or the total pressure of the application cluster, as well as the capacity of a single machine, and then divide the expected capacity (or the estimated total pressure) by the estimated single-machine capacity. Get the overall capacity of the application cluster. After the capacity of all applications is obtained according to this method, the capacity ratio calculation of each application can be performed.

單機壓測的方法時使用壓測工具對單個機器進行測試,得到該單個機器的單機能力,然後用與其要達到的能力除以該單機壓測獲得的單機能力,獲得應用集群的整體容量。 The single-machine stress testing method uses stress testing tools to test a single machine to obtain the single-machine capability of the single machine, and then divide the desired capability by the single-machine capability obtained through the single-machine stress testing to obtain the overall capacity of the application cluster.

然後,上述兩種方法得出的單機能力會受各種外圍因 素影響,得出的值可信度不夠,進而會影響應用集群的整體容量的準確度。如在進行某應用的單機壓測時,當前VM(Virtual Manufacturing)所在的宿主機的其它VM資源使用空閒,這樣的話會導致單機能力估算過多的問題,然後用預期能力求應用的總體容量時,會存在資料偏差過大。另外,大促的業務流量模型與常態的業務流量模型差別也比較大,也是影響容量估算不準的一個因素。 Then, the single-machine capacity obtained by the above two methods will be affected by various external factors, and the obtained value is not reliable enough, which will affect the accuracy of the overall capacity of the application cluster. For example, when a single-machine stress test of an application is performed, other VM resources of the host where the current VM (Virtual Manufacturing) is located are idle, which will lead to the problem of overestimating the single-machine capacity, and then use the expected capacity to calculate the overall capacity of the application. There will be too much data bias. In addition, the business flow model of the big promotion is also quite different from the normal business flow model, which is also a factor affecting the inaccurate capacity estimation.

本申請實施例的發明目的在於提供一種獲得應用集群容量的方法,能夠提高應用集群的整體容量的準確度。 The purpose of the invention of the embodiments of the present application is to provide a method for obtaining the capacity of an application cluster, which can improve the accuracy of the overall capacity of the application cluster.

相應的,本申請實施例還提供了一種獲得應用集群容量的裝置,用以保證上述方法的實現及應用。 Correspondingly, the embodiment of the present application further provides an apparatus for obtaining the capacity of an application cluster, so as to ensure the implementation and application of the above method.

為了解決上述問題,本申請公開了一種獲得應用集群容量的方法,包括:設置仿真的待測試的應用集群,所述應用集群包括至少兩個測試機器;對所述應用集群的測試機器進行整體壓測,獲得所述測試機器的平均單機能力;根據所述應用集群的壓力總值及所述測試機器的平均單機能力,計算獲得所述應用集群的容量。 In order to solve the above problem, the present application discloses a method for obtaining the capacity of an application cluster, which includes: setting a simulated application cluster to be tested, the application cluster including at least two test machines; performing overall compression on the test machines of the application cluster The average single-machine capacity of the test machine is obtained; the capacity of the application cluster is obtained by calculation according to the total pressure of the application cluster and the average single-machine capacity of the test machine.

優選的,所述對所述應用集群的測試機器進行整體壓測,獲得所述測試機器的平均單機能力,包括:按照預設的初始壓力值對所述應用集群的測試機器進 行整體壓測;調節壓力值;當所述壓力值達到觸發所述應用集群的限流閾值的壓力值以內的最大值時,獲得所述測試機器的平均單機能力。 Preferably, performing an overall stress test on the test machines of the application cluster to obtain the average single-machine capability of the test machines includes: performing an overall stress test on the test machines of the application cluster according to a preset initial pressure value; Adjust the pressure value; when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, obtain the average single-machine capacity of the test machine.

優選的,所述調節壓力值包括:當所述初始壓力值觸發所述應用集群的限流閾值時,按照預設節距減小壓力值。 Preferably, the adjusting the pressure value includes: when the initial pressure value triggers the current limiting threshold of the application cluster, reducing the pressure value according to a preset pitch.

優選的,所述獲得所述測試機器的平均單機能力,包括:當應用集群的負載能力達到彈性伸縮的縮容閾值時,對所述應用集群進行縮容;當所述應用集群縮容至所述應用集群的負載能力達到所述彈性伸縮的擴容閾值時,將所述應用集群的所述測試機器的每秒平均請求數作為所述測試機器的平均單機能力。 Preferably, obtaining the average single-machine capability of the test machine includes: when the load capacity of the application cluster reaches a shrinking threshold for elastic scaling, shrinking the application cluster; When the load capacity of the application cluster reaches the capacity expansion threshold of the elastic scaling, the average number of requests per second of the test machines of the application cluster is taken as the average single-machine capacity of the test machines.

優選的,所述對所述應用集群進行縮容,包括:按照預設的縮容比例對所述應用集群進行逐步縮容。 Preferably, the reducing the capacity of the application cluster includes: gradually reducing the capacity of the application cluster according to a preset capacity reduction ratio.

優選的,所述方法還包括:在獲取所有應用集群的容量後,計算單個應用集群在所有應用集群中的容量配比。 Preferably, the method further includes: after acquiring the capacities of all application clusters, calculating the capacity ratio of a single application cluster among all application clusters.

優選的,所述方法還包括:根據計劃應用集群的承受能力調節所述應用集群的容量。 Preferably, the method further comprises: adjusting the capacity of the application cluster according to the bearing capacity of the planned application cluster.

優選的,所述根據計劃應用集群的承受能力調節所述應用集群的容量,包括:根據所述計劃應用集群的承受能力與所述應用集群的壓力總值之間的比值調節所述應用集群的容量。 Preferably, the adjusting the capacity of the application cluster according to the bearing capacity of the planned application cluster includes: adjusting the capacity of the application cluster according to the ratio between the bearing capacity of the planned application cluster and the total pressure of the application cluster capacity.

優選的,在所述應用集群的數量為1時,所述應用集群包括:至少兩個測試機器,在所述應用集群的數量大於1時,其中的單個應用集群包括:至少一個測試機器。 Preferably, when the number of the application clusters is 1, the application cluster includes: at least two test machines, and when the number of the application clusters is greater than 1, a single application cluster includes: at least one test machine.

本申請實施例還公開了一種獲得應用集群容量的裝置,包括:仿真單元,被配置為設置仿真的待測試的應用集群,所述應用集群包括至少兩個測試機器;壓測單元,被配置為對所述應用集群的測試機器進行整體壓測,獲得所述測試機器的平均單機能力;容量計算單元,被配置為根據所述應用集群的壓力總值及所述測試機器的平均單機能力,計算獲得所述應用集群的容量。 The embodiment of the present application further discloses an apparatus for obtaining the capacity of an application cluster, including: a simulation unit, configured to set a simulated application cluster to be tested, the application cluster includes at least two test machines; a pressure measurement unit, configured as Perform an overall stress test on the test machines of the application cluster to obtain the average single-machine capacity of the test machines; the capacity calculation unit is configured to calculate the total pressure of the application cluster and the average single-machine capacity of the test machines. Get the capacity of the application cluster.

優選的,所述壓測單元包括:初始化子單元,被配置為按照預設的初始壓力值對所述應用集群的測試機器進行整體壓測;調節子單元,被配置為調節壓力值;獲取子單元,當所述壓力值達到觸發所述應用集群的限流閾值的壓力值以內的最大值時,獲得所述測試機器的平均單機能力。 Preferably, the pressure measurement unit includes: an initialization subunit, configured to perform an overall pressure measurement on the testing machines of the application cluster according to a preset initial pressure value; an adjustment subunit, configured to adjust the pressure value; an acquisition subunit The unit, when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, obtains the average single-machine capability of the test machine.

優選的,所述獲取子單元包括: 縮容子單元,被配置為當應用集群的負載能力達到彈性伸縮的縮容閾值時,對所述應用集群進行縮容;確定子單元,被配置為當所述應用集群縮容至所述應用集群的負載能力達到所述彈性伸縮的擴容閾值時,將所述應用集群的所述測試機器的每秒平均請求數作為所述測試機器的平均單機能力。 Preferably, the obtaining subunit includes: a shrinking subunit, configured to shrink the application cluster when the load capacity of the application cluster reaches a shrinking threshold for elastic scaling; a determining subunit, configured to When the application cluster is scaled down until the load capacity of the application cluster reaches the capacity expansion threshold of the elastic scaling, the average number of requests per second of the test machines of the application cluster is taken as the average single-machine capacity of the test machine.

優選的,所述裝置還包括:容量調節單元,被配置為根據計劃應用集群的承受能力調節所述應用集群的容量。 Preferably, the apparatus further includes: a capacity adjustment unit configured to adjust the capacity of the application cluster according to the bearing capacity of the planned application cluster.

與現有技術相比,本申請實施例包括以下優點:本申請實施例透過設置仿真的待測試的應用集群,並對整個仿真的應用集群的多個測試機器進行整體壓測,可以獲得更準確更真實的平均單機能力,進而可以獲得更準確的應用集群的容量。 Compared with the prior art, the embodiments of the present application include the following advantages: by setting up a simulated application cluster to be tested, and performing an overall pressure test on multiple test machines of the entire simulated application cluster, the embodiment of the present application can obtain a more accurate and The real average single-machine capacity, and then a more accurate application cluster capacity can be obtained.

501‧‧‧仿真單元 501‧‧‧Simulation Unit

502‧‧‧壓測單元 502‧‧‧Pressure measurement unit

503‧‧‧容量計算單元 503‧‧‧Capacity Calculation Unit

601‧‧‧初始化子單元 601‧‧‧Initialization Subunit

602‧‧‧調節子單元 602‧‧‧Regulation sub-unit

603‧‧‧獲取子單元 603‧‧‧Get subunit

701‧‧‧縮容子單元 701‧‧‧Shrinkage sub-unit

702‧‧‧確定子單元 702‧‧‧Determining subunits

801‧‧‧容量調節單元 801‧‧‧Capacity Adjustment Unit

圖1是本申請的一種獲得應用集群容量的方法實施例的步驟流程圖;圖2是本申請中一種對待測試的應用集群的測試機器進行整體壓測,獲得測試機器的平均單機能力的方法實施例的步驟流程圖;圖3是本申請中一種獲得測試機器的平均單機能力方法實施例的步驟流程圖;圖4是本申請的另一種獲得應用集群容量的方法實施 例的步驟流程圖;圖5是本申請的一種獲得應用集群容量的裝置實施例的結構方塊圖;圖6是本申請中一種壓測單元的結構方塊圖;圖7是本申請中一種獲取子單元的結構方塊圖;圖8是本申請的另一種獲得應用集群容量的裝置實施例的結構方塊圖。 FIG. 1 is a flow chart of the steps of an embodiment of a method for obtaining the capacity of an application cluster according to the present application; FIG. 2 is a method implementation of a test machine of the application cluster to be tested in the present application to perform an overall stress test to obtain the average single-machine capacity of the test machine. Fig. 3 is a flow chart of steps of an embodiment of a method for obtaining the average single-machine capacity of a test machine in the present application; Fig. 4 is a flow chart of steps of another embodiment of a method of obtaining application cluster capacity of the present application; Fig. 5 is a structural block diagram of an embodiment of an apparatus for obtaining application cluster capacity according to the present application; FIG. 6 is a structural block diagram of a pressure measurement unit in the present application; FIG. 7 is a structural block diagram of an obtaining sub-unit in the present application; 8 is a structural block diagram of another embodiment of an apparatus for obtaining application cluster capacity according to the present application.

為使本申請的上述目的、特徵和優點能夠更加明顯易懂,下面結合附圖和具體實施方式對本申請作進一步詳細的說明。 In order to make the above objects, features and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and specific embodiments.

參照圖1,示出了本申請的一種獲得應用集群容量的方法實施例的步驟流程圖,具體可以包括如下步驟: Referring to FIG. 1 , a flowchart of steps of a method for obtaining application cluster capacity according to the present application is shown, which may specifically include the following steps:

步驟101,設置仿真的待測試的應用集群,該應用集群可以包括至少兩個測試機器。 Step 101: Set a simulated application cluster to be tested, and the application cluster may include at least two test machines.

本申請實施例中,首先準備好測算多個應用集群容量配比的環境,並從中確定需要進行容量測算的應用集群,該應用集群可能是一個也可能是多個;其中,在所述應用集群的數量為1時,所述應用集群具體可以包括:至少兩個測試機器,在所述應用集群的數量大於1時,其中的單個應用集群具體可以包括:至少一個測試機器。用於獲得應用集群容量的裝置(以下簡稱裝置)在本步驟中首先按照確定出的需要進行容量測算的應用集群對應設置出仿真 環境,也即設置出與需要進行容量測算的應用集群完全相同的應用集群。該裝置設置出的仿真環境與實際應用集群的區別可以是該仿真環境下的應用集群不能對外提供存取,只用來進行容量測算。 In the embodiment of the present application, first prepare an environment for measuring the capacity ratio of multiple application clusters, and determine the application cluster that needs to perform capacity calculation. The application cluster may be one or multiple; wherein, in the application cluster When the number of application clusters is 1, the application cluster may specifically include: at least two test machines, and when the number of the application clusters is greater than 1, a single application cluster may specifically include: at least one test machine. In this step, the device for obtaining the capacity of the application cluster (hereinafter referred to as the device) firstly sets up a simulation environment corresponding to the determined application cluster that needs to perform capacity measurement, that is, sets up a simulation environment that is exactly the same as the application cluster that needs to perform capacity measurement. application cluster. The difference between the simulation environment set by the device and the actual application cluster may be that the application cluster in the simulation environment cannot provide external access and is only used for capacity measurement.

步驟102,對應用集群的測試機器進行整體壓測,獲得測試機器的平均單機能力。 Step 102: Perform an overall stress test on the test machines of the application cluster to obtain the average single-machine capability of the test machines.

在確定出仿真的待測試的應用集群後,對該應用集群的測試機器進行整體壓測。壓測是對線上流量的仿真壓力,具體的可以使用壓測工具對加壓在該應用集群測試機器上的流量進行調控,該整體壓測過程同時針對應用集群下的多個測試機器,而且,該方式可以涉及到多個應用集群的協同壓測,多個應用集群之間存在調用關係,壓測的流量也是仿真線上的真實流量,這樣整體壓測比單機壓測更接近真實。 After the simulated application cluster to be tested is determined, an overall stress test is performed on the test machine of the application cluster. The pressure measurement is the simulated pressure of the online traffic. Specifically, the pressure measurement tool can be used to regulate the flow pressured on the test machine of the application cluster. The overall pressure measurement process is aimed at multiple test machines under the application cluster at the same time, and, This method can involve the collaborative pressure measurement of multiple application clusters. There is a calling relationship between multiple application clusters, and the traffic of the pressure measurement is also the real traffic on the simulation line. In this way, the overall pressure measurement is closer to the reality than the single-machine pressure measurement.

在整體壓測的過程中,本實施例可以直接獲得應用集群下多個測試機器的極限能力,然後透過均值計算獲得測試機器的平均單機能力。也可以是在壓測的過程中引入彈性平台對應用集群的測試機器進行擴容或縮容,進而獲得測試機器的平均單機能力,具體請參見後續實施例的描述。 In the process of the overall stress measurement, this embodiment can directly obtain the limit capabilities of multiple test machines under the application cluster, and then obtain the average single-machine capability of the test machines through mean calculation. It is also possible to introduce an elastic platform during the stress test to expand or shrink the test machine of the application cluster, so as to obtain the average single-machine capability of the test machine. For details, please refer to the description of the subsequent embodiments.

步驟103,根據應用集群的壓力總值及測試機器的平均單機能力,計算獲得應用集群的容量。 Step 103: Calculate the capacity of the application cluster according to the total pressure of the application cluster and the average single-machine capability of the test machine.

在獲得測試機器的單機能力後,即可根據預估的或預設的應用集群的壓力總值及測試機器的平均單機能力,計 算獲得應用集群的容量。具體可以是用應用集群的壓力總值除以測試機器的平均單機能力,得到應用集群的容量。其中,應用集群的壓力總值可以是預先設定的,也可以是按照現有方法預估的,此處不做具體限定。該壓力總值的獲得可以分兩種情況:1、有預設目標值的情況:如這次目標是12W,就照著12W進行壓測;2、不估算目標壓力值的情況,主要是測算現有的總機器資源能夠承受多大的壓力。 After the single-machine capacity of the test machine is obtained, the capacity of the application cluster can be calculated and obtained according to the estimated or preset total pressure of the application cluster and the average single-machine capacity of the test machine. Specifically, the capacity of the application cluster can be obtained by dividing the total pressure of the application cluster by the average single-machine capability of the test machine. The total pressure value of the application cluster may be preset or estimated according to an existing method, which is not specifically limited here. The total pressure can be obtained in two cases: 1. When there is a preset target value: if the target is 12W this time, the pressure measurement is performed according to 12W; 2. When the target pressure value is not estimated, it is mainly to measure the existing pressure How much stress the total machine resources can withstand.

在按照上述方法獲得多個應用集群的容量後,即可進一步調節多個應用集群的容量配比。結合彈性平台後,彈性平台對各個應用集群的容量會作配比調整,在有限的機器資源條件下,多則減,少則擴,最後多個應用集群會被彈性平台調整為一個適合當前壓力的容量配比。 After the capacities of the multiple application clusters are obtained according to the above method, the capacity ratio of the multiple application clusters can be further adjusted. After combining the elastic platform, the elastic platform will adjust the capacity of each application cluster. Under the condition of limited machine resources, more will be reduced, and less will be expanded. Finally, multiple application clusters will be adjusted by the elastic platform to one suitable for the current pressure. capacity ratio.

本申請實施例透過設置仿真的待測試的應用集群,並對整個仿真的應用集群的多個測試機器進行整體壓測,可以獲得更準確更真實的平均單機能力,進而可以獲得更準確的應用集群的容量。 In the embodiment of the present application, by setting up a simulated application cluster to be tested, and performing an overall stress test on multiple test machines of the entire simulated application cluster, a more accurate and more realistic average single-machine capability can be obtained, and a more accurate application cluster can be obtained. capacity.

在本申請的另一實施例中,對應用集群的測試機器進行整體壓測,獲得測試機器的平均單機能力的過程,如圖2所示,可以包括: In another embodiment of the present application, the process of performing an overall stress test on a test machine of an application cluster to obtain the average single-machine capability of the test machine, as shown in FIG. 2 , may include:

步驟201,按照預設的初始壓力值對應用集群的測試機器進行整體壓測。 Step 201 , perform an overall pressure measurement on the test machine of the application cluster according to a preset initial pressure value.

在本步驟中,可以使用壓測工具,按照預設的如用戶指定的初始壓力值對仿真的待測試的應用集群的測試機器 進行整體壓測。 In this step, a pressure measurement tool may be used to perform an overall pressure measurement on the test machine of the simulated application cluster to be tested according to a preset initial pressure value such as a user-specified value.

步驟202,調節壓力值。 Step 202, adjust the pressure value.

如果該初始壓力值過小,遠沒有觸發應用集群的限流閾值,則可以逐漸增大該壓力值,具體可以按照預設的節距逐漸增大壓力值。若該初始壓力值設置過大,觸發了應用集群的限流閾值,則需要降低該壓力值。在降低該壓力值時,壓測工具可以按照預設的節距逐漸減小壓力值。 If the initial pressure value is too small and far from triggering the current limiting threshold of the application cluster, the pressure value may be gradually increased, specifically, the pressure value may be gradually increased according to a preset pitch. If the initial pressure value is set too large and triggers the current limiting threshold of the application cluster, the pressure value needs to be lowered. When reducing the pressure value, the pressure measuring tool can gradually reduce the pressure value according to a preset pitch.

其中,該應用集群的限流閾值是根據預估的該應用集群的極限受壓能力設置的。超過該限流閾值,則說明該應用集群已經達到受壓能力的極限。 The current limiting threshold of the application cluster is set according to the estimated limit pressure capacity of the application cluster. If the current limit threshold is exceeded, it means that the application cluster has reached the limit of the pressure capacity.

透過壓測工具調節壓力值,可以使得壓力回穩,既不會使應用集群發生限流跡象,也不會使壓力過小。 Adjusting the pressure value through the pressure measurement tool can stabilize the pressure, which will neither cause the application cluster to show signs of current limitation nor make the pressure too low.

步驟203,當壓力值達到觸發應用集群的限流閾值的壓力值以內的最大值時,獲得測試機器的平均單機能力。 Step 203, when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, obtain the average single-machine capability of the test machine.

當壓測工具調節的壓力值達到觸發應用集群的限流閾值的壓力值以內的最大值時,即可獲得測試機器的平均單機能力。 When the pressure value adjusted by the pressure measurement tool reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, the average single-machine capacity of the test machine can be obtained.

該獲得測試機器的平均單機能力的方式有多種,例如: There are several ways to obtain the average stand-alone capability of the test machine, such as:

方式一:根據壓力值的最大值計算。 Method 1: Calculate according to the maximum value of the pressure value.

在獲得上述壓力值的最大值後,根據壓力值最大值與應用集群包含的測試機器的數量之間的比值,即可獲得測試機器的平均單機能力。 After obtaining the maximum value of the above-mentioned pressure value, according to the ratio between the maximum value of the pressure value and the number of test machines included in the application cluster, the average single-machine capacity of the test machines can be obtained.

方式二: 本方式中,獲得測試機器的平均單機能力的過程,如圖3所示,可以包括: Method 2: In this method, the process of obtaining the average single-machine capability of the test machine, as shown in Figure 3, may include:

步驟301,當應用集群的負載能力達到彈性伸縮的縮容閾值時,對應用集群進行縮容。 Step 301 , when the load capacity of the application cluster reaches a shrinking threshold for elastic scaling, shrink the application cluster.

本實施例中,彈性伸縮為根據線上應用集群的負載,動態調整應用集群規模的一種機制,該機制不僅可減低成本,而且能夠提升線上應用集群的穩定性。在本申請的一種應用示例中,可透過彈性平台來實現上述彈性伸縮;具體地,當壓力值達到觸發應用集群的限流閾值的壓力值以內的最大值時,可以觸發啟動彈性平台,該彈性平台可以根據線上應用集群的負載,動態調整應用集群的容量。 In this embodiment, elastic scaling is a mechanism for dynamically adjusting the scale of the application cluster according to the load of the online application cluster. This mechanism can not only reduce costs, but also improve the stability of the online application cluster. In an application example of the present application, the above elastic scaling can be implemented through an elastic platform; specifically, when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, the elastic platform can be triggered to start, the elastic The platform can dynamically adjust the capacity of the application cluster according to the load of the online application cluster.

具體的,彈性平台會監測應用集群的負載能力,並設置有負載的縮容閾值和擴容閾值(擴容閥值=限流閥值),當應用集群的負載能力達到縮容閾值時,此時需要對應用集群進行縮容,減小應用集群的規模,當應用集群的負載能力達到擴容閾值時需要擴容,增大應用集群的規模。例如,可以設置CPU負載80%為縮容閾值,CPU負載90%為擴容閾值。 Specifically, the elastic platform will monitor the load capacity of the application cluster, and set the load shrinkage threshold and expansion threshold (expansion threshold = current limit threshold). When the load capacity of the application cluster reaches the shrinkage threshold, it needs to Scale down the application cluster to reduce the scale of the application cluster. When the load capacity of the application cluster reaches the expansion threshold, it needs to be expanded to increase the scale of the application cluster. For example, 80% of the CPU load can be set as the scaling threshold, and 90% of the CPU load can be set as the scaling threshold.

本步驟中,當監測到應用集群的負載能力達到彈性平台的縮容閾值時,該裝置對應用集群進行縮容,具體可以按照預設的縮容比例對應用集群進行逐步縮容。 In this step, when it is detected that the load capacity of the application cluster reaches the shrinkage threshold of the elastic platform, the device shrinks the application cluster, and specifically may gradually shrink the application cluster according to a preset shrinkage ratio.

步驟302,當應用集群縮容至應用集群的負載能力達到上述彈性伸縮的擴容閾值時,將應用集群的測試機器的每秒平均請求數作為測試機器的平均單機能力。 Step 302, when the application cluster is scaled down until the load capacity of the application cluster reaches the above-mentioned elastic scaling expansion threshold, the average number of requests per second of the test machines of the application cluster is taken as the average single-machine capacity of the test machine.

在縮容後,應用集群的負載能力必然會增大,當監測到應用集群縮容至應用集群的負載能力達到彈性平台的擴容閾值時,即可將此時應用集群的測試機器的每秒平均請求數作為測試機器的平均單機能力。 After scaling down, the load capacity of the application cluster will inevitably increase. When it is detected that the load capacity of the application cluster scaled down to the scale of the application cluster reaches the expansion threshold of the elastic platform, the average per second of the test machine of the application cluster can be calculated. The number of requests is taken as the average single-machine capacity of the test machine.

由此可見,該裝置利用彈性伸縮可以根據線上應用集群的負載,動態調整應用集群的容量,不僅可減低成本,並能提升線上應用集群穩定性。 It can be seen that the device can dynamically adjust the capacity of the application cluster according to the load of the online application cluster by using elastic scaling, which can not only reduce the cost, but also improve the stability of the online application cluster.

在利用上述方法獲得測試機器的平均單機能力後,即可執行前述步驟103計算獲得應用集群的容量。 After the average single-machine capacity of the test machine is obtained by using the above method, the foregoing step 103 can be performed to calculate and obtain the capacity of the application cluster.

在本申請的另一實施例中,如圖4所示,該獲得應用集群容量的方法還可以包括: In another embodiment of the present application, as shown in FIG. 4 , the method for obtaining application cluster capacity may further include:

步驟401,根據計劃應用集群的承受能力調節應用集群的容量。 Step 401: Adjust the capacity of the application cluster according to the bearing capacity of the planned application cluster.

本實施例可以應用於大促前的容量準備,當預先計劃了應用集群的承受能力時,可以再根據該計劃應用集群的承受能力對應用集群的容量進行調節。 This embodiment can be applied to the capacity preparation before the big promotion. When the bearing capacity of the application cluster is planned in advance, the capacity of the application cluster can be adjusted according to the bearing capacity of the planned application cluster.

具體的,可以根據計劃應用集群的承受能力(P)與應用集群的壓力總值(L)之間的比值調節應用集群的容量,得到應用集群的線上環境容量。 Specifically, the capacity of the application cluster can be adjusted according to the ratio between the bearing capacity (P) of the planned application cluster and the total pressure (L) of the application cluster, so as to obtain the online environment capacity of the application cluster.

如,可以按照如下公式計算應用集群的線上環境容量=(P/L)*已獲得的應用集群的容量。 For example, the online environment capacity of the application cluster can be calculated according to the following formula=(P/L)*acquired capacity of the application cluster.

該調節過程可以實現應用集群自動化完成大促容量準備。 This adjustment process can realize the automatic completion of the large-scale capacity preparation for the application cluster.

在本申請的一種可選實施例中,所述方法還可以包 括:在獲取所有應用集群的容量後,計算單個應用集群在所有應用集群中的容量配比。假設應用集群的數量為100,則可以分別計算單個應用集群的容量相對于所有應用集群的容量的比例,以得到相應的容量配比。這樣,在計劃應用集群的實際容量不能滿足線上環境容量需求時,可以按照上述容量配比進行單個應用集群的容量的準備。例如,按照上述公式計算得到第i個應用集群的線上環境容量Ci,進一步計算得到所有應用集群的線上環境容量C,則可以基於C進行容量準備;假設準備得到的計劃應用集群的實際容量R小於C,則可以在R和上述容量配比的基礎上進行單個應用集群的容量的分配。 In an optional embodiment of the present application, the method may further include: after acquiring the capacities of all application clusters, calculating the capacity ratio of a single application cluster among all application clusters. Assuming that the number of application clusters is 100, the ratio of the capacity of a single application cluster to the capacity of all application clusters can be calculated separately to obtain a corresponding capacity ratio. In this way, when the actual capacity of the planned application cluster cannot meet the capacity requirement of the online environment, the capacity of a single application cluster can be prepared according to the above-mentioned capacity ratio. For example, the online environment capacity Ci of the i-th application cluster is calculated according to the above formula, and the online environment capacity C of all application clusters can be obtained by further calculation. C, the capacity of a single application cluster can be allocated on the basis of R and the above-mentioned capacity ratio.

為使本領域技術人員更好地理解本申請實施例,在此給出本申請的一種獲得應用集群容量的方法示例,該示例具體可以包括如下步驟: In order for those skilled in the art to better understand the embodiments of the present application, an example of a method for obtaining application cluster capacity in the present application is given here, and the example may specifically include the following steps:

步驟S1、選定待測試的測試機器,並將上述測試機器放置到隔離出來的仿真環境,並且,在上述仿真環境中,可以按照預置比例對上述測試機器進行分組,得到的壓測分組可以與應用集群一一兌現。 Step S1, select the test machine to be tested, and place the above-mentioned test machine in an isolated simulation environment, and, in the above-mentioned simulation environment, the above-mentioned test machines can be grouped according to a preset ratio, and the obtained pressure test group can be the same as the one. Application clusters are fulfilled one by one.

步驟S2、使用壓測工具,按照預置的初始壓力值n,,對壓測分組中的應用集群進行整體壓測; Step S2, using a pressure measurement tool, according to a preset initial pressure value n, to perform an overall pressure measurement on the application clusters in the pressure measurement group;

步驟S3、在該初始壓力值設置過大導致觸發了應用集群的限流閾值的情況下,透過壓測工具可以按照預設的節距逐漸減小壓力值;其中,該預設的節距可以是s%,本申請實施例對於預設的節距的具體數值不加以限制; Step S3: In the case that the initial pressure value is set too large, which triggers the current limiting threshold of the application cluster, the pressure measurement tool can gradually reduce the pressure value according to a preset pitch; wherein, the preset pitch can be: s%, the embodiment of the present application does not limit the specific value of the preset pitch;

步驟S4、在當前壓力值達到觸發應用集群的限流閾值的壓力值以內的最大值時,啟動彈性平台進行應用集群的容量調節; Step S4, when the current pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, start the elastic platform to adjust the capacity of the application cluster;

步驟S5、透過彈性平台監測應用集群的負載能力,並設置負載能力的縮容閾值和擴容閾值(擴容閥值=限流閥值),在應用集群都未觸發擴容閾值的情況下,可以對應用集群進行縮容,減小應用集群的規模;當某個應用集群縮容到一定比例時,負載必定會達到彈性平台的擴容閥值可以將該應用集群的平均單機的gps(每秒請求數,Query Per Second)作為該應用集群的平均單機能力,直到獲取所有應用集群的平均單機能力;上述負載具體可以包括:CPU、請求RT(響應時間,Response Time)以CPU為例,可以設置80%為其縮容閾值、90%為其擴容閾值。 Step S5, monitor the load capacity of the application cluster through the elastic platform, and set the capacity reduction threshold and expansion threshold of the load capacity (expansion threshold = current limit threshold). The cluster is scaled down to reduce the scale of the application cluster; when an application cluster is scaled down to a certain percentage, the load will definitely reach the expansion threshold of the elastic platform. The average single-machine gps (requests per second, Query Per Second) is used as the average single-machine capacity of the application cluster until the average single-machine capacity of all application clusters is obtained; the above load can specifically include: CPU, request RT (response time, Response Time) Taking CPU as an example, it can be set to 80% as Its shrinkage threshold and 90% are its expansion threshold.

步驟S6、由於彈性平台的擴容閥值與限流閥值相同,因為縮容的節距值可能會超出擴容閥值的幾個百分點,為了精確計算應用集群的容量,可以透過擴容對上述平均單機能力進行微調,擴容數量=當前應用集群接受的壓力總量/平均單機能力;在完成所有應用集群的微調後,得到應用集群的當前容量、單個應用集群的容量配比和當前的壓測流量L; Step S6: Since the expansion threshold of the elastic platform is the same as the current limiting threshold, the pitch of the scaling may exceed the expansion threshold by a few percentage points. In order to accurately calculate the capacity of the application cluster, the above average single machine The capacity is fine-tuned, and the amount of capacity expansion = the total pressure received by the current application cluster/average single-machine capacity; after the fine-tuning of all application clusters is completed, the current capacity of the application cluster, the capacity ratio of a single application cluster, and the current pressure measurement flow L are obtained. ;

步驟S7、進行大促容量準備,具體地,可以根據計劃應用集群的承受能力(P)與應用集群的壓力總值(L)之間的比值調節應用集群的容量,得到應用集群的線上環 境容量; Step S7, prepare for large capacity promotion. Specifically, the capacity of the application cluster can be adjusted according to the ratio between the bearing capacity (P) of the planned application cluster and the total pressure (L) of the application cluster, so as to obtain the online environment capacity of the application cluster. ;

步驟S8、根據上述應用集群的線上環境容量,逐個準備應用程式的容量,多則縮,少則擴,全程自動化完成大促容量準備;其中,計劃應用集群的實際容量不能滿足線上環境容量需求時,可以按照上述容量配比進行單個應用集群的容量的準備。 Step S8: According to the online environment capacity of the above application cluster, prepare the capacity of the application programs one by one, the more will be reduced, the less will be expanded, and the large-scale promotion capacity preparation is automatically completed in the whole process; wherein, when the actual capacity of the planned application cluster cannot meet the online environment capacity requirements , the capacity of a single application cluster can be prepared according to the above capacity ratio.

需要說明的是,對於方法實施例,為了簡單描述,故將其都表述為一系列的動作組合,但是本領域技術人員應該知悉,本申請實施例並不受所描述的動作順序的限制,因為依據本申請實施例,某些步驟可以採用其他順序或者同時進行。其次,本領域技術人員也應該知悉,說明書中所描述的實施例均屬於優選實施例,所涉及的動作並不一定是本申請實施例所必須的。 It should be noted that, for the sake of simple description, the method embodiments are expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the described action sequence, because According to the embodiments of the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

參照圖5,示出了本申請一種獲得應用集群容量裝置實施例的結構方塊圖,具體可以包括如下單元: Referring to FIG. 5, it shows a structural block diagram of an embodiment of an apparatus for obtaining application cluster capacity according to the present application, which may specifically include the following units:

仿真單元501,被配置設置仿真的待測試的應用集群,所述應用集群包括至少兩個測試機器。 The simulation unit 501 is configured to set a simulated application cluster to be tested, and the application cluster includes at least two test machines.

壓測單元502,被配置為對所述應用集群的測試機器進行整體壓測,獲得所述測試機器的平均單機能力。 The stress testing unit 502 is configured to perform overall stress testing on the test machines of the application cluster to obtain the average single-machine capability of the test machines.

容量計算單元503,被配置為根據所述應用集群的壓力總值及所述測試機器的平均單機能力,計算獲得所述應用集群的容量。 The capacity calculation unit 503 is configured to calculate and obtain the capacity of the application cluster according to the total pressure of the application cluster and the average single-machine capacity of the test machine.

本申請實施例中,該裝置透過上述單元設置仿真的待測試的應用集群,並對整個仿真的應用集群的多個測試機 器進行整體壓測,可以獲得更準確更真實的平均單機能力,進而可以獲得更準確的應用集群的容量。 In the embodiment of the present application, the device sets up a simulated application cluster to be tested through the above-mentioned units, and performs an overall pressure test on multiple test machines of the entire simulated application cluster, so as to obtain a more accurate and more realistic average single-machine capability, and further can Get a more accurate application cluster capacity.

在另一實施例中,如圖6所示,壓測單元502具體可以包括: In another embodiment, as shown in FIG. 6 , the pressure measurement unit 502 may specifically include:

初始化子單元601,被配置為按照預設的初始壓力值對所述應用集群的測試機器進行整體壓測。 The initialization subunit 601 is configured to perform an overall pressure measurement on the test machine of the application cluster according to a preset initial pressure value.

調節子單元602,被配置為調節壓力值。 The adjustment subunit 602 is configured to adjust the pressure value.

獲取子單元603,當所述壓力值達到觸發所述應用集群的限流閾值的壓力值以內的最大值時,獲得所述測試機器的平均單機能力。 The obtaining subunit 603 obtains the average single-machine capability of the test machine when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster.

其中,調節子單元602,具體可以被配置為當所述初始壓力值觸發所述應用集群的限流閾值時,按照預設節距減小壓力值。 The adjustment subunit 602 may be specifically configured to reduce the pressure value according to a preset pitch when the initial pressure value triggers the current limiting threshold of the application cluster.

在另一實施例中,如圖7所示,獲取子單元603又可以進一步包括: In another embodiment, as shown in FIG. 7 , the obtaining subunit 603 may further include:

縮容子單元701,被配置為當應用集群的負載能力達到彈性伸縮的縮容閾值時,對所述應用集群進行縮容。 The shrinking subunit 701 is configured to shrink the application cluster when the load capacity of the application cluster reaches the shrinking threshold of the elastic scaling.

確定子單元702,被配置為當所述應用集群縮容至所述應用集群的負載能力達到所述彈性伸縮的擴容閾值時,將所述應用集群的所述測試機器的每秒平均請求數作為所述測試機器的平均單機能力。 The determining subunit 702 is configured to use the average number of requests per second of the test machines of the application cluster as The average stand-alone capacity of the test machines.

其中,縮容子單元701,具體可以被配置為按照預設的縮容比例對所述應用集群進行逐步縮容。 The shrinking subunit 701 may be specifically configured to gradually shrink the application cluster according to a preset shrinking ratio.

在另一實施例中,如圖8所示,該裝置還可以包括: In another embodiment, as shown in FIG. 8 , the apparatus may further include:

容量調節單元801,被配置為根據計劃應用集群的承受能力調節所述應用集群的容量。 The capacity adjustment unit 801 is configured to adjust the capacity of the application cluster according to the bearing capacity of the planned application cluster.

該容量調節單元801,具體可以被配置為根據所述計劃應用集群的承受能力與所述應用集群的壓力總值之間的比值調節所述應用集群的容量。 The capacity adjustment unit 801 may be specifically configured to adjust the capacity of the application cluster according to the ratio between the bearing capacity of the planned application cluster and the total pressure of the application cluster.

本申請實施例還提供了一種電子設備,包括儲存器和處理器。 Embodiments of the present application further provide an electronic device, including a storage and a processor.

處理器與儲存器透過匯流排相互連接;匯流排可以是ISA(工業標準結構,Industry Standard Architecture)匯流排、PCI(外部設備互聯,Peripheral Component Interconnect)匯流排或EISA(擴展工業標準結構,Extended Industry Standard Architecture)匯流排等。所述匯流排可以分為地址匯流排、資料匯流排、控制匯流排等。 The processor and the storage are connected to each other through a bus; the bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus Standard Architecture) bus bar, etc. The busbars can be classified into address busbars, data busbars, control busbars, and the like.

其中,儲存器用於儲存一段程式,具體地,程式可以包括程式代碼,所述程式代碼包括計算機操作指令。儲存器可能包含高速RAM儲存器,也可能還包括非揮發性儲存器(non-volatile memory),例如至少一個磁盤儲存器。 Wherein, the storage is used to store a program, and specifically, the program may include program code, and the program code includes computer operation instructions. The storage may include high-speed RAM storage, and may also include non-volatile memory, such as at least one disk storage.

處理器用於讀取儲存器中的程式代碼,執行以下步驟:設置仿真的待測試的應用集群,所述應用集群中包括至少兩個測試機器;對所述應用集群的測試機器進行整體壓測,獲得所述 測試機器的平均單機能力;根據所述應用集群的壓力總值及所述測試機器的平均單機能力,計算獲得所述應用集群的容量。 The processor is used to read the program code in the storage, and perform the following steps: set up a simulated application cluster to be tested, the application cluster includes at least two test machines; perform an overall stress test on the test machines of the application cluster, Obtain the average single-machine capacity of the test machine; calculate and obtain the capacity of the application cluster according to the total pressure of the application cluster and the average single-machine capacity of the test machine.

對於裝置實施例而言,由於其與方法實施例基本相似,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。 As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.

本說明書中的各個實施例均採用遞進的方式描述,每個實施例重點說明的都是與其他實施例的不同之處,各個實施例之間相同相似的部分互相參見即可。 The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.

本領域內的技術人員應明白,本申請實施例的實施例可提供為方法、裝置、或計算機程式產品。因此,本申請實施例可採用完全硬件實施例、完全軟件實施例、或結合軟件和硬件方面的實施例的形式。而且,本申請實施例可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟儲存器、CD-ROM、光學儲存器等)上實施的計算機程式產品的形式。 It should be understood by those skilled in the art that the embodiments of the embodiments of the present application may be provided as methods, apparatuses, or computer program products. Accordingly, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may employ computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein form.

在一個典型的配置中,所述計算機設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和內存記憶體。內存記憶體可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非揮發性內存記憶體等形式,如唯讀記憶體(ROM)或快閃內存記憶體(flash RAM)。內存記憶體是計算機可讀媒體的示例。計算機可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以 是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變內存記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可抹除可編程唯讀記憶體(EEPROM)、快閃記憶體或其他內存技術、唯讀光盤唯讀儲存器(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁磁碟儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,計算機可讀媒體不包括非持續性的電腦可讀媒體(transitory media),如調變的資料信號和載波。 In a typical configuration, the computing device includes one or more processors (CPUs), an input/output interface, a network interface, and memory. Memory memory may include forms of non-persistent memory, random access memory (RAM) and/or non-volatile memory memory in computer readable media, such as read only memory (ROM) or flash memory memory body (flash RAM). Internal memory is an example of a computer-readable medium. Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology for storage of information. Information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM). ), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, magnetic tape, magnetic disk storage or other magnetic storage device or any other non-transmission medium that may be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-persistent computer-readable media (transitory media), such as modulated data signals and carrier waves.

本申請實施例是參照根據本申請實施例的方法、終端設備(系統)、和計算機程式產品的流程圖和/或方方塊圖來描述的。應理解可由計算機程式指令實現流程圖和/或方方塊圖中的每一流程和/或方塊、以及流程圖和/或方方塊圖中的流程和/或方塊的結合。可提供這些計算機程式指令到通用計算機、專用計算機、嵌入式處理機或其他可編程資料處理終端設備的處理器以產生一個機器,使得透過計算機或其他可編程資料處理終端設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方方塊圖一個方框或多個方塊中指定的功能的裝置。 The embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine for executing the instructions by the processor of the computer or other programmable data processing terminal equipment Means are created for implementing the functions specified in a flow or flow of the flowchart and/or a block or blocks of the block diagram.

這些計算機程式指令也可儲存在能引導計算機或其他可編程資料處理終端設備以特定方式工作的計算機可讀儲 存器中,使得儲存在該計算機可讀儲存器中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能。 These computer program instructions may also be stored in computer-readable storage capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer-readable storage produce an article of manufacture comprising instruction means , the instruction means implements the functions specified in the flow or flow of the flowchart and/or the block or blocks of the block diagram.

這些計算機程式指令也可裝載到計算機或其他可編程資料處理終端設備上,使得在計算機或其他可編程終端設備上執行一系列操作步驟以產生計算機實現的處理,從而在計算機或其他可編程終端設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方方塊圖一個方塊或多個方塊中指定的功能的步驟。 These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, so that the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart flow or blocks and/or the block or blocks of the block diagrams.

儘管已描述了本申請實施例的優選實施例,但本領域內的技術人員一旦得知了基本創造性概念,則可對這些實施例做出另外的變更和修改。所以,所附權利要求意欲解釋為包括優選實施例以及落入本申請實施例範圍的所有變更和修改。 Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the embodiments of the present application.

最後,還需要說明的是,在本文中,諸如第一和第二等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在任何這種實際的關係或者順序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要件的過程、方法、物品或者終端設備不僅包括那些要件,而且還包括沒有明確列出的其他要件,或者是還包括為這種過程、方法、物品或者終端設備所固有的要件。在沒有更多限制的情況下,由語句 “包括一個......”限定的要件,並不排除在包括所述要件的過程、方法、物品或者終端設備中還存在另外的相同要件。 Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Furthermore, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or terminal that includes a list of elements includes not only those elements, but also a non-exclusive list of elements. other requirements, or also include requirements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal that includes the element.

以上對本申請所提供的一種獲得應用集群容量的方法和一種獲得應用集群容量的裝置,進行了詳細介紹,本文中應用了具體個例對本申請的原理及實施方式進行了闡述,以上實施例的說明只是用於幫助理解本申請的方法及其核心思想;同時,對於本領域的一般技術人員,依據本申請的思想,在具體實施方式及應用範圍上均會有改變之處,綜上所述,本說明書內容不應理解為對本申請的限制。 A method for obtaining the capacity of an application cluster and an apparatus for obtaining the capacity of an application cluster provided by the present application have been described above in detail. In this paper, specific examples are used to illustrate the principles and implementations of the present application, and the description of the above embodiments It is only used to help understand the method of the present application and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, The contents of this specification should not be construed as limiting the application.

Claims (13)

一種獲得應用集群容量的方法,其特徵在於,包括:設置仿真的待測試的應用集群,該應用集群包括至少兩個測試機器;對該應用集群的測試機器進行整體壓測,獲得該測試機器的平均單機能力;根據該應用集群的壓力總值及該測試機器的平均單機能力,計算獲得該應用集群的容量;其中,該整體壓測利用壓測工具對加壓在該應用集群的測試機器上的流量進行調控,所述獲得該測試機器的平均單機能力,包括:在整體壓測過程中,確定該應用集群的多個測試機器的極限能力;依據該極限能力,確定該測試機器的平均單機能力;及/或在整體壓測過程中,利用彈性平台對該應用集群的測試機器進行擴容或縮容,以得到該測試機器的平均單機能力。 A method for obtaining the capacity of an application cluster, comprising: setting a simulated application cluster to be tested, the application cluster including at least two test machines; performing an overall pressure test on the test machines of the application cluster, and obtaining the Average single-machine capacity; according to the total pressure of the application cluster and the average single-machine capacity of the test machine, calculate the capacity of the application cluster; wherein, the overall pressure measurement uses a pressure measurement tool to pressurize the test machine of the application cluster The said obtaining the average stand-alone capability of the test machine includes: during the overall stress test process, determining the limit capability of multiple test machines in the application cluster; determining the average stand-alone capability of the test machine according to the limit capability and/or during the overall stress test process, use the elastic platform to expand or shrink the test machine of the application cluster to obtain the average single-machine capacity of the test machine. 根據申請專利範圍第1項所述的方法,其中,所述對該應用集群的測試機器進行整體壓測,獲得該測試機器的平均單機能力,包括:按照預設的初始壓力值對該應用集群的測試機器進行整體壓測;調節壓力值; 當該壓力值達到觸發該應用集群的限流閾值的壓力值以內的最大值時,獲得該測試機器的平均單機能力。 The method according to item 1 of the scope of the patent application, wherein the performing an overall stress test on the test machine of the application cluster to obtain the average single-machine capability of the test machine includes: according to a preset initial pressure value for the application cluster The overall pressure test is carried out by the test machine; the pressure value is adjusted; When the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, the average single-machine capacity of the test machine is obtained. 根據申請專利範圍第2項所述的方法,其中,該調節壓力值包括:當該初始壓力值觸發該應用集群的限流閾值時,按照預設節距減小壓力值。 The method according to claim 2, wherein the adjusting the pressure value comprises: when the initial pressure value triggers the current limiting threshold of the application cluster, reducing the pressure value according to a preset pitch. 根據申請專利範圍第2項所述的方法,其中,所述獲得該測試機器的平均單機能力,包括:當應用集群的負載能力達到彈性伸縮的縮容閾值時,對該應用集群進行縮容;當該應用集群縮容至該應用集群的負載能力達到該彈性伸縮的擴容閾值時,將該應用集群的該測試機器的每秒平均請求數作為該測試機器的平均單機能力。 The method according to item 2 of the scope of the patent application, wherein obtaining the average single-machine capability of the test machine includes: shrinking the application cluster when the load capacity of the application cluster reaches a shrinking threshold for elastic scaling; When the application cluster is scaled down until the load capacity of the application cluster reaches the capacity expansion threshold of the elastic scaling, the average number of requests per second of the test machine of the application cluster is taken as the average single-machine capacity of the test machine. 根據申請專利範圍第4項所述的方法,其中,所述對該應用集群進行縮容,包括:按照預設的縮容比例對該應用集群進行逐步縮容。 The method according to item 4 of the scope of the patent application, wherein the reducing the capacity of the application cluster includes: gradually reducing the capacity of the application cluster according to a preset capacity reduction ratio. 根據申請專利範圍第1至5項中任一項所述的方法,其中,該方法還包括:在獲取所有應用集群的容量後,計算單個應用集群在所有應用集群中的容量配比。 The method according to any one of items 1 to 5 in the scope of the application, wherein the method further includes: after acquiring the capacities of all application clusters, calculating the capacity ratio of a single application cluster among all application clusters. 根據申請專利範圍第1至5項中任一項所述的方法,其中,該方法還包括:根據計劃應用集群的承受能力調節該應用集群的容量。 The method according to any one of items 1 to 5 of the scope of the application, wherein the method further comprises: adjusting the capacity of the application cluster according to the bearing capacity of the planned application cluster. 根據申請專利範圍第7項所述的方法,其中,該根據計劃應用集群的承受能力調節該應用集群的容量,包括:根據該計劃應用集群的承受能力與該應用集群的壓力總值之間的比值調節該應用集群的容量。 The method according to item 7 of the scope of the patent application, wherein the adjusting the capacity of the application cluster according to the bearing capacity of the planned application cluster includes: according to the plan, between the bearing capacity of the application cluster and the total pressure of the application cluster The ratio adjusts the capacity of the application cluster. 根據申請專利範圍第1至5項中任一項所述的方法,其中,在該應用集群的數量為1時,該應用集群包括:至少兩個測試機器,在該應用集群的數量大於1時,其中的單個應用集群包括:至少一個測試機器。 The method according to any one of items 1 to 5 of the scope of the patent application, wherein when the number of the application clusters is 1, the application cluster includes: at least two test machines, and when the number of the application clusters is greater than 1 , wherein a single application cluster includes: at least one test machine. 一種獲得應用集群容量的裝置,其特徵在於,包括:仿真單元,被配置為設置仿真的待測試的應用集群,該應用集群包括至少兩個測試機器;壓測單元,被配置為對該應用集群的測試機器進行整體壓測,獲得該測試機器的平均單機能力;容量計算單元,被配置為根據該應用集群的壓力總值及該測試機器的平均單機能力,計算獲得該應用集群的容量;其中,該整體壓測利用壓測工具對加壓在該應用集群的測試機器上的流量進行調控,該壓測單元,包括:第一壓測單元,用於在整體壓測過程中,確定該應用集群的多個測試機器的極限能力;依據該極限能力,確定該測試機器的平均單機能力;及/或第二壓測單元,用於在整體壓測過程中,利用彈性平 台對該應用集群的測試機器進行擴容或縮容,以得到該測試機器的平均單機能力。 An apparatus for obtaining the capacity of an application cluster, comprising: a simulation unit configured to set a simulated application cluster to be tested, the application cluster including at least two test machines; a pressure measurement unit configured to set the application cluster to be tested The overall pressure test of the test machine is performed to obtain the average single-machine capacity of the test machine; the capacity calculation unit is configured to calculate and obtain the capacity of the application cluster according to the total pressure of the application cluster and the average single-machine capacity of the test machine; wherein , the overall pressure measurement uses a pressure measurement tool to regulate the flow of the test machine pressurized on the application cluster. The pressure measurement unit includes: a first pressure measurement unit, which is used to determine the application during the overall pressure measurement process. The limit capacity of multiple test machines in the cluster; according to the limit capacity, the average single machine capacity of the test machine is determined; and/or the second pressure measurement unit, which is used to use elastic leveling during the overall pressure measurement process. Expand or shrink the test machine of the application cluster to obtain the average single-machine capacity of the test machine. 根據申請專利範圍第10項所述的裝置,其中,該壓測單元包括:初始化子單元,被配置為按照預設的初始壓力值對該應用集群的測試機器進行整體壓測;調節子單元,被配置為調節壓力值;獲取子單元,當該壓力值達到觸發該應用集群的限流閾值的壓力值以內的最大值時,獲得該測試機器的平均單機能力。 The device according to claim 10, wherein the pressure measurement unit includes: an initialization subunit configured to perform an overall pressure measurement on the testing machine of the application cluster according to a preset initial pressure value; an adjustment subunit, It is configured to adjust the pressure value; the subunit is obtained, and when the pressure value reaches the maximum value within the pressure value that triggers the current limiting threshold of the application cluster, the average single-machine capacity of the test machine is obtained. 根據申請專利範圍第11項所述的裝置,其中,該獲取子單元包括:縮容子單元,被配置為當應用集群的負載能力達到彈性伸縮的縮容閾值時,對該應用集群進行縮容;確定子單元,被配置為當該應用集群縮容至該應用集群的負載能力達到該彈性伸縮的擴容閾值時,將該應用集群的該測試機器的每秒平均請求數作為該測試機器的平均單機能力。 The device according to item 11 of the scope of the patent application, wherein the acquiring subunit comprises: a scaling subunit, configured to scale down the application cluster when the load capacity of the application cluster reaches a scaling threshold for elastic scaling; determining a subunit, configured to take the average number of requests per second of the test machine of the application cluster as the average single machine of the test machine when the load capacity of the application cluster is scaled down to the capacity expansion threshold of the elastic scaling ability. 根據申請專利範圍第10至12項中任一項所述的裝置,其中,該裝置還包括:容量調節單元,被配置為根據計劃應用集群的承受能力調節該應用集群的容量。 The apparatus according to any one of claims 10 to 12, wherein the apparatus further comprises: a capacity adjustment unit configured to adjust the capacity of the application cluster according to the bearing capacity of the planned application cluster.
TW106102248A 2017-01-20 2017-01-20 A method and apparatus for obtaining application cluster capacity TWI763650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106102248A TWI763650B (en) 2017-01-20 2017-01-20 A method and apparatus for obtaining application cluster capacity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106102248A TWI763650B (en) 2017-01-20 2017-01-20 A method and apparatus for obtaining application cluster capacity

Publications (2)

Publication Number Publication Date
TW201828063A TW201828063A (en) 2018-08-01
TWI763650B true TWI763650B (en) 2022-05-11

Family

ID=63960227

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106102248A TWI763650B (en) 2017-01-20 2017-01-20 A method and apparatus for obtaining application cluster capacity

Country Status (1)

Country Link
TW (1) TWI763650B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6505249B1 (en) * 1999-12-28 2003-01-07 Bellsouth Intellectual Property Corporation Method for optimizing end-to-end processing performance by selecting optimal values after running benchmarks repeatedly with different values
CN104182288A (en) * 2014-08-18 2014-12-03 浪潮电子信息产业股份有限公司 Method for automatically testing power consumption of server cluster system
TW201518950A (en) * 2013-11-12 2015-05-16 Inst Information Industry Cloud auto-test system, method and non-transitory computer readable storage medium of the same
CN104794058A (en) * 2015-05-07 2015-07-22 合肥云中信息科技有限公司 Testing method for cloud desktop virtual environment performance

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6505249B1 (en) * 1999-12-28 2003-01-07 Bellsouth Intellectual Property Corporation Method for optimizing end-to-end processing performance by selecting optimal values after running benchmarks repeatedly with different values
TW201518950A (en) * 2013-11-12 2015-05-16 Inst Information Industry Cloud auto-test system, method and non-transitory computer readable storage medium of the same
CN104182288A (en) * 2014-08-18 2014-12-03 浪潮电子信息产业股份有限公司 Method for automatically testing power consumption of server cluster system
CN104794058A (en) * 2015-05-07 2015-07-22 合肥云中信息科技有限公司 Testing method for cloud desktop virtual environment performance

Also Published As

Publication number Publication date
TW201828063A (en) 2018-08-01

Similar Documents

Publication Publication Date Title
US20220129288A1 (en) Method and apparatus for determining the capacity of an application cluster
TWI755415B (en) Method, device and system for application cluster resource allocation in cloud environment
JP6991983B2 (en) How and systems to train machine learning systems
EP3270316B1 (en) Method and system for user device identification
US10796038B2 (en) Estimating think times
TWI734746B (en) Method and device for simulating online pressure test
CN108039190A (en) A kind of test method and device
CN111562884B (en) Data storage method and device and electronic equipment
CN110827245A (en) Method and equipment for detecting screen display disconnection
JP2019060901A (en) Method for estimating remaining lifetime of structure
CN115718620A (en) Code program migration method, device, equipment and storage medium
CN109254904B (en) Database pressure measurement method and device and electronic equipment
TWI763650B (en) A method and apparatus for obtaining application cluster capacity
CN109446010B (en) AEP memory pressure performance stability testing method and system
CN106708439A (en) Node selection and calculation method and system in distributed file system
CN106909472B (en) Input/output load adjusting method and device of distributed file system
CN110647449A (en) Linpack performance test optimization method and device
TWI774529B (en) Method and system for evaluating performance of cloud-based system
CN104657558A (en) Method for extracting LOD effect model
CN114268557B (en) Fault detection method, device, equipment and storage medium
CN111444068B (en) System performance test method, device, computer equipment and storage medium
CN115424658B (en) Storage unit testing method and device, electronic equipment and storage medium
CN117667614A (en) Method, device, equipment and medium for adjusting response time of pressure measurement system
CN114138619A (en) Method and device for testing software concurrent operation quantity
CN103914119A (en) Electric power measurement method and electric power measurement system for energy consumption of virtual machines