title: GCP Pubsub high latency on low message/sec
body: <p>I'm publishing Pubsub messages from AppEngine Flexible environment with the JAVA client library like this:</p>
  
  <pre><code>Publisher publisher = Publisher
                  .newBuilder(ProjectTopicName.of(Utils.getApplicationId(), "test-topic"))
                  .setBatchingSettings(
                          BatchingSettings.newBuilder()
                                  .setIsEnabled(false)
                                  .build())
                  .build();
  
  publisher.publish(PubsubMessage.newBuilder()
                  .setData(ByteString.copyFromUtf8(message))
                  .putAttributes("timestamp", String.valueOf(System.currentTimeMillis()))
                  .build());
  </code></pre>
  
  <p>I'm subscribing to the topic in Dataflow and logging how long it takes for the message to reach Dataflow from AppEngine flexible</p>
  
  <pre><code>pipeline
              .apply(PubsubIO.readMessagesWithAttributes().fromSubscription(Utils.buildPubsubSubscription(Constants.PROJECT_NAME, "test-topic")))
              .apply(ParDo.of(new DoFn&lt;PubsubMessage, PubsubMessage&gt;() {
                  @ProcessElement
                  public void processElement(ProcessContext c) {
                      long timestamp = System.currentTimeMillis() - Long.parseLong(c.element().getAttribute("timestamp"));
                      System.out.println("Time: " + timestamp);
                  }
              }));
      pipeline.run();
  </code></pre>
  
  <p>When I'm publishing messages at the rate of a few messages per second then the logs show that the time needed for  the message to reach Dataflow is between 100ms and 1.5 seconds.
  But when the rate is about 100 messages per second then the time is constantly between 100ms - 200ms, which seems totally adequate.
  Can someone explain this behavior. It seems as turning off the publisher batching does not work.</p>