title: What is the ideal corePoolSize for ScheduledThreadPoolExecutor?
body: <p>In my Java web application, I am using a ScheduledThreadPoolExecutor to periodically check the database connection status. This is for every authenticated user (per authentication).</p>
  <pre><code>ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(0);
  
  Runnable task = new Runnable() {
       public void run() {
            //check the status of the database connection, and log the result
       }
  };
  
          
  executor.scheduleWithFixedDelay(task, 0, 10, TimeUnit.MINUTES);
  </code></pre>
  <p>However, ScheduledThreadPoolExecutor consumes 100% CPU when corePoolSize = 0. Setting corePoolSize = 1, resolves the issue.</p>
  <pre><code>ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
  </code></pre>
  <p>In production we would have hundreds of users. <strong>My question is, in this case, what would be the ideal value for corePoolSize?</strong></p>