hubcio commented on PR #4488:
URL: https://github.com/apache/iggy/pull/4488#issuecomment-6120753317

   @andreinnanu right, the sampler interval is capped at 1 s whatever 
`sysinfo_print_interval` is. i'd drop the freeze i asked for anyway: it needs a 
server switch whose only job is to turn off the re-base PR2 relies on.
   
   split the counter instead:
   
   - write sites `fetch_add` into a charged total the sampler never touches.
   - the sampler stores `base = sample - charged` (wrapping), with `charged` 
read before `statvfs` as now. `used_bytes()` returns `base + charged`.
   - `/metrics` exports the total as a counter, e.g. `disk_charged_bytes` 
(prometheus-client adds `_total`).
   
   the burst test then compares the counter delta with the 
`allocated_bytes(data_path)` delta within a stated bound, reading both once the 
counter stops moving. keep it under the 128 MiB WAL checkpoint, because the 
counter never sees frees. the sampler keeps running and the test can run beside 
others. it also replaces the between-samples test, whose 1 MiB tolerance can't 
see a missing WAL charge.
   
   also run it with `preallocate_segments` on. writes into a reserved segment 
are charged twice: `preallocate_file` charges the fallocate, then 
`write_segment_bodies` / `write_frozen_chunked` charge the same bytes again. on 
89fb465 an 8 MiB burst into such a topic leaves `disk_used_bytes` 8 MiB above 
`df` until the next sample. charge only what lands past the reservation, and 
reset the reserved length on truncate, since ftruncate frees the reservation.


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