bryancall opened a new pull request, #13817:
URL: https://github.com/apache/trafficserver/pull/13817

   This adds `benchmark_abuse_shield`, a Catch2 benchmark for the abuse_shield 
IP trackers. It covers the per-request hook path, the 1 Hz maintenance pass, 
stats sync, and new IPs arriving at a full table, each at 10k, 50k and 100k 
slots. It builds only with `-DENABLE_BENCHMARKS=ON` and is not registered with 
ctest, so CI time is unchanged.
   
   `abuse_shield.cc` calls the TS API, so the loops it needs 
(`consume_rule_buckets`, `prune_rule_buckets`, `sync_tracker_stats` and the 
rate evaluation) are copied into the benchmark with the TS calls removed, each 
marked with the function it mirrors. `UdiTable`, `RuleBuckets` and 
`TokenBucket` are the real code.
   
   On a Ryzen 9 9950X3D with the `release` preset, one maintenance prune pass 
over two trackers of 100k entries with one rule each takes about 25 ms, and 
about 62 ms with three rules per metric across all three trackers. Maintenance 
runs once a second, so that is the steady-state cost of pruning on a full 
table. The same setup measured from a running traffic_server's task-thread CPU 
came out within a few percent of the benchmark.
   
   ```
   cmake --preset release -B build-bench -DENABLE_BENCHMARKS=ON 
-DBUILD_EXPERIMENTAL_PLUGINS=ON
   cmake --build build-bench --target benchmark_abuse_shield
   build-bench/plugins/experimental/abuse_shield/benchmark_abuse_shield --order 
decl
   ```
   


-- 
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