Firstly, I only have basic knowledge in java. I have some microservices and am currently using zuul / eureka to provide services.
It is noted that with a direct call to the microservice, the throughput is 3 times higher than with a call through zuul. Therefore, I am wondering the wrong zuul configuration.
ab:
Direct microservice call:
Concurrency Level: 10 Time taken for tests: 5.938 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 37750000 bytes HTML transferred: 36190000 bytes Requests per second: 1684.20 [#/sec] (mean) Time per request: 5.938 [ms] (mean) Time per request: 0.594 [ms] (mean, across all concurrent requests) Transfer rate: 6208.84 [Kbytes/sec] received
Call via zuul:
Concurrency Level: 10 Time taken for tests: 15.049 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 37990000 bytes HTML transferred: 36190000 bytes Requests per second: 664.52 [#/sec] (mean) Time per request: 15.049 [ms] (mean) Time per request: 1.505 [ms] (mean, across all concurrent
Zuul configuration:
server: port: 7001 zuul: #Services will be mapped under the /api URI prefix: /api sslHostnameValidationEnabled: false host: maxTotalConnections: 800 maxPerRouteConnections: 200 endpoints: restart: enabled: true shutdown: enabled: true health: sensitive: false eureka: instance: hostname: localhost client: serviceUrl: defaultZone: http:
It is noted that zuul takes up a lot of CPU compared to the microservice itself. So took the stream dump. And my suspicion is that RibbonLoadBalancingHttpClient seems to continue to instantiate.
Stream dump: https://1drv.ms/t/s!Atq1lsqOLA98mHjh0lSJHPJj5J_I
source share