User their optimized connection.active? instead of a full SELECT
query, skipping extra client & server overhead on AR adapters that offer
a faster path.
The mysql2 adapter, for example, uses a connection PING command to check
connection liveness. I measured ~0.39ms to SELECT and ~0.07ms to PING on
a typical production host.
User their optimized
connection.active?
instead of a full SELECT query, skipping extra client & server overhead on AR adapters that offer a faster path.The mysql2 adapter, for example, uses a connection PING command to check connection liveness. I measured ~0.39ms to SELECT and ~0.07ms to PING on a typical production host.