Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Oct 09, 2019
  2. Oct 08, 2019
  3. Oct 07, 2019
  4. Oct 04, 2019
  5. Oct 03, 2019
  6. Oct 02, 2019
  7. Oct 01, 2019
  8. Sep 30, 2019
    • Cam Saul's avatar
    • Cam Saul's avatar
      BigQuery code improvements (#11024) · 10037cda
      Cam Saul authored
      Unverified
      10037cda
    • Cam Saul's avatar
      Test data warehouse connections on checkout (#11018) · cbabdf4e
      Cam Saul authored
      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.
      Unverified
      cbabdf4e
Loading