Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Managing concurrent processing of a particular service in a webapp

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Sorry if this isnt the right subforum.
I need some direction on an approach for a design.
I have 2 tomcat servers which hosts 2 instances of an app facing users. This app communicates with multiple(3 or 4) tomcat instances of a webservices app hosted on some other servers using SOAP & URLConnection(filestream) for data. Requests to the tomcat instances are handled by a load balancer.
One of the servlets in the external userfacing app is frequently used by users. This servlet when executes actually opens a URLConnection to a service hosted on the webservices app to get the stream of data.This particular service hits DB to get the data. Around 20 DB conn in a pool.

Due to the heavy load,outofmemory server crashes sometimes (DB conn being not available etc), I am planning to restrict no of concurrent requests this particular 'Servlet App => URLConnection => WebService App' service and queue up requests to an extent.

I need advice on the best way this can be achieved. What kind of a mechanism can be implemented?Which app should be considered for setting up restriction considering the load balancers/multiple instances?
Is ThreadPoolExecutor in Java 5 a good choice for this design?

Thanks in Advance
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic