title: Jedis - high performing servlet - settings
body: <p>We are running a servlet on Elastic Beanstalk where we connect to ElastiCache and it's running fairly well but now we are getting high CPU loads (50%) in peak periods and are looking into optimizing it. </p>
  
  <p>At the moment we are using Jedis like this:</p>
  
  <pre><code>try (Jedis jedis = new Jedis(Global.CLUSTER_ENDPOINT, 6379, 10000);) {              
      jedis.hset(f.dayOfFile, "content", f.xmlFile);
  }
  </code></pre>
  
  <p>One issue we have is that the number of active connections suddenly rose to 8400 and is not going down. Doesn't seem to affect anything but still wonder how it went that high and if that affects performance. </p>
  
  <p>So my question is:</p>
  
  <ol>
  <li>Should we use another library like lettuce (<a href="https://github.com/mp911de/lettuce" rel="nofollow">https://github.com/mp911de/lettuce</a>) which seems better maintained? </li>
  <li>Or should we use connection pooling? We have millions of requests each day so a bit afraid to switch over to connection pooling if that introduces other issues like max connections in the pool?</li>
  <li>Or is there anything else we should tweak?</li>
  </ol>