7 Matching Annotations
  1. Mar 2018
    1. All SQLAlchemy pool implementations have in common that none of them “pre create” connections - all implementations wait until first use before creating a connection. At that point, if no additional concurrent checkout requests for more connections are made, no additional connections are created. This is why it’s perfectly fine for create_engine() to default to using a QueuePool of size five without regard to whether or not the application really needs five connections queued up - the pool would only grow to that size if the application actually used five connections concurrently, in which case the usage of a small pool is an entirely appropriate default behavior.

      The default connection pool is a "small pool"-as other data seems to indicate thus further pointing to increasing our pool size would be a good place to start. Also note the default pool doesn't start out with all those connections it ramps up and discards all connections above pool_size.

    2. Particularly for server-side web applications, a connection pool is the standard way to maintain a “pool” of active database connections in memory which are reused across requests.

      This is something that appears to be not currently happening as our 'default state' number of connections is 50 in total. Rather than taking the thrash as traffic ramps we should maintain more connections in the queue by default. This will avoid cpu thrash as creating connections is an expensive cpu thrashing operation.