Benefits of connection pooling with Redis and Unicorn
<p>Background: I have a Ruby/Rails + Nginx/Unicorn web app with connections to multiple Redis DBs (i.e. I am not using <code>Redis.current</code> and am instead using global variables for my different connections). I understanding that I need to create a new connection in the <code>after_fork</code> block when a new Unicorn worker is created, as explained <a href="https://marianovalles.wordpress.com/2013/04/01/redis-you-shall-never-be-blamed/" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/21075781/redis-global-variable-with-ruby-on-rails">here</a>.</p>

<p>My question is about the need for connection pooling. According to <a href="https://stackoverflow.com/questions/22403952/is-my-understanding-of-unicorn-sidekiq-and-db-pool-size-correct">this</a> SO thread, <em>"In Unicorn each process establishes its own connection pool, so you if your db pool setting is 5 and you have 5 Unicorn workers then you can have up to 25 connections. However, since each unicorn worker can handle only one connection at a time, then unless your app uses threading internally each worker will only actually use one db connection... Having a pool size greater than 1 means each Unicorn worker has access to connections it can't use, but it won't actually open the connections, so that doesn't matter."</em></p>

<p>Since I am NOT using Sidekiq, do I even need to use connection pools for my Redis connections? Is there any benefit of a connection pool with a pool size of 1? Or should I simply use variables with single connections -- e.g. Redis.new(url: ENV["MY_CACHE"])?</p>