Method and system for real-time resource consumption control in a distributed computing environment
10609176 ยท 2020-03-31
Assignee
Inventors
Cpc classification
H04L67/59
ELECTRICITY
H04L67/10
ELECTRICITY
H04L67/561
ELECTRICITY
H04L67/1001
ELECTRICITY
International classification
Abstract
A system for real-time resource consumption control in a distributed environment and a corresponding method can include a multitude of server instances having access to shared resources, whereby each request for a shared resource issued by a client application is handled by one of the server instances. A global resource consumption counter, representing the overall resource consumption of the multitude of server instances at a given time and a multitude of proxy servers can also be included. Each proxy server can include a receiver module for receiving resource consumption requests issued from a client application, a resource consumption decision module, a queue for collecting resource consumption requests, a local resource consumption counter representing the global resource consumption as seen by the respective proxy server, and/or a synchronization module for synchronizing the global resource consumption counter by interfacing with all other server instances.
Claims
1. A system for real-time resource consumption control in a distributed environment comprising: a multitude of server instances having access to shared resources, each request for a shared resource issued by a client application is handled by one of the server instances, each of the server instances having a processor connected to a non-transitory computer readable medium; a global resource consumption counter, representing an overall resource consumption of the multitude of server instances at a given time; and a multitude of proxy servers, each proxy server comprising a receiver configured to receive resource consumption requests issued from a client application, a queue for collecting resource consumption requests that have been locally accepted by the respective proxy server, a local resource consumption counter, said local resource consumption counter being updated every time a resource consumption request is accepted by the proxy server; each proxy server configured to synchronize the global resource consumption counter with the local resource consumption counter such that synchronizing the local resource consumption counter with the global resource consumption counter occurs by adding an amount of resource consumption of at least one of the requests received by the receiver to update the local resource consumption counter; each proxy server configured so that, for each resource consumption request read from the queue, a difference between the value of the local copy of the global resource consumption counter value and the global resource consumption counter value at the time of synchronization is determined and global resource consumption is projected based on a difference and a time elapsed since a last synchronization of the local copy of the global resource consumption counter and the actual global resource consumption; wherein each proxy server is configured to carry out a decision on whether to accept or to reject a new request read from the queue based on: a provisioned maximum limit for a given resource P, a local resource consumption counter value L, a synchronized global resource consumption value G, and an amount of resources to be consumed by the request R; such that, on every new request, at time t.sub.x, the request is accepted if
P(G.sub.tx)+RP where
2. The system of claim 1, wherein the distributed environment is a Software as a Service (SaaS) environment.
3. The system of claim 1, wherein the system is configured as a network.
4. The system of claim 1, wherein each of the server instances is a computer device.
5. The system of claim 4, wherein each of the proxy servers is a computer device.
6. The system of claim 1, wherein each of the proxy servers is a computer device.
7. The system of claim 1, wherein the global resource consumption counter is a computer device that is communicatively connected to the server instances and/or the proxy servers.
8. The system of claim 1, wherein the system is a communication system.
9. The system of claim 1, wherein a load balancer is configured to distribute requests issued by at least one client application to the multitude of server instances.
10. A communication apparatus comprising: a multitude of proxy servers, each of the proxy servers having a processor connected to a non-transitory computer readable medium, each proxy server also comprising a receiver configured to receive resource consumption requests issued from a client application, a queue for collecting resource consumption requests that have been locally accepted by the respective proxy server, a local resource consumption counter, said local resource consumption counter being updated every time a resource consumption request is accepted by the proxy server; each proxy server configured to synchronize a global resource consumption counter representing an overall resource consumption of a multitude of server instances at a given time with the local resource consumption counter such that synchronizing the local resource consumption counter with the global resource consumption counter occurs by adding an amount of resource consumption of at least one of the requests received by the receiver to update the local resource consumption counter; each proxy server configured so that, for each resource consumption request read from the queue, a difference between the value of the local copy of the global resource consumption counter value and the global resource consumption counter value at the time of synchronization is determined and global resource consumption is projected based on a difference and a time elapsed since a last synchronization of the local copy of the global resource consumption counter and the actual global resource consumption; wherein each proxy server is configured to carry out a decision on whether to accept or to reject a new request read from the queue based on: a provisioned maximum limit for a given resource P, a local resource consumption counter value L, a synchronized global resource consumption value G, and an amount of resources to be consumed by the request R; such that, on every new request, at time t.sub.x, the request is accepted if
P(G.sub.tx)+RP where
11. The communication apparatus of claim 10, wherein the distributed environment is a Software as a Service (SaaS) environment.
12. The communication apparatus of claim 10, wherein the system is configured as a network.
13. The communication apparatus of claim 10 wherein each of the proxy servers is a computer device.
14. The communication apparatus of claim 10, comprising the server instances, each of the service instances being a computer device.
15. The communication apparatus of claim 10, comprising the global resource consumption counter, the global resource consumption counter being a computer device that is communicatively connected to the proxy servers.
16. A computer-implemented method for real-time resource consumption control in a distributed computing environment, the environment comprising: a multitude of proxy servers, each of the proxy servers having a processor connected to a non-transitory computer readable medium, each proxy server also comprising a receiver configured to receive receiving resource consumption requests issued from a client application, a queue for collecting resource consumption requests that have been locally accepted by the respective proxy server, a local resource consumption counter, representing the global resource consumption as seen by the respective proxy server, said local resource consumption counter being updated every time a resource consumption request is accepted, and the method comprising: a) reading, from the queue, the amount of resource consumption of a request received by the receiver that is accepted; b) synchronizing the local resource consumption counter with a global resource consumption counter by adding the amount read in step a) to the global resource consumption counter; c) updating the local resource consumption counter with a local copy of the global resource consumption counter value from step b); d) on every new request read from the queue, determining the difference between the value of the local copy of the global resource consumption counter value and the global resource consumption counter value at the time of synchronization; and e) projecting the global resource consumption based on the difference determined in step d) and the time elapsed since the last synchronization of the local copy of the global resource consumption counter and the actual global resource consumption at the time of each synchronization step; and f) determining whether to accept or to reject each new request based on: a provisioned maximum limit for a given resource P, a local resource consumption counter value L, a synchronized global resource consumption value G, and an amount of resources to be consumed by the request R; such that, on every new request, at time t.sub.x, the new request is accepted if
P(G.sub.tx)+RP where:
17. The method of claim 16, wherein the global resource consumption counter is a counter representing an overall resource consumption of a multitude of server instances at a given time.
18. The method of claim 17, comprising: at least one of the multitude of server instances receiving at least one request for a shared resource issued by the client application.
19. The method of claim 18, comprising: at least one of the multitude of server instances informing one of the proxy servers of the at least one request for the shared resource issued by the client application.
20. The method of claim 16, wherein each of the proxy servers is a computer device.
Description
BRIEF SUMMARY OF THE FIGURES
(1) Exemplary embodiments of the present invention are explained below with reference to the drawings. In the drawings:
(2)
(3)
(4)
DETAILED DESCRIPTION OF THE INVENTION
(5) As noted above, embodiments may provide a method for real-time resource consumption control in a distributed computing environment, wherein this environment comprises a multitude of server instances having access to shared resources, whereby each request for a shared resource issued by a client application is handled by one of the server instances; a global resource consumption counter representing the overall resource consumption of the multitude of server instances at a given time; and a multitude of proxy servers. Each proxy server comprises a receiver module for receiving resource consumption requests issued from a client application, a resource consumption decision module for accepting or rejecting a resource consumption request, a queue for collecting resource consumption requests that have been locally accepted by the respective proxy server, a local resource consumption counter representing the global resource consumption as seen by the respective proxy server, whereby the local resource consumption counter is updated every time a resource consumption request is accepted by the decision module and the updated value being provided in turn as an input to the decision module, and a synchronization module for synchronizing the global resource consumption counter by interfacing with all other server instances.
(6) In a first step, the amount of resource consumption of a request received by the receiver module and accepted by the resource consumption decision module is read from the queue. Subsequently, the local resource consumption counter is synchronized with the global resource consumption counter by adding the amount read in the first step to the global resource consumption counter. Then, the local resource consumption counter is updated with a local copy of the global resource consumption counter value from the second step, and the updated global resource consumption counter value is provided as an input to the resource consumption decision module of the respective proxy server. On every new request read from the queue, the difference between the value of the local copy of the global resource consumption counter value and the global resource consumption counter value at the time of synchronization is determined and the global resource consumption by the decision module is projected based on the difference determined in the preceding step and the time elapsed since the last synchronization of the local copy of the global resource consumption counter and the actual global resource consumption at the time of each synchronization step.
(7) By carrying out the steps of this method, the decision of a decision module, whether a resource consumption request is accepted or rejected, is based on an estimation or projection of the global resource consumption using data which are locally available at each proxy server at the time a decision has to be taken. Thus, there is no need for excessive synchronization between instances.
(8) The solution to the problem also provides a system for real-time resource consumption control in a distributed computing environment. This system comprises a multitude of server instances having access to shared resources, whereby each request for a shared resource issued by a client application is handled by one of the server instances; a global resource consumption counter, representing the overall resource consumption of the multitude of server instances at a given time and a multitude of proxy servers. Each of these proxy servers in turn comprises a receiver module for receiving resource consumption requests issued from a client application, a resource consumption decision module for accepting or rejecting a resource consumption request, a queue for collecting resource consumption requests that have been locally accepted by the respective proxy server, a local resource consumption counter representing the global resource consumption as seen by the respective proxy server, whereby the local resource consumption counter is updated every time a resource consumption request is accepted by the decision module, and the updated value is provided in turn as an input to the decision module. Finally, the system comprises a synchronization module for synchronizing the global resource consumption counter by interfacing with all other server instances.
(9) With such a system, it is possible to determine the resource's availability at each proxy server at the time a decision has to be taken, whether a resource consumption request can be accepted or has to be rejected.
(10) The term resource used herein should be interpreted in a rather broad way. Resource may refer to any physical or virtual entities of limited availability, e.g., memory, processing capacity, network speed, etc.
(11) In some embodiments, the decision module does not have dependencies on other decision modules. The method is therefore fault tolerant as a failure in one decision module does not have effects to other decision modules. A decision can be taken very fast as all calculating means are contained in the decision module, hence the method applies for real time applications, such as communication applications. Decision taking can scale to infinity by employing an unlimited number of decision modules, as all calculating means are contained in each decision module.
(12) According to a further embodiment, the calculating means are self contained in the decision module. Many different sophisticated decision algorithms can be employed.
(13) In a further embodiment, the algorithm parameters on each decision module are periodically adjusted according to global resource consumption.
(14) A further embodiment has a good fault tolerance: On the event of a failure at one server instance, the load balancer directs new resource consumption requests to other server instances. Further, it has a good scalability: As demand for resource consumption increases, new server instances can be added so that new resource consumption requests are balanced across a larger set of server instances.
(15) A still further embodiment has the ability to easily adapt to the increasing/decreasing demand for resource consumption by dynamically allocating computing power (e.g. new server instances) out of a virtually unlimited pool of physical resources.
(16)
(17) A global resource consumption counter G, representing the overall resource consumption of the multitude of server instances S.sub.x at a given time forms part of the distributed computing environment (cf.
(18) The distributed computing environment further comprises a multitude of proxy servers L.sub.x, i.e. (L.sub.1-L.sub.m) being assigned to the server instances S.sub.x (cf.
(19) There are two functions that are running asynchronously and in parallel in every proxy server L.sub.x. Asynchronously in the present case means that both functions are running independently, i.e., one function does not have to wait for the other function to be finished.
(20) The first function concerns a local decision about whether an incoming request can be accepted or not. The individual steps of this function are, in accordance with the numbers 1 to 6 in
(21) The second function concerns a synchronous update of the global resource consumption counter G. The respective steps are, in accordance with the characters A to D in
(22) With respect to the synchronization step B, different embodiments can be envisaged. In one embodiment, there is a central resource management system CRM (cf.
(23) In another embodiment the synchronization is achieved with the use of messages between the nodes. In this scenario, a messaging system is used. All local proxy servers register for events by other proxy servers. On the reception of the event by the other proxy servers, the global resource consumption counter G, which is locally maintained, gets updated. Additional measures might be needed in this case to ensure that the global resource consumption counter G is consistently updated in all local systems.
(24) In still another embodiment a master/slave arrangement between the instances is used to decide how the master copy of the global resource consumption counter G is maintained. Technically, this is similar to the first embodiment, in the sense that all requests queued to a local proxy server S.sub.x are sent to a single server, the difference being that the server receiving the requests and maintaining the global resource consumption counter G is any of the local proxy servers L.sub.x with the master role.
(25) The following table further explains the process of the synchronization of the local resource consumption counter L with the global resource consumption counter G by means of an example:
(26) TABLE-US-00001 Global Re- Proxy #1 Proxy #2 Proxy #3 source con- Time Event (P1) (P2) (P3) sumption (G) t.sub.0 Q = 0 Q = 0 Q = 0 0 L = 0 L = 0 L = 0 t.sub.1 10 .fwdarw. P1, Q = 10 Q = 0 Q = 0 0 L = 10 L = 0 L = 0 t.sub.2 5 .fwdarw. P2, Q = 10 Q = 5 Q = 0 0 L = 10 L = 5 L = 0 t.sub.3 7 .fwdarw. P3, Q = 10 Q = 5 Q = 7 0 L = 10 L = 5 L = 7 t.sub.4 3 .fwdarw. P1, Q = 13 Q = 5 Q = 7 0 L = 13 L = 5 L = 7 t.sub.5 Synch P1 Q = 0 Q = 5 Q = 7 13 L = 13 L = 5 L = 7 t.sub.6 2 .fwdarw. P1, Q = 2 Q = 5 Q = 7 13 L = 15 L = 5 L = 7 t.sub.7 Synch P2 Q = 2 Q = 0 Q = 7 18 L = 15 L = 18 L = 7 t.sub.8 Synch P3 Q = 2 Q = 0 Q = 0 25 L = 15 L = 18 L = 25 t.sub.9 5 .fwdarw. P2, Q = 2 Q = 5 Q = 0 25 L = 15 L = 23 L = 25 t.sub.10 Synch P1, Q = 0 Q = 5 Q = 0 27 L = 27 L = 23 L = 25
(27) The system in the example comprises three proxy servers (P1 to P3). At time t.sub.0 the system has not processed any requests, i.e., the values for the queue Q, the local resource consumption counter L and the global resource consumption counter G are zero. At time t.sub.1 a request for 10 resources is accepted by the decision module Dm of proxy server P1. The queue Q at P1 is incremented by 10, since this amount of resources is not yet synchronized with the global resource consumption counter G. The local resource consumption at P1 is also set to 10, as this is the global resource consumption counter value as seen by P1 at this time.
(28) At time t.sub.2 a request for 5 resources is accepted by the decision module Dm of proxy server P2. In a similar manner as before, the queue Q at P2 is incremented by 5, and the local resource consumption at P2 is also set to 5. The same holds true for times t.sub.3 and t.sub.4 with respect to accepted requests by proxy servers P3 and, again, P1.
(29) At time t.sub.5 the local resource consumption counter L of proxy server P1 is synchronized with the global resource consumption counter G. The global resource consumption is set to 13 (same as the local resource consumption at P1), and the queue Q of proxy server P1 is reset.
(30) The next request for 2 resources arriving at time t.sub.6 at P1 increases the queue Q and the local resource consumption value of P1 by 2.
(31) At time t.sub.7, proxy server P2 synchronizes with the global resource consumption counter G. The locally accepted resources at P2 (L=5) are added to the global resource consumption counter G (13) and the new global resource consumption counter value becomes 18. The queue Q at P2 is reset to 0 and the local resource consumption counter is set to the global resource consumption counter value.
(32) In a similar manner, at time t.sub.8 the data of proxy server P3 are synchronized, i.e., another 7 resources are added to the global resource consumption counter G, the value of G now being 25. The queue Q of P3 is reset and L is updated accordingly.
(33) At time t.sub.9 a request for 5 resources is accepted by the decision module of proxy server P2. In a similar manner as before, the queue Q and the local resource consumption counter are incremented by 5 to Q=5 and L=23.
(34) Finally, at time t.sub.10, proxy server P1 synchronizes again with the global resource consumption counter G. Its queue Q with 2 resources is added to the global resource consumption counter G, which increases the global resource consumption value from 25 to 27. The local resource consumption counter is synchronized with the global resource consumption usage to be 27.
(35) The decision for accepting or rejecting a resource consumption request takes place locally on each proxy server L.sub.x by the resource consumption decision module Dm, taking into account data that are locally available at that specific server.
(36) As already mentioned before, the calculating means present in the decision modules Dm of each proxy server may be represented by a respective algorithm. The following is an example for an algorithm for carrying out the decision by the respective decision module Dm whether to accept or to reject the respective request, thereby using the following inputs:
(37) a. the provisioned maximum limit for the given resource P
(38) b. the local resource consumption counter value L
(39) c. the synchronized global resource consumption value G
(40) d. the amount of resources to be consumed by the request R
(41) On every new request, at time t.sub.x, the request is accepted if
P(G.sub.tx)+RP
where
(42)
(43) P(G.sub.tx) is the projection of global resource consumption G at time t.sub.x, which is the time when a new request arrives. t.sub.s and t.sub.s-1 are the times where synchronization between the global resource consumption G and its local copy L occurred prior to t.sub.x G.sub.t and L.sub.t are the global and local resource consumption, respectively, at time t.
EXAMPLE
(44) Consider the above example of a file sharing service, where a group of users has purchased a license for 100 GB of storage. The service is provided by N servers. The following events occur (where n/a means not applicable):
(45) TABLE-US-00002 Local Global New Usage Usage Local Time Event (L.sub.t) (G.sub.t) Projected Usage P(G.sub.t) Limit Decision Usage L.sub.t.sub.
(46) At time t.sub.0, the local proxy server P1 synchronizes with the global resource consumption counter G. The local usage is updated to 40.
(47) Five seconds later, at time t.sub.1, the local proxy server synchronizes again and the local resource consumption value is updated to 50.
(48) At time t.sub.2, i.e., ten seconds after t.sub.0, a new request for 5 GB file upload is received. The decision module Dm projects the global resource consumption applying the formula for P(G.sub.t) as follows:
(49)
(50) The result is that P(G.sub.2)=60, hence the request is accepted and the local resource consumption value is increased to 55.
(51) In a similar manner, another request for 10 GB file upload is accepted at time t.sub.3, and the local resource consumption value is increased to 65.
(52) At time t.sub.4, the proxy server synchronizes again with the global resource consumption counter G. As a result of this synchronization, the local resource consumption value is set equal to the global resource consumption value at time t.sub.4, i.e., to 90.
(53) At time t.sub.5, a new request for a 10 GB file upload is received. The projection of the global usage is now the following:
(54)
(55) The projected usage is thus calculated at 92 GB. Given the limit of 100 GB and the size of the file upload request, 10, the request is rejected.
(56) In some embodiments more complex projection algorithms can be used. In some other embodiments, new requests are always accepted until the local resource consumption counter exceeds a certain threshold relative to the provisioned limit.