You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/05/03 16:52:29 UTC

[GitHub] [beam] reuvenlax commented on a diff in pull request #17417: [BEAM-14388] Address some performance problems with the storage API

reuvenlax commented on code in PR #17417:
URL: https://github.com/apache/beam/pull/17417#discussion_r863985565


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -275,7 +321,13 @@ void flush(RetryManager<AppendRowsResponse, Context<AppendRowsResponse>> retryMa
                   offset = this.currentOffset;
                   this.currentOffset += inserts.getSerializedRowsCount();
                 }
-                return writeStream.appendRows(offset, protoRows);
+                ApiFuture<AppendRowsResponse> response = writeStream.appendRows(offset, protoRows);
+                inflightWaitSecondsDistribution.update(writeStream.getInflightWaitSeconds());
+                if (writeStream.getInflightWaitSeconds() > 5) {
+                  LOG.warn(
+                      "Storage Api write delay more than " + writeStream.getInflightWaitSeconds());
+                }
+                return response;

Review Comment:
   getInFlightWaitSeconds does measure the exec time of the lambda for the most part (the rest of the code merely appends to an in-memory list, which should be very fast). Locking is better measured with a contention metric I think - need to see if we have any way of measuring this in the wild.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org