Benchmark

Linqdb benchmark uses Stack Overflow dataset as of late 2016.
Inspired by: Ravendb's blog
Data from: Stackexchange archive
Benchmark code: Linqdb benchmark

Data model: Data.cs

Code:

1. Data import - imports Stack Overflow's data - Program.cs
2. Signups per month - SignupsPerMonth.cs
3. User activity per month - ActiveUsersByMonth.cs
4. Tag activity per month - TagsPerMonth.cs
5. Tag's info - TagsInfo.cs
6. Tag activity per month, fast version - TagsPerMonthFast.cs
7. Tag's info, fast version - TagsInfoFast.cs


Embedded db, rotating disk (7200 RPM) - windows:
1. Data import: 367 min, db size 46 Gb
2. Signups per month: 10 sec
3. User activity per month: 135 sec
4. Tag activity per month: 425 sec
5. Tag's info: 473 sec
6. Tag activity per month, fast version: 123 sec
7. Tag's info, fast version: 165 sec

Embedded db, SSD disk - windows:
1. Data import: 245 min, db size 46 Gb
2. Signups per month: 12 sec
3. User activity per month: 160 sec
4. Tag activity per month: 430 sec
5. Tag's info: 442 sec
6. Tag activity per month, fast version: 104 sec
7. Tag's info, fast version: 162 sec

Server db, server and client in the same geographic region (but not in the same physical LAN), SSD disk - linux:
1. Data import: 257 min, db size 49 Gb
2. Signups per month: 26 sec
3. User activity per month: 265 sec
4. Tag activity per month: 635 sec
5. Tag's info: 755 sec
6. Tag activity per month, fast version: 243 sec
7. Tag's info, fast version: 368 sec



Benchmark to model many concurrent users reading entire posts:
SERVER:

1000 jobs, 1 thread
Total: 133071 ms
Total: 1000, errors 0, min 102 ms, max 319 ms, avg 118.816 ms

1000 jobs, 10 threads
Total: 47244 ms
Total: 1000, errors 0, min 105 ms, max 2235 ms, avg 281.238 ms

1000 jobs, 100 threads
Total: 46039 ms
Total: 1000, errors 0, min 104 ms, max 2149 ms, avg 287.699 ms

***************************************************************

10000 jobs, 1 threads
Total: 1164041 ms
Total: 10000, errors 0, min 99 ms, max 449 ms, avg 114.5488 ms

10000 jobs, 10 threads
Total: 282246 ms
Total: 10000, errors 0, min 104 ms, max 3256 ms, avg 261.5082 ms

10000 jobs, 100 threads
Total: 280294 ms
Total: 10000, errors 0, min 102 ms, max 24885 ms, avg 1152.8982 ms

***************************************************************

100000 jobs, 10 threads
Total: 2705890 ms
Total: 100000, errors 0, min 100 ms, max 7943 ms, avg 267.87963 ms


===============================================================

EMBEDDED:

1000 jobs, 1 thread
Total: 32437 ms
Total: 1000, errors 0, min 3 ms, max 86 ms, avg 16.503 ms

1000 jobs, 10 thread
Total: 19579 ms
Total: 1000, errors 0, min 3 ms, max 162 ms, avg 18.091 ms

1000 jobs, 100 thread
Total: 19163 ms
Total: 1000, errors 0, min 3 ms, max 118 ms, avg 16.39 ms

***************************************************************

10000 jobs, 1 threads
Total: 163887 ms
Total: 10000, errors 0, min 0 ms, max 171 ms, avg 14.3212 ms

10000 jobs, 10 threads
Total: 37484 ms
Total: 10000, errors 0, min 1 ms, max 357 ms, avg 12.9372 ms

10000 jobs, 100 threads
Total: 37075 ms
Total: 10000, errors 0, min 1 ms, max 161 ms, avg 13.7044 ms

***************************************************************

100000 jobs, 10 threads
Total: 200354 ms
Total: 100000, errors 0, min 0 ms, max 428 ms, avg 14.84831 ms



Difference between embedded-db code and server-db code:
1. using LinqDb; and using LinqdbClient;
2. var db = new Db(path-to-folder); and var db = new Db(ip-address:port);