-
- Downloads
Test data warehouse connections on checkout (#11018)
c3p0 has an option to test connections when fetched from the connection pool intended to fix that exact problem, so this was a simple matter of enabling it. It is not enabled by default because it adds overhead to connection checkout, especially for JDBC drivers that don't support the full JDBC 4 API, which includes a Connection.isValid() method. However, all of our JDBC drivers are JDBC 4 compliant, meaning c3p0 can check connection validity fairly efficiently. With the data warehouse on the same machine as the Metabase server, the added overhead was in the order of ~100µs, or an order of magnitude or two below the threshold of human perception. With the data warehouse in AWS us-east-1 and the Metabase server in San Francisco, the overhead was around ~70ms, which is basically typical network latency for such a request. Based on those results, it appears that the additional cost of this test is roughly equal to the network latency of the request. IRL the Metabase server and data warehouse are likely to be located in closer geographical proximity to one another than my trans-contintental tests, if not in the same AWS region (or equivalent). I would expect the added overhead for most query executions for most setups to be in the 1-10ms range and the p99 to be under 100ms extra latency. Accepting that overhead seems like a no-brainer when considering that an entire class of bugs will be fixed by enabling the option.
Showing
- modules/drivers/sparksql/project.clj 1 addition, 1 deletionmodules/drivers/sparksql/project.clj
- modules/drivers/sparksql/src/metabase/driver/hive_like.clj 11 additions, 1 deletionmodules/drivers/sparksql/src/metabase/driver/hive_like.clj
- src/metabase/driver/sql_jdbc/connection.clj 74 additions, 36 deletionssrc/metabase/driver/sql_jdbc/connection.clj
Please register or sign in to comment