# A Distributed Real-Time Monitoring Scheme for Air Pressure Stream Data Based on Kafka
## 4 Experimental Results and Analysis
### Kafka Throughput Results and Analysis
Simultaneously, the producer must spend a certain amount of time waiting for the confirmation message from the leader of each partition. Therefore, when receiving producer messages, Kafka has a higher delay owing to the operations of the controller and the time required for confirmation, thereby reducing the message transmission volume of the producer. Figure 9: _Cont._  
Conversely, the consumers can request messages directly from ZooKeeper and retrieve messages assigned to specific topics using partition locations and offset information. Unlike producers, consumers can directly receive messages from the message storage location using sockets without the need for intermediary routing through the controller. This direct message retrieval process enables consumers to handle messages more efficiently and reduces processing delays, consequently exhibiting higher throughput compared to the producers. The results of tests B, D, F, and H report that the relative throughput of the producers and the consumers is comparable. This can be explained by the mechanism of synchronous testing; in synchronous testing, the producer sends the message to the Kafka cluster, and then, the consumer can consume the message. Therefore, the consumer must wait for the producer's message input, which results in the throughput of the producer and consumer being close. In other words, in synchronous testing, the throughput of the producer directly affects the throughput of the consumer. Additionally, compared to the test results in A, C, E, and G, the performance of the producer decreased because the producer needed to perform complex controller operations, replication operations, and ZooKeeper operations in synchronous testing; the performance of the producer decreased compared to independent testing. The throughput of Kafka varied significantly depending on the configuration of different topics. This difference was primarily caused by the delay introduced by producers inputting messages. In the synchronous tests of the four topics listed in Table 5, Topic 4 (Figure H ), with a single partition and single replication, performed the best. Topics 1 (Figure B) and 3 (Figure F) exhibited greater performance fluctuations and lower throughput compared to Topics 2 (Figure D) and 4 (Figure H), but they maintained overall high throughput. This phenomenon is attributed to the higher load on the controller when distributing messages across multiple partitions for Topics 1 and 3, leading to fluctuations in producer performance. Topic 1 (Figure B) performed worse than Topic 3 (Figure F), and Topic 2 (Figure D) performed worse than Topic 4 (Figure H): mainly due to the controller's resource consumption during message replication, thereby reducing the overall performance of Topics 1 and 2. In the independent tests, the consumer throughput for Topics 1 (Figure A) and 3 (Figure E) was higher than that of Topics 2 (Figure C) and 4 (Figure G)  
Figure 9: Throughput of Kafka. because the consumers in Topics 1 and 3 concurrently read messages from multiple partitions (3 partitions), thereby improving the overall message transmission performance.