larry-cdn77 commented on code in PR #851:
URL: https://github.com/apache/zookeeper/pull/851#discussion_r901802640


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java:
##########
@@ -139,9 +163,12 @@ public void run() {
             // we do this in an attempt to ensure that not all of the servers
             // in the ensemble take a snapshot at the same time
             resetSnapshotStats();
+            lastFlushTime = Time.currentElapsedTime();
             while (true) {
-                Request si = queuedRequests.poll();
+                long pollTime = Math.min(zks.getMaxWriteQueuePollTime(), 
getRemainingDelay());
+                Request si = queuedRequests.poll(pollTime, 
TimeUnit.MILLISECONDS);

Review Comment:
   Could this `LinkedBlockingQueue.poll` lead to a fair amount of spinning when 
a non-zero `pollTime` is specified? In my use case in the order of ten thousand 
transactions/sec I have seen CPU usage explode from 3-5% to 30-40%, sending my 
adjoining ClickHouse cluster to its knees. I should add that total fsync time 
did improve 😄 



-- 
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: notifications-unsubscr...@zookeeper.apache.org

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

Reply via email to