## 6 Experiment and Result
### Monitoring Service
#### 6.3.1 EMQ Cluster Services  
For the performance analysis of the message publishing service of the EMQ cluster, the JMeter-K8s cluster was used to simulate the request to publish messages from the patients' smartphones. Additionally, a preliminary scalability analysis of the EMQ cluster was performed using one and three brokers. The tests were not intended to reach the maximum service throughput offered by the broker cluster. The Apache JMeter plan for testing these scenarios is an XML file whose configuration parameters are shown in Figure 16. The test plan was mainly configured with the IP address of the load balancer used to access the cluster, the topic \"vitalSignsTopic\", and the value of the quality of service (QoS). Furthermore, the messages sent to the EMQ cluster had a structure and size expected in the real world (Section 6.1). An important aspect of the MQTT protocol is the possibility of setting a QoS value (0, 1, or 2) for publishers and subscribers, which affects the performance of the EMQ cluster service. In the experiments, we used a QoS equal to 2 to guarantee the delivery of messages to the EMQ cluster. Table 4 shows the results of the experiments with various workloads of publishing requests to the EMQ cluster with one and three brokers (see Supplementary Materials Spreadsheet S2). Figure 16: The simulation environment for the EMQ cluster and Kafka cluster tests. From the JMeter-K8s cluster, messages were sent to the EMQ cluster using certain ramp-ups to analyze the functional behavior of the EMQ cluster for various periods of operation. For example, in tests 26, 27, and 28, the EMQ cluster flexibly handled the increase in workload variation during testing. The average throughputs in these tests were 99.35 requests/s, 145.95 requests/s, and 194.39 requests/s with average response time values of less than 15 ms. The highest service capacity was obtained with three brokers, which could be established by comparing tests 1, 2, 3, and 4 with tests 15, 16, 17, and 18. Our final objective for the e-health system was to use an EMQ cluster with three brokers, so we analyzed in more detail the experiments with this type of cluster. Figure 17 shows the variation of the average throughput for tests 19, 22, 25, and 28 in which the same volumes of service requests were used. However, different ramp-up values were used to observe the effects of pressure reduction on the EMQ cluster. The results show that the EMQ cluster was able to respond to some tests with a response time of more than 2 s, as in the case of test 19 (Avg. RT = 12,488 ms, Max. RT = 26,808 ms). Average response times of more than 2 s are not desirable for some types of systems that require average response times between 1000 ms and 2000 ms. For the messaging subsystem of the health system, it is necessary to have a maximum average throughput and a minimum average response time to maintain a dynamic data flow. Based on the conditions of the experiments with the three-broker EMQ cluster, Test 14 (Avg. RT = 1090 ms, Max. RT = 3773 ms) provides an approximation of the average throughput and the adequate average response time for the acceptable operation of the system. In this paper, we set 4500 requests/s (Test 14) as the reference value for the number of message publishing requests that can be sent to the EMQ cluster. The average throughput and the average response time with which the EMQ cluster handles 4500 requests/s are 518.67 requests/s and 1090 ms, respectively. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & & & & & & & & \\ \multirow{2}{*}{**Number of Test**} & \multirow{2}{*}{ \begin{tabular}{c} **Numbers** \\ **of MGT** \\ **Brokers** \\ \end{tabular}  } & \multirow{2}{*}{ \begin{tabular}{c} **Numbers** \\ **of Threads** \\ **(\#Users)** \\ \end{tabular}  } & \multirow{2}{*}{ \begin{tabular}{c} **Ramp-Up** \\ **Period** \\ **(s)** \\ \end{tabular}  } & \multirow{2}{*}{ \begin{tabular}{c} **Duration** \\ **of Experi-** \\ **ment** \\ **(h1 mm:ss)** \\ \end{tabular}  } & \multirow{2}{*}{