Our MySQL connections were leaking, causing too many open connections error. With the result, we were losing a lot of webhooks in Shopify. There were two ways to approach the problem – one is to start digging into the codes directly and fix the problem. Second one was to solve the problem with a hack and then dig deeper into codes.
[mysqld] connect_timeout=2 #2 seconds are more than enough for any web request to handle.