Sharing Energy for Optimal Edge Performance

. Using the Energy Packet Network (EPN) model, we show how energy can be shared between heterogenous servers at the edge to minimize the overall average response time of jobs. The system is modeled as a probabilistic network where energy and jobs are being dispatched to the edge servers using G-Networks with a product-form solution for the equilibrium probability distribution of system state. The approach can also be used to design energy dispatching systems when renewable energy is used to improve the sustainability of edge computing.


Introduction
Heterogeneous sensors, other digital devices and computer servers or workstations (WS) are being incorporated into the Internet of Things (IoT) [33,28,41,3,7] to manage cities, services and industry [44] with applications in practically all areas of socuial activity [4,26,1], creating massive energy requirements that can benefit from energy harvesting from wind, fluid flows, photovoltaic, and electromagnetic fields, with energy stores (ES) such as batteries to buffer the effect of intermittent energy sources [40,5,36]. Harvested energy can contribute to the sustainability of information and computer technology (ICT) [39,19], but it raises new questions. Research is needed to understand how system Quality of Service (QoS) can be maintained in the presence of intermittent harvested energy [42,34,17,6,10,30], including optimal network routing for energy savings [35,31], data transmission for scheduling for energy usage optimization [2], and greater energy efficiency in data centers [32] needed to process the massive data from the IoT.
Recent work on the Energy Packet Network (EPN) paradigm [14][15][16]9] has proposed a discrete state-space modeling approach to evaluate the QoS and energy consumption in systems where computer jobs, data packets, and energy packets (EPs), interact in complex interconnected information processing and data transmission systems. EPNs were recently applied to backhaul networks operatig with renewable energy sources [18]. Other work has suggested hardware schemes for simultaneously forwarding both data packets and energy [38,37].
Previous work [25], discussed some optimization algorithms based on qeueing networks for dispatching network packets so as to minimize a composite cost function that combines overall network energy consumption and QoS. In [20], the EPN model has been used to study architectures which interconnect energy prosumer systems, so that energy consumption and leakage, and the response time to service requests, are minimized. In [21] a utility function, which is a linear combination of the throughput and the probability that the system does not run out of energy, maximized. The EPN paradigm has recently generated interest and further work [24,9,43,29] to model and optimize sensor networks and servers that operate with harvested energy.
In this paper we consider servers or workstations (WS), each of which is powered by a battery or energy store (ES) which is charged from a source of intermittent energy such as wind or photovoltaic. We assume that the energy is represented by discretized EPs, where one EP is the amount of energy needed to process one or more jobs depending on the different jobs being considered; this approach generalizes previous work where one EP corresponds to the amount of energy needed to process exactly one job or forward on data packet. EPs can also circulate in the system so that an ES can process transfer them to other WSs. Energy in batteries may be lost through leakage at a rate that depends on the particular EB.
Based on these assumptions, we assume that neither EPs nor jobs may be moved are not moved between WSs, and that the system receives a total fixed power rate, expressed in EPs per second. We are given a fixed distribution for the number of jobs that a single EP can process at any given WS, but this distribution may be different at the different WSs. The problem is then to select the fraction of jobs that we send to each of the WSs so as to minimize the overall average response time W of jobs. The case where we move a fraction D i of the jobs at node i to some other server j according to a probability matrix M = [M ij ] is discussed in [27].
In Section 2, we briefly discuss G-Networks, and relate the EPN model to this more general queueing network model. We present the EPN model parameters in Section 3. Then we detail the optimization problem and a numerical example. We present conclusions and suggestions for further work in Section 4.

EPN and its G-Network Representation
The EPN system considered is schematically presented in Figure 1. In the approach taken in this paper, jobs or tasks that need to be executed in the system are modelled as ordinary customers in a queueing network. They arrive to any one of N WSs which are represented as queues. Jobs first arrive to a given WS, call it W i , at rate λ i jobs/sec. Each W i has an energy storage battery denoted E i , so that there are a total of N ESs. EPs arrive from an external intermittent energy source at rate γ i EPs/sec to E i which can be viewed as a "queue of EPs". We denote the number of jobs at WS W i at time t by K i (t), while B i (t) denotes the number of EPs at E i . EPs at the E i are expended (locally consumed) or moved in the following manner: -If B i (t) > 0 then E i will leak energy at some rate δ i ≥ 0 EPs/sec. Thus when B i (t) > 0, after a time of average value δ −1 i , we will have one less EP at ES i due to energy leakage.
-ES S i provides EPs at rate w i when B i (t) > 0. With probability M ij an EP is moved to another other E j so that B i (t + ) = B i (t) − 1, and B j (t + ) = B j (t) + 1. Such transfers may be made to share energy with other ESs which are being depleted more rapidly. -Or with probability d i = 1 − N j=1 P ij the EP is forwarded to W i and with probability 1 ≥ D i ≥ 0, one EP is expended to serve a batch of up to b i jobs at the WS. If K i (t) > 0 then the EP will serve max[K i (t), b i ] jobs in one step and after service we end up with Since different jobs may have different energy requirements when running at a given W i , we assume that b i (i.e., the number of jobs that are processed with a single EP at W i ), is a random variable with probability distribution > 0 one EP will be used to serve just one job, and then forward that job to another W j according to the transition -If an EP arrives to a WS i and K i (t) = 0, then the EP will just be expended to keep the WS in working order, and no jobs will be processed or moved.

The G-Network Model
The EP is a special case of G-Networks [12,11,8] which are queueing networks that have the remarkable"product form solution" which simplifies their computational structure. An EPN is a multi-class G-Network with Batch Removal [13,23]. This is an open queueing network with v of service stations or WSs. The EPN "jobs" can be computer programs that need to be executed, or data packets that need to be transmitted, and belong to one of C classes. Each ach customer class has distinct arrival rates to the network, and distinct routing probabilities in the network. Customer also belong to three Types, of "positive" and "negative" customers, or "triggers". Other types of customers include "resets" [22] and "adders" [8].
Positive customers are the normal queueing network customers which request and obtain service at the queues, and belong to one of the C classes. At all of the v queues, positive customers have i.i.d. exponential service times of rate r(1), . . . , r(v) which are identical for all classes of customers. After completing service and leaving a node i, a positive customer of class c can change into a positive customer of class c at node j with probability Π + c,i,c ,j , the corresponding transition probability matrix is Π + = [Π + c,i,c ,j ], or the positive customer leaves the network with probability l c,i , or it changes into a negative customer of class c and join node j with probability Π − c,i,c ,j , in which case it will remove, or "instantaneously serve", a batch of positive customers of class c , and the batch is of maximum size B j,c ,j at queue j, where B c ,j is a random variable with probability distribution π c ,j,s = Pr[B c ,j = s] ≥ 0, s ≥ 1. If a negative customer of class c at node i arrives to queue j as a class c customer at time t, and the number positive customers of class c at j is K c ,j (t), then a total of max [K c ,j (t), B c ,j ] positive customers of class c will be instantaneously removed from the queue at j so that K c , , and the negative customer disappears at time t + . If K c ,j (t) = 0 then the negative customer disappears and no customer is removed from queue j. The positive customer of class c leaving queue i can become a "trigger" of class c at queue j with probability Π T c,i,c ,j , in which case it will move a class c customer from queue j to queue l, and that customer becomes a class c customer at queue l, with probability Q c ,j,c ,l ≥ 0. If queue j does not contain a class c customer when the trigger arrives to queue j, then no customer is transferred from j to l, and the trigger disappears. These probabilities that we have satisfy: Q c ,j,c ,l , and 1 = ∞ s=1 π c ,j,s , f or all c , j.
The effect of a negative customer and of a trigger are instantaneous: they occur in zero time; i.e. the effect of a negative customer or trigger arriving to a queue at time t will modify the queue's state at time t + . Furthermore, both a negative customer and a trigger will themselves disappear after they have visited queue j. Queues also have external positive, negative and trigger arrivals of rates λ + c,i , λ − c,i , λ T c,i which can differ for each class c and queue i, according to independent Poison processes at each of the queues. Furthermore, externally arriving customers will have exactly the same effect at a queue as the ones that arrive from another queue.
Let Λ + c,i , Λ − c,i , Λ T c,i denote the total arrival rate to queue i of class c customers that are of positive, negative and of trigger type, respectively. Then the "traffic equations" for the system are given by: (1) In the sequel we will assume that at any queue i only positive, negative customers, and triggers of a single class c i can arrive. Thus for a specific c i we Also we assume that service rates are the same for all classes of positive customers r(c , i) = r(c, i) = r(i). As a consequence we have: ( With these assumptions, the following result follows from previous work [13,23]: Result Let K(t) = (K 1 (t), ... , K v (t)). If the equations (1) have an unique solution such that all the 0 < q c,i < 1, for 1 ≤ i ≤ v and 1 ≤ c ≤ C, then denoting by q i = q ci,i , the following result holds: Directly following from the above PFS, we can show that the marginal queue length probability distribution for any queue j is given by:

The EPN System
The EPN of Figure 1 can be represented by a G-Network with v = 2N queues, where the WSs are represented by the queues 1, . . . , N , while the ESs are represented by the queues N + 1, . . . , 2N . With regard to the notation in Section 2 and Section 2.1, the network has C = 2, i.e. two classes of customers where Class 1 refers to the jobs, while Class 2 refers to the EPs, and negative customers and triggers cannot arrive to any of the queues from the outside world, i.e. λ − c,i = λ T c,i = 0 for c = 1, 2 and i ∈ {1, . . . , 2N }. Class 1 customers are "positive customers" representing jobs being served at the WSs with λ + 1,i = λ i , and λ + 2,i = λ − 1,i = λ − 2,i = 0 for i = 1, . . . , N . Furthermore jobs at the WSs are only removed, or moved to another WS, under the effect of EPs, i.e. r(i) = 0 and l 1,i = l 2,i = 0 for i = 1, . . . , N .
wj δj +wj to a queue i from a queue j = N + i, i ∈ {1, . . . , N }. With probability D i an EP becomes a negative customer with batch removal, so that the EP is used to process one or more jobs at a WS and the probability distribution of the size of the batch of jobs that can are served is π 1,i,s = Pr[B 1,i = s], and Π − 2,j,1,i = D i .d j .
With probability 1 − D i an EP becomes a trigger, so that Π T 2,j, With regard to (2) in the G-Network Model, the two classes representing jobs and EPs in the EPN are characterized by two equations that represent the probabilities that the job queues and ES queues (batteries) are busy: where And according to G-Network Theory outlined in the Section 2.1, the following expressions hold: provided that (5) and (6) have an unique solution such that all the 0 < q c,i < 1 for 1 ≤ i ≤ 2N and 1 ≤ c ≤ 2. The marginal probability distribution of the queue length for the queue i and class c is

Cost Function, Parameters and Optimization
In previous work, G-Networks were used to optimize energy consumption in packet networks [25], and the model in [20] can help to determine the best architecture, distributed or centralized, for storing and dispatching harvested energy. In [21] the EPN model is used under the assumption that one EP is the amount of energy needed to process a job. Here our objective is to minimize the average response time for jobs that come into the system, where the jobs arrive from the outside world to WS i at a given rate λ i . Furthermore, the total arrival rate of EPs is fixed at some value γ and each of the ESs has a transfer rate of EPs to the corresponding WS given by w i and a local energy leakage rate δ i , for i = 1, ... , N . In order to obtain an intuitively appealing result, we will assume that π 1,i,s = Consider the case where the EPs cannot moved between ESs so that M ji = 0 and d i = 1. Also assume that jobs cannot be moved between WSs, i.e. D i = 1. In this case, assume that the total renewable energy flow into ES i is γ i = p i .γ.
The cost function that needs to be minimized is the overall average job response time for all jobs arriving to the system: Regarding equations (5) and (6) with the specific restrictions for this case with d i = 1, D i = 1, for 1 ≤ i ≤ N , we have : Our problem is then to choose p = (p 1 , ... , p N ) so as to minimize W for a given value of γ and for given energy leakage rate δ i at each ES i. Using Little's Formula we can write: Note that Λ + 1,i = λ i when D i = 1 for all i = 1, . . . , N . Substituting Substituting (13) into the cost function W , we get: where σ i is the energy efficiency with regard to leakage, of i − th ES node. Choosing the p i ≥ 0 so as to minimize W is an optimization problem subject to the constraint N i=i p i = 1. Therefore we apply the method of Lagrange multipliers and choose the Lagrangian where the Lagrange multiplier β is a real number. Suppose p * is a local solution of the optimization problem. Then the necessary Kuhn-Tucker conditions are: from which we derive Then rearranging (17), the solution p * i is Moreover, the second necessary condition also must hold. Solving (18) and (19) simultaneously, we see that the optimal solution must be: However, the sufficient condition that there exists an optimum solution p * also needs to be examined. To guarantee the existence of the strict constrained local minimum, the Hessian ∇ pp L muust be positive definite. Notice that ∇ pp L is a diagonal matrix with diagonal entries: Thus the sufficient condition holds if the inequality is satisfied for all i = 1, . . . , N . Substituting p * i into (22), we see that the inequality is equivalent to: This condition is physically meaningful since it implies that the total rate of harvested EPs has to be sufficiently large so as to provide enough energy so as to power the WSs despite the energy leakage that also will occur.

An Example
In order to illustrate the optimal solution, consider a system with three WSs and ESs with parameters given in Table 1. The sufficient condition (22) allows us to determine the range of p 1 , p 2 and p 3 that guarantee that every ES can provide sufficient power to its corresponding WS: 0.2933 < p 1 < 1, 0.1760 < p 2 < 1, 0.0597 < p 3 < 1,  Figures 2 and 3 where the x and y axes are p 1 and p 2 , and p 3 = 1 − p 1 − p 2 . From (20) we obtain the optimum operating point which minimizes the total average response time as being (p * 1 , p * 2 , p * 3 ) = (0.5049, 0.3399, 0.1552) with the minimum value W * = 42.9 ms.  Fig. 2. Average response time with all (p1, p2) pairs. The red dot is the optimal solution of equation (20). The range of the values pi is not [0, 1] due to the constraint and the sufficient conditions, and the curve is not convex.

Conclusions
We have considered an EPN model where jobs and energy packets cannot be transferred to other workstations, so that each workstation executes locally the jobs that it receives, using energy from its own energy storage unit. We have derived a key result where a common flow of energy is distributed optimally among the workstations so that the average response time of jobs can be minimized. The problem has been solved analytically for the geometrically distributed number of jobs processed with one energy packet. In other work [27] the average response time has been minimized when jobs can be moved among WSs according to a given probability transition matrix, but each station decides locally whether to move a job or not. Future work will investigate the minimization of a cost function that combines the average response time of jobs, and the energy wastage through leakage or due to idle workstations which consume energy when they do not process jobs.