Forum Discussion

ramprabu1983's avatar
ramprabu1983
New Contributor
6 years ago
Solved

Performance degrades in pattern when using swagger API

Hi All,

 

We have swagger enabled in our Spring Boot Microservice project. It really works great. During performance testing we have identified one of request at every 30 seconds takes 8 times higher then the actual time. For instance our API takes usally 30 to 50 ms (milli seconds) to process the request, but the request comes at 30th second will take around 450 ms. We are using routing and load balancer components like Zuul, Eureka, Ribbon and thought some of these components might impact the performance, after removing all these 3 components we still had that performance issue.

 

We never had a thought about Swagger, but at last we removed the Swagger completely and gained all the performance back, like all request takes only 30 to 50 ms only. We don't know what Swagger is trying to do at every 30th second, even don't have any idea how disable that or atleast extend the 30th second to some other number.

 

We understand that 450 ms at 30th second costs less only, but we are having millions of requests everyday so we have to fix that.

 

So did anyone had this problem before or know anything about this issue, please let me know.

 

Thanks for your time to read this.

 

  • RonRatovsky's avatar
    RonRatovsky
    6 years ago

    Okay, so you're using Springfox but not SwaggerHub. As such, the question itself is placed in the wrong forum.

     

    Regardless, Springfox is not one of our projects and we don't know it well enough to provide support for it. That said, I can't imagine why Springfox would have any performance impact on your code as it's not supposed to do anything at runtime besides an initial pass. If you feel it hurts your performance, please file a ticket with the Springfox project, and hopefully they'll be able to assist.

3 Replies

  • What do you mean Swagger API in this context? Are you using SwaggerHub in any way?

     

    • ramprabu1983's avatar
      ramprabu1983
      New Contributor

      Swagger API is to generate rest API documentation for services under controller using Springfox jars.

      • RonRatovsky's avatar
        RonRatovsky
        Moderator

        Okay, so you're using Springfox but not SwaggerHub. As such, the question itself is placed in the wrong forum.

         

        Regardless, Springfox is not one of our projects and we don't know it well enough to provide support for it. That said, I can't imagine why Springfox would have any performance impact on your code as it's not supposed to do anything at runtime besides an initial pass. If you feel it hurts your performance, please file a ticket with the Springfox project, and hopefully they'll be able to assist.