-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to improve gateway performance? #301
Comments
Use third-party solutions. For example, https://varnish-cache.org. |
@re6exp Thank you for your comment. But In my business case, I can't use cache. |
@maoyunfei Do you use https in your use case? |
@lhotari |
Documentation request. Is it even possible to use "Just use http" - is not a way forward for us and right now the performance of non-native TLS is holding us back from a production deploy. But maybe it already works as described in reactor/reactor-netty#344 but I see no logs neither confirming or denying the fact. I did basic benchmarks (using very lowtech |
@maoyunfei any test run on a single machine will have contention problems. Can you provide a complete, minimal, verifiable sample that reproduces the slowdowns with increased response size? It should be available as a GitHub (or similar) project or attached to this issue as a zip file. |
@spencergibb I created a demo project on github that reproduces the issue, look at gateway-performance-test please! |
Is this still valid? We are evaluating zuul and gateway. Our case is also similar, the response size will be around 1-2MBs. |
@thirunar It's still valid. By the way, we turned to zuul2 finally. |
i would take this benchmark exercise with a huge grain of salt. the origin, test harness and proxy are all on the same box? that's no way close to how you're going to deploy it prod why would you load test in such manner? the test harness should be on one box, the proxy(ies) in another and the origin should be in yet another box. i'm using spring boot 2.x with zuul with dynamic content and without any caching. the responses are 32k on average. the only difference is that i am using undertow container with okhttp and we have a custom pre filter that validates JWT from Redis so there is overhead but even with that i can get close to 70% TPS compared to just going directly to origin using i dunno guys. Netflix is using Zuul 1 for their services at one point and they're dealing with video. they even admit that Zuul 2 has 25% net effect in througput. not sure how one can claim that it's not good enough for whatever it's going to be used for. |
I'm going to close this. I agree with the benchmark on one machine problem first of all. Second running the benchmark with the latest releases (Finchley and Greenwich) does not yield the large drops in performance as on mentioned in the sample (which was running a RC). I also threw in zuul1 on port 8083
|
testing localhost aside... i can't comment on the cloud gateway but there is something seriously wrong with your the zuul1 setup. 80% drop? ok... |
There was no setup, a default zuul app from start.spring.io using tomcat with a single route. |
look, i'm not here to knock spring-cloud-gateway. i have no sound opinion of it because i've never used it. i'm sure it's great. i find it suspicious, however, when someone tries to knock zuul 1 and i came to this thread to point out that this is not my experience at all. i'm compelled to write my findings here so people considering spring cloud 2.x + zuul wouldn't just rule it out completely upon reading this thread. again, zuul 1 is from Netflix and have used it in production; i highly doubt they would have even promoted it let alone open source it if there's 80% drop in throughput when using. there are a number of online blog posts and articles pitting zuul 1 against nginx and it holds its own, if not perform better in some scenarios. that's all i'm saying. |
I don't disagree. We went with zuul 1 for that reason. The vanilla experience is NOT optimized. |
@spencergibb @dalegaspi @maoyunfei We had similar performance issues with Spring Cloud Gateway(Finchley.SR1), please find comparison metrics below.
Test Server Configuration: M4.xLarge AWS Instance — 4 Core CPU, 16GB of Memory It's very confused state if spring cloud gateway can be used in prod, please provide your comments. |
@VinodKandula can you share more than just metrics? What do the individual apps look like, how were they configured, how did you test them? |
@spencergibb
All rest endpoints are fired via Zuul/Gateway which uses the discovery server to get the list of available instances. |
@spencergibb hi, spencer, can you retry your wrk test command with option |
spring cloud gateway and zuul 1 both performance is very low ...... |
we are using Spring Boot 2.x and Zuul 1.x and we found the performance really good. however, the default settings are just severely under-optimized. after considerable experimentation and research, i came up with these settings. our use case has the following:
with the optimized settings and with those 3 filters and sleuth enabled running in ECS with ALB, there is less than 10% drop in throughput on several load tests (only 1 instance of app running in ECS on load tests)...honestly, this shouldn't really come as a surprise since Zuul 1.x is battle-tested and performs really well if configured correctly. |
Thanks Dalegaspi....as u mentioned u performed load test with zuu1.x and spring boot 2 so can u explain |
@atverma91 actually the recent tests shows there is no perceptible drop in throughput; if we turn on compression in Zuul we even perform better. This is the results in our latest test with compression enabled in Zuul.
this is with JMeter, 50 threads and 15 minutes continuous run. it's key that when you perform load tests that the JVM is warmed up and that the client is not on the same box as service; clients are not going to be running on the same box as your service it baffles me why some load tests insist on having the service and the benchmarking app on one box. |
This isn't the place to discuss zuul performance without gateway. Please take the conversation offline. |
I hava read the performance comparison from spring-cloud-gateway-bench.
According to the comparison result, although gateway is best compared with linkered and zuul, but it's performance only reach about 1/4 of none proxy.
I made some tests with different situation, such as different response time and response body size. I used wrk for tests. I found it seems that gateway's performance only influenced by response body size, with bigger than about 10kb size, it will drop rapidly.
So how to optimalize gateway to do better?
The text was updated successfully, but these errors were encountered: