title: Optimise a Spring Boot backend for high CPU/memory workloads
body: <p>I am running a Spring Boot application that acts as a backend for a frontend Javascript application. The frontend is served to the client as a static resource and the backend serves API requests coming from it. The application is initially designed to run on-premise but should be built in a way that allows easy porting to a cloud-native solution.</p>
  <p>I expect the backend to do some heavy lifting ETL work which will be heavy on the memory and CPU side. At the same time, it won't need to scale to serve many concurrent requests - it only really needs to serve requests that kick-off and manage the jobs, which will be invoked by a single user who's interfacing with it.</p>
  <p>What are some parameters that I could tweak to fine-tune for this type of deployment?</p>
  <p>Current thinking:</p>
  <ul>
  <li>Reduce <code>server.tomcat.max-threads</code> to a single digit to minimize the footprint of the request thread pool as I am not expected to handle more than one-two concurrently</li>
  <li>Do the same for the database connection pool</li>
  <li>Fine-tune <code>Xms</code> and <code>Xmx</code> when launching the JAR</li>
  </ul>
  <p>I would appreciate any other insights about how to make sure that the Java application takes up as big a footprint on the system as it can as well as Spring Boot specific parameters that I could tweak. Thank you.</p>