title: Google BigQuery: Slow streaming inserts performance
body: <p>We are using BigQuery as event logging platform.</p>
  
  <p>The problem we faced was very slow insertAll post requests (<a href="https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll" rel="nofollow noreferrer">https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll</a>).
  It does not matter where they are fired - from server or client side.</p>
  
  <p>Minimum is 900ms, average is 1500s, where nearly 1000ms is connection time.
  Even if there is 1 request per second (so no throttling here).</p>
  
  <p>We use Google Analytics measurement protocol and timings from the same machines are 50-150ms.</p>
  
  <p>The solution described in <a href="https://stackoverflow.com/questions/24522211/bigquery-streaming-insertall-performance-with-php">BigQuery streaming &#39;insertAll&#39; performance with PHP</a> suugested to use queues, but it seems to be overkill because we send no more than 10 requests per second.</p>
  
  <p>The question is if 1500ms is normal for streaming inserts and if not, how to make them faster.</p>
  
  <p>Addtional information:
  If we send malformed JSON, response arrives in 50-100ms.</p>