chore: Introduce pipeline back-pressure (#3152)

* chore: Introduce pipeline back-pressure

Also, improve synchronization primitives and replace them with
thread-local variations.

Before the change, on my local machine with the dragonfly running with 8 threads,
`memtier_benchmark  -c 10 --threads 8  --command="PING"  --key-maximum 100000000  --hide-histogram --distinct-client-seed --pipeline=20 --test-time=10`

reached 10M qps with 0.327ms p99.9.

After the change, the same command showed 13.8M qps with 0.2ms p99.9
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-06-10 12:39:41 +03:00 committed by GitHub
parent 8eb9d48c3a
commit 007d4854db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 138 additions and 55 deletions

View file

@ -59,6 +59,7 @@ TestConnection::TestConnection(Protocol protocol, io::StringSink* sink)
: facade::Connection(protocol, nullptr, nullptr, nullptr), sink_(sink) {
cc_.reset(new dfly::ConnectionContext(sink_, this));
SetSocket(ProactorBase::me()->CreateSocket());
OnConnectionStart();
}
void TestConnection::SendPubMessageAsync(PubMessage pmsg) {