Performance Issue with Spring BOOT 1.5.6











up vote
0
down vote

favorite












Performance Issue with Spring BOOT 1.5.6



We are using a spring boot java based REST API application where we have the below spring MVC async parameters. Under heavy load when the endpoint is tested the endpoint is returning API response avg of 30-50 seconds. This is happening when we have a sudden burst of 10 minutes. Our ideal time for the API response 75% percentile is between 1- 2 seconds. Below is the configuration, we are using 6 C5x large instances having 4 cores each/per instance.



spring.mvc.async.properties.web.executor.minPoolSize=50
spring.mvc.async.properties.web.executor.maxPoolSize=100
spring.mvc.async.properties.web.executor.maxQueueSize=50
#Hikari Data source properties.
spring.datasource.hikari.minimumIdle=25
spring.datasource.hikari.maximumPoolSize=90
spring.datasource.hikari.idleTimeout=600000


Appreciate for any scalability suggestions.



Also we also identified in few calls that dB calls are taking time and we are trying to find out if anything need to be fined tuned in the query but I think the threads are waiting on the dB response.Also with async thread executor with policy as discard policy is there any chance of rejecting any task submitted ? Iam expecting the tasks to be queued instead of rejecting under load .we moved away from callerRuns policy to discard policy.Any thoughts on that or anything else required from spring boot side or from thread pool size execution side ? Thanks










share|improve this question
























  • what is your regular load? and load during hike? how much time does hike stay?
    – Deadpool
    Nov 8 at 3:04










  • We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
    – Kran
    Nov 8 at 3:48

















up vote
0
down vote

favorite












Performance Issue with Spring BOOT 1.5.6



We are using a spring boot java based REST API application where we have the below spring MVC async parameters. Under heavy load when the endpoint is tested the endpoint is returning API response avg of 30-50 seconds. This is happening when we have a sudden burst of 10 minutes. Our ideal time for the API response 75% percentile is between 1- 2 seconds. Below is the configuration, we are using 6 C5x large instances having 4 cores each/per instance.



spring.mvc.async.properties.web.executor.minPoolSize=50
spring.mvc.async.properties.web.executor.maxPoolSize=100
spring.mvc.async.properties.web.executor.maxQueueSize=50
#Hikari Data source properties.
spring.datasource.hikari.minimumIdle=25
spring.datasource.hikari.maximumPoolSize=90
spring.datasource.hikari.idleTimeout=600000


Appreciate for any scalability suggestions.



Also we also identified in few calls that dB calls are taking time and we are trying to find out if anything need to be fined tuned in the query but I think the threads are waiting on the dB response.Also with async thread executor with policy as discard policy is there any chance of rejecting any task submitted ? Iam expecting the tasks to be queued instead of rejecting under load .we moved away from callerRuns policy to discard policy.Any thoughts on that or anything else required from spring boot side or from thread pool size execution side ? Thanks










share|improve this question
























  • what is your regular load? and load during hike? how much time does hike stay?
    – Deadpool
    Nov 8 at 3:04










  • We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
    – Kran
    Nov 8 at 3:48















up vote
0
down vote

favorite









up vote
0
down vote

favorite











Performance Issue with Spring BOOT 1.5.6



We are using a spring boot java based REST API application where we have the below spring MVC async parameters. Under heavy load when the endpoint is tested the endpoint is returning API response avg of 30-50 seconds. This is happening when we have a sudden burst of 10 minutes. Our ideal time for the API response 75% percentile is between 1- 2 seconds. Below is the configuration, we are using 6 C5x large instances having 4 cores each/per instance.



spring.mvc.async.properties.web.executor.minPoolSize=50
spring.mvc.async.properties.web.executor.maxPoolSize=100
spring.mvc.async.properties.web.executor.maxQueueSize=50
#Hikari Data source properties.
spring.datasource.hikari.minimumIdle=25
spring.datasource.hikari.maximumPoolSize=90
spring.datasource.hikari.idleTimeout=600000


Appreciate for any scalability suggestions.



Also we also identified in few calls that dB calls are taking time and we are trying to find out if anything need to be fined tuned in the query but I think the threads are waiting on the dB response.Also with async thread executor with policy as discard policy is there any chance of rejecting any task submitted ? Iam expecting the tasks to be queued instead of rejecting under load .we moved away from callerRuns policy to discard policy.Any thoughts on that or anything else required from spring boot side or from thread pool size execution side ? Thanks










share|improve this question















Performance Issue with Spring BOOT 1.5.6



We are using a spring boot java based REST API application where we have the below spring MVC async parameters. Under heavy load when the endpoint is tested the endpoint is returning API response avg of 30-50 seconds. This is happening when we have a sudden burst of 10 minutes. Our ideal time for the API response 75% percentile is between 1- 2 seconds. Below is the configuration, we are using 6 C5x large instances having 4 cores each/per instance.



spring.mvc.async.properties.web.executor.minPoolSize=50
spring.mvc.async.properties.web.executor.maxPoolSize=100
spring.mvc.async.properties.web.executor.maxQueueSize=50
#Hikari Data source properties.
spring.datasource.hikari.minimumIdle=25
spring.datasource.hikari.maximumPoolSize=90
spring.datasource.hikari.idleTimeout=600000


Appreciate for any scalability suggestions.



Also we also identified in few calls that dB calls are taking time and we are trying to find out if anything need to be fined tuned in the query but I think the threads are waiting on the dB response.Also with async thread executor with policy as discard policy is there any chance of rejecting any task submitted ? Iam expecting the tasks to be queued instead of rejecting under load .we moved away from callerRuns policy to discard policy.Any thoughts on that or anything else required from spring boot side or from thread pool size execution side ? Thanks







java spring spring-boot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 21:44

























asked Nov 8 at 2:58









Kran

3913




3913












  • what is your regular load? and load during hike? how much time does hike stay?
    – Deadpool
    Nov 8 at 3:04










  • We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
    – Kran
    Nov 8 at 3:48




















  • what is your regular load? and load during hike? how much time does hike stay?
    – Deadpool
    Nov 8 at 3:04










  • We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
    – Kran
    Nov 8 at 3:48


















what is your regular load? and load during hike? how much time does hike stay?
– Deadpool
Nov 8 at 3:04




what is your regular load? and load during hike? how much time does hike stay?
– Deadpool
Nov 8 at 3:04












We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
– Kran
Nov 8 at 3:48






We have a initial burst of 10 seconds and requests load peaks up to 10k/minute. The hike stays almost for 10 -15 minutes and about 5 % of the calls fail as we have a 10 seconds SLA limit.
– Kran
Nov 8 at 3:48














2 Answers
2






active

oldest

votes

















up vote
0
down vote













I think as a first resort you should try to identify the bottleneck of this flow



The key tool for this is metrics.



I see that you use Hikari here and it exposes metrics automatically by its own.
Maybe the Database works hard and it becomes a bottleneck, in this case, it will take a relatively long time to acquire a DB connection from the pool.



Another possible issue can be if the actual requests to the service carry a lot of content with it (maybe its a "big file upload" operation, I don't know whether its a case, but still worth checking).



So I suggest using metrics (built-in or custom). Spring boot has an excellent integration with Metering systems (Micrometer for spring boot 2 and dropwizard metrics for spring boot 1.x)






share|improve this answer




























    up vote
    0
    down vote













    Thnsks Mark for your reply. That’s correct Iam looking at the metrics exposed by micrometer with /metrics. Also we just modified to see how it works from bounded queue to unbounded queue by only specifying the core pool size to 100 and removing all the above mentioned custom tuning of the min pool size and max pool size. The DB connections we have right now are 90*6 instances. Under load it’s using only till 300+ connections. The service returns a payload between 1.8kb to max of 2MB.






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200922%2fperformance-issue-with-spring-boot-1-5-6%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      I think as a first resort you should try to identify the bottleneck of this flow



      The key tool for this is metrics.



      I see that you use Hikari here and it exposes metrics automatically by its own.
      Maybe the Database works hard and it becomes a bottleneck, in this case, it will take a relatively long time to acquire a DB connection from the pool.



      Another possible issue can be if the actual requests to the service carry a lot of content with it (maybe its a "big file upload" operation, I don't know whether its a case, but still worth checking).



      So I suggest using metrics (built-in or custom). Spring boot has an excellent integration with Metering systems (Micrometer for spring boot 2 and dropwizard metrics for spring boot 1.x)






      share|improve this answer

























        up vote
        0
        down vote













        I think as a first resort you should try to identify the bottleneck of this flow



        The key tool for this is metrics.



        I see that you use Hikari here and it exposes metrics automatically by its own.
        Maybe the Database works hard and it becomes a bottleneck, in this case, it will take a relatively long time to acquire a DB connection from the pool.



        Another possible issue can be if the actual requests to the service carry a lot of content with it (maybe its a "big file upload" operation, I don't know whether its a case, but still worth checking).



        So I suggest using metrics (built-in or custom). Spring boot has an excellent integration with Metering systems (Micrometer for spring boot 2 and dropwizard metrics for spring boot 1.x)






        share|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          I think as a first resort you should try to identify the bottleneck of this flow



          The key tool for this is metrics.



          I see that you use Hikari here and it exposes metrics automatically by its own.
          Maybe the Database works hard and it becomes a bottleneck, in this case, it will take a relatively long time to acquire a DB connection from the pool.



          Another possible issue can be if the actual requests to the service carry a lot of content with it (maybe its a "big file upload" operation, I don't know whether its a case, but still worth checking).



          So I suggest using metrics (built-in or custom). Spring boot has an excellent integration with Metering systems (Micrometer for spring boot 2 and dropwizard metrics for spring boot 1.x)






          share|improve this answer












          I think as a first resort you should try to identify the bottleneck of this flow



          The key tool for this is metrics.



          I see that you use Hikari here and it exposes metrics automatically by its own.
          Maybe the Database works hard and it becomes a bottleneck, in this case, it will take a relatively long time to acquire a DB connection from the pool.



          Another possible issue can be if the actual requests to the service carry a lot of content with it (maybe its a "big file upload" operation, I don't know whether its a case, but still worth checking).



          So I suggest using metrics (built-in or custom). Spring boot has an excellent integration with Metering systems (Micrometer for spring boot 2 and dropwizard metrics for spring boot 1.x)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 at 5:34









          Mark Bramnik

          11.2k32445




          11.2k32445
























              up vote
              0
              down vote













              Thnsks Mark for your reply. That’s correct Iam looking at the metrics exposed by micrometer with /metrics. Also we just modified to see how it works from bounded queue to unbounded queue by only specifying the core pool size to 100 and removing all the above mentioned custom tuning of the min pool size and max pool size. The DB connections we have right now are 90*6 instances. Under load it’s using only till 300+ connections. The service returns a payload between 1.8kb to max of 2MB.






              share|improve this answer

























                up vote
                0
                down vote













                Thnsks Mark for your reply. That’s correct Iam looking at the metrics exposed by micrometer with /metrics. Also we just modified to see how it works from bounded queue to unbounded queue by only specifying the core pool size to 100 and removing all the above mentioned custom tuning of the min pool size and max pool size. The DB connections we have right now are 90*6 instances. Under load it’s using only till 300+ connections. The service returns a payload between 1.8kb to max of 2MB.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Thnsks Mark for your reply. That’s correct Iam looking at the metrics exposed by micrometer with /metrics. Also we just modified to see how it works from bounded queue to unbounded queue by only specifying the core pool size to 100 and removing all the above mentioned custom tuning of the min pool size and max pool size. The DB connections we have right now are 90*6 instances. Under load it’s using only till 300+ connections. The service returns a payload between 1.8kb to max of 2MB.






                  share|improve this answer












                  Thnsks Mark for your reply. That’s correct Iam looking at the metrics exposed by micrometer with /metrics. Also we just modified to see how it works from bounded queue to unbounded queue by only specifying the core pool size to 100 and removing all the above mentioned custom tuning of the min pool size and max pool size. The DB connections we have right now are 90*6 instances. Under load it’s using only till 300+ connections. The service returns a payload between 1.8kb to max of 2MB.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 9 at 9:05









                  Kran

                  3913




                  3913






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200922%2fperformance-issue-with-spring-boot-1-5-6%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      這個網誌中的熱門文章

                      Tangent Lines Diagram Along Smooth Curve

                      Yusuf al-Mu'taman ibn Hud

                      Zucchini