Closed stephenplusplus closed 6 years ago
From @lukesneeringer on July 5, 2017 15:14
@bmenasha Thank you for reporting this (and sorry it took so long to get back to you on it).
I am guessing delay_threshold_millis
should have been 10,000 instead of 10, but I am not the most familiar with this module. Would that make sense in your mind?
I also agree that this should not block.
From @bmenasha on July 6, 2017 3:48
Would that make sense in your mind?
Sure.
@lukesneeringer should we go ahead and update this value, or is there someone we need to ping first?
From @landrito on August 9, 2017 22:28
Updating this gax value would involve changing it at the generator config level for logging. I'd like to invite @pongad to chime in on changing this to 10,000 from 10.
From @pongad on August 10, 2017 5:6
I'm not familiar with how bundling is implemented in node. I'm a little confused that it blocks. Node in single threaded, so if you block waiting for either 100 elements in the batch or 10ms to pass before sending the request, you'll always wait 10ms since nothing can add more elements into the batch right? Did I misunderstand?
Or maybe we're waiting to send one batch because there's another batch pending or something...?
From @ofrobots on August 14, 2017 18:37
A few points here:
mongo-update
is dependent on the logging call to finish. @bmenasha: you should be able to avoid this dependency in your own code by moving the mongo-update logic outside of the callback from log.write
. Let me know if my guesses here are incorrect.@pongad Node is concurrent through asynchronous APIs. Network calls do not block user code, but you can write code that waits for the network call to finish before proceeding.
From @ofrobots on August 14, 2017 18:43
@bmenasha I also noticed that your logging calls seem very expensive – that doesn't look normal, unless you are logging large amounts of data. Can you verify that is the case? Also, are you using the logging library directly or are you using the higher level libraries (google-cloud/logging-winston, google-cloud/logging-bunyan)?
@bmenasha @ofrobots just for clarity-- is there a bug here?
From @ofrobots on September 1, 2017 22:37
I don't believe there is a bug here, but It would be good to get input from @bmenasha to make sure I am not making any incorrect assumptions.
I'm going to close, given the age of the issue. If there is still work left to be done, please let me know, and we will re-open.
From @bmenasha on June 27, 2017 20:41
Steps to reproduce
when I examine the requests in cloud trace it's clear that the request is being held up by calls to the logging API, worse, there are MULTIPLE calls to the cloud logging api in a single request. This results in some pretty poor performance. Consider:
Here is a stackdtrace from one of these logging calls:
Perhaps this is due to the VERY aggressive 10ms bundling in the gax config file:
I think we should have better defaults (batch/bundle more) and also find a way to send these log (and trace) requests asynchronously so they don't block the current request from returning. Thanks
Copied from original issue: GoogleCloudPlatform/google-cloud-node#2416