0

When I use spring cloud gateway to integrate spring cloud sleuth, I find that the performance is much slower than using spring cloud gateway alone. Is there any optimization scheme?

Machine configuration:6 core, 16g

spring cloud gateway:5331.9 tps

spring cloud gateway + spring cloud sleuth:4119.47 tps

“spring cloud gateway” is about 1000-2000tps slower than “spring cloud gateway + spring cloud sleuth”, and “spring cloud gateway + spring cloud sleuth” performance is reduced by 22%

yanglaoda
  • 3
  • 1

1 Answers1

1

You can check the release notes https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#up-till-300-m5 and this issue https://github.com/spring-cloud/spring-cloud-sleuth/issues/1710 to see that with the latest release (2020.0.0) we've migrated to manual reactor instrumentation mode so you should see a significant improvement in performance.

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32
  • Thank you for your reply. I upgraded to 2020.0.0-m6 and found that the performance of SCG has been improved by about 25%. Thank you very much. Then I found that Zipkin sender consumes the most performance. In fact, sleuth has little effect on performance alone. – yanglaoda Feb 23 '21 at 14:13
  • Cool. Please upgrade to the latest stable version. We already have 2020.0.1 – Marcin Grzejszczak Feb 24 '21 at 12:28
  • Okay, great, got it. – yanglaoda Feb 25 '21 at 13:15
  • @MarcinGrzejszczak am facing similar problem not exactly same. i am using spring cloud gateway and i have 2 custom filters globally. in which 1 is responsible to read the request body and manipulate and other one is adding access and refresh token to response headers after interacting with keycloak server. do you see any problem here? response times are increasing significantly, but not all times only some times. overage every 500 request 10 are getting affected approximately. thanks. – jbaddam17 Mar 10 '22 at 02:57
  • if you're using the manual mode then I would be really surprised. Do you see the same problem when Sleuth is disabled? – Marcin Grzejszczak Mar 15 '22 at 08:36