We recently had a case reported from a customer experiencing unexplained timeouts on db2_connect() operations.  The resolution turned out to have nothing to do with DB2, but rather there was excess queuing despite low CPU usage for partitions using shared CPU.  The customer provided us with this link to the IBM technote:

Circumvention for High CPU queuing with low CPU utilization on POWER7 and POWER8

The technote mentions an immediate workaround that can alleviate the problem, and lists the firmware updates needed to provide a permanent fix. We recommend that any of our customers running partitions with shared CPU should check for this firmware update.