Write each handler batch from its flush goroutine, outside the mutex (closes #65)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The AS, peer and prefix handlers wrote their batch to the database while holding the mutex HandleMessage needs, and HandleMessage wrote a full batch itself. For as long as a write took, the handler took nothing off its queue, and the streamer dropped updates once the queue was half full. Now only the flush goroutine writes: it takes the batch under the mutex, releases it, then writes. A full batch wakes the flush goroutine instead. Stop still writes what the handler holds. While a write runs, the next batch has no size limit; the README memory section says so. Model: opus-5-5
This commit is contained in:
@@ -233,6 +233,10 @@ What happens at each limit:
|
||||
keeps running.
|
||||
- Handler queues: each of the four handler queues holds at most 20,000 messages.
|
||||
When a queue fills, the streamer drops messages instead of blocking.
|
||||
- Handler batches: while the AS, peer or prefix handler writes a batch to the
|
||||
database, the updates that arrive collect in its next batch, which has no size
|
||||
limit. A database that stays slower than the feed grows memory instead of
|
||||
dropping updates.
|
||||
|
||||
With `DEBUG=routewatch` the daemon logs a `System stats` line every 60 seconds
|
||||
with the goroutine count and Go memory figures.
|
||||
|
||||
Reference in New Issue
Block a user