# Application of Neural Networks in Distribution of the Load in Cluster-Based Web Systems
## 4 Test Bed Used in the Experiments  
In the further part of the article, various approaches to the construction and structure of the executor model are presented. In order to be able to assess the solutions adopted, we needed to develop a research environment, which is presented in this chapter. Machine learning often uses a simulation environment at an earlier stage in the research (e.g., reinforcement learning). Creating such an environment involves preparing a policy and setting parameters that will imitate the real environment, and then adding an agent to the environment that will adapt to the given environment. For the initial training of an agent, establishing a policy to adapt to is more important than accurately reflecting the parameters of the real environment. An agent that can adapt well to the simulation environment will probably also be able to adapt to the real environment (although it has slightly different parameters). However, the measurements made show that the differences in the average response times obtained in the simulation and real environment do not exceed 20%, which according to the literature [42] is a sufficient value. After the initial selection of the algorithms used in the simulation environment, it is possible to proceed to the testing phase in a real distributed environment. Figure 2: The load balancer diagram. The simulation environment was created with the use of OMNeT ++ package. This system provides appropriate libraries and environment for simulation, and it is one of the most popular packages for evaluating network systems [43]. The simulation environment consisted of several modules that map the behavior of various elements of the real system, namely, HTTP request generator, load balancer, web servers, and database server. The simulator diagram is shown in Figure 3.  
In order to determine the value of the real parameters of the elements of the simulation environment, we carried out preliminary experiments in a manner similar to that in [44]. The experiments were conducted on servers equipped with an Intel Core i7 7800X processor, a Samsung SSD 850 EVO driver, and 32 GB of RAM. The Apache server was running WordPress, the most commonly used CMS in the world, which is present on more than 25% of the world's websites [45]. Thanks to this, it was possible to reproduce the behavior of many real business websites. Computers with higher performance are often used for servers, but only part of the resources (cores) is used for one virtual machine. The hardware whose parameters we used in the simulation usually do not differ in its performance from the average virtual machine used in general-purpose computing clouds, which are most often chosen for medium-sized business solutions. The request generator module contained multiple clients, each simulating the behavior of a web browser. To download a website, we downloaded the content of the HTML file first, and then up to 6 TCP connections were opened to download the rest of the page, such as css, js, or images. The number of websites downloaded during one session was modeled using the inverse Gaussian distribution (\(\mu=3.86\), \(\lambda=9.46\)), according to human behavior. Regarding the time between the opening of subsequent pages (user think time), the Pareto distribution (\(\alpha=1.4\), \(k=1\)) was used [46]. Traffic in the network is generated synthetically on the basis of the observed behavior. Each client simulated the download of a website whose parameters (type and size of HTML and nested objects) were the same as in the popular website [[https://www.sonymusic.com](https://www.sonymusic.com)]([https://www.sonymusic.com](https://www.sonymusic.com)) (accessed on 9 March 2019) [47] that also works through the WordPress CMS. In the simulation environment, the web balancer was able to distribute HTTP requests with the usage of popular algorithms in Amazon AWS [21] and with the use of intelligent strategies, namely,  
* Round Robin (RR);  
Figure 3: The simulator diagram.