tursodatabase / libsql-client-rs

libSQL Rust client library can be used to communicate with sqld natively over HTTP protocol with native Rust interface.
MIT License
75 stars 29 forks source link

Latency regression with later versions #18

Closed penberg closed 1 year ago

penberg commented 1 year ago

With latest version:

penberg@vonneumann workers-libsql % wrk --latency  https://hello-libsql.penberg.workers.dev/hello
Running 10s test @ https://hello-libsql.penberg.workers.dev/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   156.71ms   86.89ms 356.07ms   59.00%
    Req/Sec    28.91     16.09    60.00     57.58%
  Latency Distribution
     50%  173.80ms
     75%  236.54ms
     90%  264.57ms
     99%  356.07ms
  100 requests in 10.09s, 58.28KB read
Requests/sec:      9.91
Transfer/sec:      5.77KB

with 0.16.2:

penberg@vonneumann workers-libsql % wrk --latency  https://hello-libsql.penberg.workers.dev/hello
Running 10s test @ https://hello-libsql.penberg.workers.dev/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    52.98ms   11.26ms 162.18ms   77.93%
    Req/Sec    94.35     14.34   121.00     62.63%
  Latency Distribution
     50%   51.16ms
     75%   58.07ms
     90%   65.42ms
     99%   93.72ms
  1876 requests in 10.06s, 8.56MB read
  Non-2xx or 3xx responses: 1876
Requests/sec:    186.43
Transfer/sec:      0.85MB
psarna commented 1 year ago

for context: the main reason is the fact we switched to WebSocket by default, and that needs a round of handshakes before sending actual queries.

Also, care sharing the source code of hello-libsql, so that I can reproduce later? :innocent:

psarna commented 1 year ago

long fixed by going back to good ol' http!