## 3 Materials and Method
### Load Balance
6:For\(j=1\) to \(n\)
7:Calculate \(\lambda_{ij}\), \(\mu_{ij}\) where \(\lambda_{ij}\) is the job flow rate from the \(i\)th SM to the \(j\)th PE managed by that SM, \(\mu_{ij}\) is the processing capacity of the \(j\)th PE that is managed by the \(i\)th SM. 8:Calculate \(\rho_{ij}=\lambda_{ij}/\mu_{ij}\) that is traffic intensity of the \(j\)th PE that is managed by th SM. 9:Calculate the expected mean job response time, \(E\Big{[}T_{g}\Big{]}\). 10:Endfor
11:Endfor
```  
**Algorithm 3**Expected mean job response time  
The jobs arrive sequentially from clients to the LGM with the expectation of conforming to a time-invariant binomial mechanism, whereas inter-arrival times are independently, identically, and exponentially distributed with the arrival time of jobs/s, excluding simultaneous arrivals. An M/M/1 queue models each PE in the following website pool. Jobs that arrive at the LGM are immediately spread on the LGM structured pages with routing likelihood:  
\[PrS_{i}=\frac{SPC_{i}}{LPC}, \tag{8}\]  
Following the load balancing strategy (LBP), where \(i\) the site number  
\[\lambda_{i}=\lambda\times PrS_{i}=\lambda\times\frac{SPC_{i}}{LPC}. \tag{9}\]  
Under the same scenario, the site \(i\) arrivals would also be automatically spread with routing likelihood on the PEs arranged by that site. \[PrE_{ij}=\frac{PEC_{ij}}{SPC_{i}}, \tag{10}\]Based on the LBP, in which \(j\) is the PE, and \(i\) is the site number  
\[\lambda_{ij}=\lambda_{i}\times PrE_{ij}=\lambda_{i}\times\frac{PEC_{ij}}{SPC_{i}} \tag{11}\]  
As LGM arrivals are simulated to obey a Poisson process, PE arrivals would also obey a Poisson distribution. Assume that service times only at the \(j\)th PE in the \(i\)th SM are spread exponentially with fixed service rate \(\mu_{ij}\) jobs/s and reflect the processing capacity of the PE (PEC) in the high availability policy. Service management is a first-come service. To calculate the expected mean job response time, let \(E\Big{[}T_{S}\Big{]}\) denote the mean time spent by a job at the grid to the arrival rate \(\lambda\) and \(E\Big{[}N_{S}\Big{]}\) denote the number of jobs in the system. Hence, the mean time spent by a job at the grid will be:  
\[E\Big{[}N_{S}\Big{]}=\lambda\times E\Big{[}T_{S}\Big{]} \tag{12}\]  
\(E\Big{[}N_{S}\Big{]}\) can be determined by averaging the mean amount of jobs at all grid sites in each PE. \[E\Big{[}N_{S}\Big{]}=\sum_{i=1}^{m}\sum_{j=1}^{n}E\Big{[}N_{PE}^{ij}\Big{]} \tag{13}\]  
where \(i=1,2,\ldots,m\) is the number of site managers handled by an LGM, \(j=1,2,\ldots,n\) is the number of processing elements handled by an SM and \(E\Big{[}N_{PE}^{ij}\Big{]}\) is the mean number of jobs in a processing element number \(j\) at site number \(i\). As every PE is modeled as an \(M\)/\(M\)/\(1\) queue, \(E\Big{[}N_{PE}^{ij}\Big{]}=\frac{\rho_{ij}}{1-\rho_{ij}}\) where  
\[\rho_{ij}=\frac{\lambda_{ij}}{\mu_{ij}} \tag{14}\]  
\(\mu_{ij}=PEC_{ij}\) for PE number \(j\) at site number \(i\). From Equation (12), the expected mean job response time is given by:  
\[E\Big{[}T_{S}\Big{]}=\frac{1}{\lambda}\times E\Big{[}N_{S}\Big{]}=\frac{1}{ \lambda}\times\sum_{i=1}^{m}\sum_{j=1}^{n}E\Big{[}N_{PE}^{ij}\Big{]}, \tag{15}\]  
Notice that the stability state \(PE_{ij}\) is \(\rho<1\).