cmcfarlen commented on code in PR #14000:
URL: https://github.com/apache/trafficserver/pull/14000#discussion_r4485139467


##########
src/iocore/eventsystem/UnixEThread.cc:
##########
@@ -264,6 +272,13 @@ EThread::execute_regular()
     EventStatistics statistics = fire_ready_events(loop_start_time);
     ink_hrtime      sleep_time = get_sleep_time(statistics.event_time, 
current_slice);
 
+    // Flush before a sleep that would outlast the interval too, so an idle 
thread's counters are current.
+    if (counter_flush_interval > 0 &&
+        (statistics.event_time - last_counter_flush >= counter_flush_interval 
|| sleep_time >= counter_flush_interval)) {

Review Comment:
   Follow-up: I benchmarked flushing only at the blocking waits, and it was 
worse: −5% on cache hits at 32 threads, and −58% without #13999, because 
threads then pile onto the remap table's spin lock. Under load a loop turn 
already covers many transactions, so per-turn flushing still batches. The 
change is reverted in bc43b1f27b and the overflow fix stays. The documented 
upper bound on lag (the interval, or until the thread goes idle) still holds.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to