tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
11.28k stars 286 forks source link

server: fix stats sending performance and ns creation #1440

Closed LucioFranco closed 5 months ago

LucioFranco commented 5 months ago

This change fixes how we send stats to the pulse server. This is done by not serially sending stats on the same task that we extract events from. The reason for this is that if the event buffer (stats_sender) gets full it will block namespace create requests.

With this change, we now submit stats http requests off the main stats task and restrict the stats sending to 128 concurrent requests. This will allow us to accept more create namespace requests and efficiently send stats.