-
Notifications
You must be signed in to change notification settings - Fork 23
Incremental improvements to Npgsql #3
Comments
@damageboy @roji are you cool with moving the conversation here? If yes, could you please summarize the current state of things? |
Hey @divega, great to see things moving along. Optimization efforts are currently taking place in Npgsql's dev branch, which will be released as 3.3.
Note that there are several ADO.NET-level API issues that also hurt Npgsql performance somewhat (e.g. https://github.com/dotnet/corefx/issues/25093), I'll post these here as well. Npgsql builds on appveyor and travis, and CI nuget packages for dev are published to myget. The build is currently a bit unstable, I'll be working to stabilize things more in the coming weeks, but you should already be able to grab packages and test (it's best to check what commit they correspond to though). |
@damageboy, maybe it's a good idea to post the latest performance run figures you got. |
Hi all, Here's where we are performance on the latest iteration of the benchmarks: Physical setupI ran the benchmarks on two physical machines: I ran this ugly thing to get an overall glimpse of these machines:
Client machine info/stats:
Server machine info/stats:
Postgres version:
Benchmark CodeI took @sebastienros benchmark code and made some small changes to make it more reporting friendly The code is here VariantsBasically there are 4 sync + 4 async benchmark variants in my fork:
What the each benchamrk does per "Transaction" is:
The connection string for the benchmark is pretty straight forward: But worth noting that:
Running the benchmakrsBasically while there are not docker images for these benchmarks for now to run them you roughly need: On the server machine
wget https://raw.githubusercontent.com/aspnet/benchmarks/dev/docker/postgres-techempower/create-postgres.sql
cat create-postgres.sql | psql -U benchmarkdbuser -H localhost bench On the client machine:
This will clone Npgsql, compile it, compile the benchmark, hotpatch Npgsql binaries, run the full suite of benchmarks on 1,4,8,16,32,64,128 threads and produce a ResultsSo if we run roughly everything (Npgsql 3.2.5, 3.3 dev) on 1,4,8,16,32,64,128 threads with all benchmark variants we roughly get the following picture: Things that stand out:
If we focus more on the latest Npgsql (dev branch) and async:
Things not in the benchmarks but that I have personally noticed:
PGBenchRunning a similar benchmark with PGBench (for reference):do it: cd benchmarkdb/BenchmarkDb
PGPASSWORD=bench for t in 1 4 8 16 32; do pgbench -h 1.1.1.2 -U benchmarkdbuser -M prepared -j $t -c $t -T 60 -n -f pgbench.sql bench; done PGBench results
|
Here are my results on a controlled environment (Azure D3_v2 instances matching TechEmpower cloud environment). The baseline is ran using pgbench. Measures have been done on Windows Server 2016 DC. Load is generated by a separate machine on the same network. Here I compared the current Nuget package with the Myget version (as of 11/17/2017) Then after doubling the performance of the database server to see if it is a bottleneck.
|
Implement reader cancellation. Fixes aspnet#3
@damageboy, @roji and @anpete have been discussing and looking possible changes to Npgsql as well as modifying the benchmark code to try to get better performance(see npgsql/npgsql@c153d27, [insert a reference to "whole command caching"], and https://gist.github.com/damageboy/556ece30cf2368212773381ec01a8c06).
The results so far seem very promising.
Creating this issue here so that we can hopefully centralize the conversation about them here (some of it has been going over email, but it would be better for them to be in the open).
It would also be great if we can incorporate any modified benchmark code in one repository (e.g. this one) so anyone can play with it and try new changes. I believe the last code from @damageboy is at https://github.com/damageboy/benchmarkdb.
The text was updated successfully, but these errors were encountered: