I recently did a benchmarking on kong and OAuth 2.0 plugin, and I found something bizarre to me.
Here is what I did:
I have 3 n1-highmem-4 instances (4 vCPUs and 26GB mem) on Google Cloud Platform, which is managed by Google Kubernetes Engine, and then I came out with the following setup:
- Start 1 or 2 Cassandra nodes on each instance and start kong on the third instance. 2 nodes Cassandra cluster with configuration
- Start 1 PostgreSQL server on one instance and start kong on another instance, the third instance is idle.
After kong is set up, I use distributed Jmeter (1 master with 3 slaves) to execute the load test on kong’s
/oauth2/token endpoint to test the token generation which is mostly DB writes.
However, I have several questions in terms of the result I got:
- 1 Cassandra node vs 1 PostgreSQL server, PostgreSQL’s throughput is almost doubled than Cassandra. Is it normal? I would expect Cassandra can outperform PostgreSQL.
- 2 Cassandra node vs 1 PostgreSQL server, PostgreSQL’s throughput is still 50% better than Cassandra. The throughput of 2 Cassandra node is increased but definitely not linear.
Not sure if anyone else did a similar comparison, in general, Cassandra cost more resources but didn’t provide the performance I expected. I tried to tune some parameters on Cassandra but not much gained. Any idea?