Saga Performance Test
Let take the spring saga demo as an example, JMeter send the request to the Booking Service, and Booking Service send the request to Hotel Service and Car Service, all the service has only one instance. There is only one instance running the JMeter script to send the pressure to the Alpha.
Test scenarios:
- Disable omega(run the original business without saga)
- Enable omega and handle saga events in Redis
- Enable omega and handle saga events in PostgreSQL
The test environment:
- 3 VirtualBox machines as a Kubernetes cluster on a bare metal
- K8S Cluster Node info:
- Memory: 4 GiB
- CPU: 4 Cores
- Disk: SSD
- Service instance is started from Kubernetes randomly
The test schema:
- Test with JMeter, start 100 testing threads within 5 minutes, the whole test lasts 10 minutes.
- 10% of invalid request that will cause AbortEvent and trigger compensation.
The test result:
SCENARIO1(Without saga):
Total requests: 401,257, avg QPS: 668, avg Response time: 11.82 ms
SCENARIO2(Saga in Redis):
Total requests: 200,085, avg QPS: 333, avg Response time: 125 ms
SCENARIO3(Saga in Postgres):
Total requests: 132,100, avg QPS: 220, avg Response time: 241 ms
Please check out the readme file if you want to deploy the performance test with kubernetes, the jmeter script file is here.