# Application of Neural Networks in Distribution of the Load in Cluster-Based Web Systems
## 5 Design of Executor Model
### Request Class Analysis  
The next study was concerned with the influence of the division of requests into classes. The division into classes can also affect the time needed to response the requests. Requests differ from each other depending on what objects are expected, and it is especially important whether it is a dynamic object (script executed on the server) or a static object (downloaded file). The size of the requested files is also significant. The average time to handle such a script or to download a file of a certain size is crucial in the classification of the resource. Some objects may have similar response times. Therefore, the combination of request types into smaller or larger groups was considered, hereinafter referred to as request classes. Then, a separate neural network was built for each of these request classes.  
In the beginning, preliminary tests were performed. The tests were conducted for a very low load on the servers (small number of clients). Only requests made without waiting in the queue on the server were taken into account for the statistics. For each type of request, the number of requests during the simulation and their total execution time were counted. On this basis, we also calculated the average request execution time for each type. Then, the request types were sorted according to average execution time. The next step was to create request classes by combining these request types with similar average response times.  
The first method of division into classes was used so that the number of requests for these classes was balanced. This means that, during simulation, some types of requests were more frequent, and some less frequent. If for a certain class of requests, only a few requests were generated during the simulation, it was not enough for the neural network serving this request to learn correctly. Therefore, the grouping of requests into classes was aimed at ensuring that each network had a similar amount of data that needed to be processed. The division was made into 1, 5, 10, 20, 35, 70, and 140 groups. The simulation results for each division are presented in Figure 8.  
The lowest value of the average response time for the load of 2500 clients was obtained for the division into 70 groups (tentatively named \(NN2\)), which was 0.56 s.  
In another split method, it was assumed that requests in each group are served in a similar total time. This means that classes that serve \"small\" requests process more requests, while classes with higher average request response times process fewer requests. The results of such a division are shown in Figure 9.  
Figure 8: Division into groups with a balanced number of requests.  
The lowest value of the average response time for the load of 2500 clients was obtained for the division into 140 groups, and it was as much as 0.92 s.  
The division into 70 groups, in such a way that balances the number of requests for each group, turned out to be the most advantageous (marked as \(NN2\) in the chart in Figure 8). This method of division was adopted for further research.