# Providing Predictable Quality of Service in a Cloud-Based Web System
## 3 Web Cloud Earliest Deadline First Method and Web Switch
### Switching Section
The output fuzzy set functions \(\mu_{Sj}(s)\)  
Figure 3: Neuro-fuzzy model: (**a**) overall view, (**b**) input fuzzy set functions, and (**c**) output fuzzy sets functions. are singletons (Figure 3c) and their parameters \(s_{1 ki},\ldots,s_{|ki},\ldots,s_{|ki}\) point to the positions of each singleton. The estimated service time is calculated as follows:  
\[\hat{t}_{ki}\ =\ \sum_{j\ =\ 1}^{J}s_{|ki}\cdot\mu_{R_{j}}(e_{i},f_{i}) \tag{5}\]  
where \(\mu_{R_{j}}(e_{i},f_{i})\ =\ \mu_{F_{el}}(e_{i})\cdot\mu_{F_{fm}}(f_{i})\). The presented method of calculation of the service time in the zone is typical for fuzzy logic systems. The adaptation abilities are, however, connected with the neural nature of the zone module. The Back Propagation Method [46] is used to tune both the input and output fuzzy set parameters. The adaptation is processed each time the zone, corresponding to the zone model, finishes the request's service and the measured service time \(\overline{t}_{i}\) is passed from the execution module to the zone model. The parameters in the database \(Z_{i}\) are tuned in the following way:  
\[s_{|ki(i+1)}\ =\ s_{|ki}+\eta_{s}(\overline{t}_{i}-\hat{t}_{ki})\cdot\mu_{R_{j}}(e_{ i},f_{i}) \tag{6}\]  
\[c_{\varphi k(i+1)}\ =\ c_{\varphi ki}+\eta_{c}(\overline{t}_{i}-\hat{t}_{ki}) \cdot\sum_{m\ =\ 1}^{M}\left(\mu_{F_{fm}}(f_{i})\sum_{l\ =\ 1}^{L}\left(s_{((l-1)\cdot L+l)ki}\partial\mu_{F_{el}}(e_{i})/\partial c_{ \varphi ki}\right)\right) \tag{7}\]  
\[d_{\gamma k(i+1)}\ =\ d_{\gamma ki}+\eta_{d}(\overline{t}_{i}-\hat{t}_{ki}) \cdot\sum_{l\ =\ 1}^{L}\left(\mu_{F_{el}}(e_{i})\sum_{m\ =\ 1}^{M}\left(s_{((l-1)\cdot M+m)ki}\partial\mu_{F_{fm}}(f_{i})/\partial d_{ \gamma ki}\right)\right) \tag{8}\]  
where \(\eta_{s},\eta_{c},\eta_{d}\) are adaptation ratios, \(\varphi\ =\ 1,\ldots,L-1,\ \gamma\ =\ 1,\ldots,M-1\)[41]. The initial values of input fuzzy set function parameters \(\zeta_{ki}\) and \(D_{ki}\) are evenly distributed over the space of executor operation. The output fuzzy set function parameters \(S_{ki}\) are initially set to zero. In this way, the estimated service times are close to zero at the beginning of the operation of the web switch. When servicing subsequent requests, the zone model tunes the parameters and the estimated service times become longer and closer to the real service times. The rate of change depends on the adaptation ratios. The preliminary experiments allow their optimal values, \(\eta_{s}\ =\ 0.01\) and\(\eta_{c}\ =\ \eta_{d}\ =\ 0.4\), to be determined. Furthermore, during the experiments, the optimal number of input fuzzy sets has been determined as \(L=M=10\), and the number of output fuzzy sets is equal to \(J=L\cdot M\)[41]. The decision module is the key element of the switching section. It chooses the availability zone to service the request according to the algorithm designed especially for systems providing predictable service. The decision is made on the basis of estimated service times \(\hat{t}_{ki^{\prime}}^{1},\ldots,\hat{t}_{ki^{\prime}}^{w}\ldots\hat{t}_{ki}^{w}\) in the following way:  
\[z_{i}\ =\ \left\{ \begin{array}{c}\min\left\{w:w\in\left\{1,\ldots,W\right\} \wedge\Delta d^{\prime}{}_{i}\leq\hat{t}_{i}^{s}\right\}\text{ if }n_{i}\ =\ n_{\max}\text{ and }\underset{\text{in}\in\left\{1,\ldots,S\right\}}{\exists}\hat{t}_{i}^{s} \geq\Delta d^{\prime}{}_{i}\\ w_{\min}:\hat{t}_{i}^{w_{\min}}\ =\ \min\left\{\hat{t}_{i}^{w}:w\in\left\{1, \ldots,W\right\}\right\}\text{ in other cases}\end{array} \right. \tag{9}\]  
where \(\Delta d^{\prime}{}_{i}\) is time remaining to service the request before reaching the deadline \(d^{\prime}{}_{i}\) (calculated in the switching section's service model), and \(\Delta d^{\prime}{}_{i}\ =\ d^{\prime}{}_{i}\ -\tau_{i}^{(2)}\), \(\tau_{i}^{(2)}\) is the moment the request enters the scheduling section. According to the proposed formula, we chose the zone with the lowest index \(w\), which offers service time that allows the request to be serviced before the deadline \(d^{\prime}{}_{i}\).