apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.46k stars 2.52k forks source link

compared with springcloud gateway ,the qps is lower #2683

Closed ShadowCharle closed 2 years ago

ShadowCharle commented 3 years ago

Issue description

I built two services, a target service and a SpringCloud Gateway service.

I used WRK for stress tests on the same machine:

  1. Invoke the target service directly using WRK test1

  2. Configure the route of the target service in the SpringCloud Gateway service, and then use WRK to call the SpringCloud Gateway service test2

  3. Create the route of the target service in ApISIX, and then call ApISIX by WRK

test3

You can clearly see that the QPS of spring cloud gateway is higher than that of apifix! When I tested with the top command, I found that the CPU utilization rate of spring cloud gateway was higher than that of apifix. Is this the reason? Is there any way to increase the throughput of apifix?

Environment

tokers commented 3 years ago

@ShadowCharle You have some non-2xx or 3xx requests in the benchmark test for SpringCloud gateway, have you ever investigated it?

ShadowCharle commented 3 years ago

yes,But that's rarely the case,I don't think that's the core issue

idbeta commented 3 years ago

I think you should Increase the stress so the CPU utilization rate of servers of the two APIgateways are full and then compare their QPS. Have you modified the system settings? Like ulimit -n and fs.file-max

tokers commented 3 years ago

@ShadowCharle What about the number of Nginx workers for APISIX and Java threads for SpringCloud?

ShadowCharle commented 3 years ago

i modified the system settings. ulimit -n=65535 and fs.file-max=3248559

ShadowCharle commented 3 years ago

cpu core:6
SpringCloud is a Java service, and I haven't changed any configuration;

tokers commented 3 years ago

cpu core:6 SpringCloud is a Java service, and I haven't changed any configuration;

Then i think maybe the benchmark is unfair, we don't know the real OS threads there involves the computation.

github-actions[bot] commented 2 years ago

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

github-actions[bot] commented 2 years ago

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.