In this post, we present a fresh benchmark for real-time gaming, showcasing how a single instance of MigratoryData Kafka Edition can extend real-time Kafka messaging over WebSockets to one million concurrent gamers. Furthermore, we emphasize that by clustering N instances of MigratoryData, this scalability can be magnified by a factor of N, enabling cost-effective management of any volume of gamers.

Benchmark Scenario

Every five seconds, a volume of one million 2048-byte Kafka messages needs to be delivered in real-time to a community of one million gamers.

Benchmark Tools

MigratoryData’s Benchmark Tools consists of Benchsub and Benchpub.

Benchsub

Benchsub is a tool capable of opening a configurable number of WebSockets to MigratoryData Kafka Edition, subscribing to a configurable number of subjects, and computing the latency of the messages received for the subscribed subjects.

Benchpub

Benchpub is tool capable of publishing to Apache Kafka messages of a configurable size at a configurable frequency.

Benchmark Setup

For the benchmarking process, we employed four Amazon EC2 c6id.8xlarge virtual machines, all interconnected via a 10 Gbps network, as follows:

  • Virtual Machine 3 hosted a single instance of MigratoryData Kafka Edition.
  • Virtual Machine 2 hosted a single instance of Apache Kafka.
  • Virtual Machine 4 hosted four Benchsub instances. Each instance established 250,000 WebSockets to MigratoryData Kafka Edition, subscribing to 250,000 subjects. This resulted in 1 million subjects subscribed across 1 million concurrent WebSockets.
  • Virtual Machine 1 hosted eight Benchpub instances. Each instance published 25,000 messages per second on one Kafka topic and 25,000 subject keys. Over 5 seconds, this totaled 1 million messages on one Kafka topic and 1 million subject keys, delivering therefore 1 million messages to 1 million WebSocket clients.

Summary of Results

The table below provides a summary of the benchmark results obtained with a single instance of MigratoryData Kafka Edition for the benchmark scenario above:

   
Number of concurrent WebSockets 1,000,000
Number of subscribed subjects 1,000,000
Number of messages per client 1 message every 5 seconds
Payload of each message 2048 random bytes
Total incoming messages throughput 1,000,000 messages per 5 seconds
Total outgoing messages throughput 1,000,000 messages per 5 seconds
Mean latency* 13 milliseconds
Standard deviation for latency* 25 milliseconds
99th percentile latency* 128 milliseconds
Maximum latency* 317 milliseconds
Hardware One Amazon EC2 c6id.8xlarge virtual machine
Operating system Debian Linux 6.1.0-13-cloud-amd64
Memory utilization under 52 GB
CPU utilization under 40%
Incoming Network utilization ~ 3.5 Gigabit per second
Outgoing Network utilization ~ 3.5 Gigabit per second

*) Latency represents the total time it takes for a message to travel from Benchpub to Benchsub, traversing through Apache Kafka and MigratoryData Kafka Edition. In essence, message latency is calculated by measuring the duration between when the message is sent by Benchpub to Apache Kafka and when it is received by Benchsub from MigratoryData Kafka Edition.

Results

We employed the jconsole tool to monitor via JMX the performance of MigratoryData Kafka Edition. Below, we present the benchmark results in the form of screenshots obtained from jconsole.

WebSocket Connections and Messages

Memory and CPU Utilization

Latency

Linear Horizontal Scalability

MigratoryData Kafka Edition implements clustering where cluster members operate independently, enabling horizontal scaling in a linear fashion. Thus, if a single instance of MigratoryData Kafka Edition can manage 1 million concurrent WebSockets, having two instances in a cluster enables handling 2 million concurrent WebSockets, having three instances in a cluster enables handling 3 million concurrent WebSockets, and so on.

In an earlier article Real-Time Gaming Infrastructure for Millions of Users with Apache Kafka, ksqlDB, and WebSockets, we showcased how a single MigratoryData Kafka Edition instance handled one million concurrent gamers in a distinct gaming scenario. Moreover, we exemplified the system’s linear horizontal scalability through a cluster deployment of two MigratoryData Kafka Edition instances, thereby doubling the capacity to handle two million concurrent gamers.

We would welcome any questions, comments, criticisms, or suggestions you may have regarding this benchmark. Please email your feedback to support@migratorydata.com.