We are evaluating the throughput and latency behavior of read-only transactions over the C binding, and noticed some unexpected latencies of the commit() operation. So we went ahead and implemented what is suggested in the documentation https://apple.github.io/foundationdb/api-c.html:
it is not necessary to commit a read-only transaction – you can simply call fdb_transaction_destroy()
On the small tests that we ran, we see a dramatic improvement when using that suggestion, and not calling commit on read-only transactions.
We didn’t do anything special in the client, just commented out the commit-related instructions, as shown in the snippet below:
//To disable the commit operation we comment comment from here... FDBFuture *f = fdb_transaction_commit(tr); fdb_error_t e = waitError(f); fdb_future_destroy(f); //... to here
The following plot shows the performance difference at the 50-th and 99-th percentile of the commit operation as measured with the above code snippet (note the logarithmic scale on the y axis). We use a single client process with an increasing number of threads, to increase the amount of work done on the client (we see the same behavior also with 16 client processes).
Does anyone else have the same experience?