Aither shows an approach how to bootstrap a microservice system with Hemera and docker. You can scale your worker in seconds and because we use NATS as “nervous system" for our distributed system we do not have to carry about service-discovery or load-balancing of hemera-services. We use traefik to load-balancing the api-gateway.
This configuration will setup:
- Hapi http server which act as api-gateway to the Hemera services.
- Microservice example which is responsible to add two numbers.
- NATS server the underlying messaging system for Hemera.
- Zipkin dashboard to monitoring your distributed system.
- Natsboard dashboard to monitoring your NATS system in realtime.
- Traefik modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
- Redis in memory cache for Hemera.
docker-compose up
docker-compose scale math-service=5 api=2
npm install -g artillery
artillery run loadtest.yml
Print the html artillery report with artillery report <report.json>
http://localhost:8182/api/add?a=1&b=10
- Server: 12 CPUs, 32GB RAM, 320GB SSD
- Scaling: 25 APIs, 100 workers
- Load balancing: Traefik in round-roubin for API services. NATS supports random only.
- Caching: No
-
Step-1: Warm-up phase Duration: 300 seconds 5 virtual users/second that last for 300 seconds
-
Step-2: Daily business Duration: 60 seconds 100 virtual users/second that last for 60 seconds
-
Step-3: High load phase Duration: 600 seconds 200 virtual users/second that last for 600 seconds
Complete report
Scenarios launched: 126100
Scenarios completed: 126100
Requests completed: 126100
RPS sent: 129.53
Request latency:
min: 3.8
max: 736.9
median: 6.9
p95: 20.3
p99: 63.2
Scenario duration:
min: 4.5
max: 738.4
median: 7.7
p95: 21.3
p99: 64.3
Scenario counts:
0: 126100 (100%)
Codes:
200: 126100
The full report you can find here.
thanks most of all to the community who create these awesome opensource software and thereby making it possible.