Benchmark on 1vCPU - 1.5GB Server #4096
CovertCode
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Server config:
I used benchmark repo provided by @ganigeorgiev without any modifications.
https://github.com/pocketbase/benchmarks/tree/master
You can compare tests from this: https://github.com/pocketbase/benchmarks/blob/master/results/hetzner_cax11.md
While this test was running on my server there were 2 nodejs backends + mongodb instance running.
Memory usage never went above 500MB of the entire server.
@ganigeorgiev would like to have your input on the comparison.
Benchmark:
Creating organizations (100)
Creating 50 organizations [reqs:50, conc:10, rule:
""
]Creating 50 organizations [reqs:50, conc:10, rule:
"@request.data.name != ''"
]Creating permissions (50)
Creating 25 permissions [reqs:25, conc:5, rule:
""
]Creating 25 permissions [reqs:25, conc:5, rule:
"@request.data.name != ''"
]Creating users (500 - expected to be slow due to passwordHash generation)
Creating 250 users [reqs:250, conc:50, rule:
""
]Creating 250 users [reqs:250, conc:50, rule:
"@request.data.email != '' && @request.data.permissions:length > 0"
]Creating posts (10k, 25k, 50k, 100k)
Creating 5000 posts10k [reqs:5000, conc:500, rule:
""
]Creating 5000 posts10k [reqs:5000, conc:500, rule:
"@request.auth.id != '' && @request.data.public:isset = true"
]Creating 12500 posts25k [reqs:12500, conc:500, rule:
""
]Creating 12500 posts25k [reqs:12500, conc:500, rule:
"@request.auth.id != '' && @request.data.public:isset = true"
]Creating 25000 posts50k [reqs:25000, conc:500, rule:
""
]Creating 25000 posts50k [reqs:25000, conc:500, rule:
"@request.auth.id != '' && @request.data.public:isset = true"
]Creating 50000 posts100k [reqs:50000, conc:500, rule:
""
]Creating 50000 posts100k [reqs:50000, conc:500, rule:
"@request.auth.id != '' && @request.data.public:isset = true"
]User auth with password (expected to be slow due to passwordHash verification)
users auth with email/pass - high concurrency [reqs:250, conc:250]
users auth with email/pass - small concurrency [reqs:250, conc:10]
User auth refresh
users - auth refresh (high concurrency) [reqs:1000, conc:1000]
users - auth refresh (medium concurrency) [reqs:1000, conc:100]
List records
users - getOne for auth refresh comparison (high concurrency) [reqs:1000, conc:1000, rule:
""
, query:/aqf4u4tf8xat5vg
]users - getOne for auth refresh comparison (medium concurrency) [reqs:1000, conc:100, rule:
""
, query:/aqf4u4tf8xat5vg
]posts10k - simpleA (many requests, no rules, no concurrency) [reqs:1000, conc:1, rule:
""
, query:?perPage=20
]posts10k - simpleB (many requests, no rules, high concurrency) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts10k - simpleC (many requests, no rules, high concurrency, skipTotal) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20&skipTotal=1
]posts10k - mixed read and write (simpleA list with additional 300 concurrent random posts10k updates running in the background) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts10k - expand author [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author
]posts10k - expand author (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author&fields=id,collectionId,expand.author.id
]posts10k - expand author.permissions [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions
]posts10k - expand author.permissions (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions&fields=id,collectionId,expand.author.id,expand.author.expand.permissions.id
]posts10k - simple auth rule [reqs:100, conc:10, rule:
"@request.auth.id != ''"
, query:?perPage=20
]posts10k - author check (no index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts10k - author check (with index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts10k - author check (with index and skipTotal) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts10k - author.id (extra join) check (no index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts10k - author.id (extra join) check (with index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts10k - author.id (extra join) check (with index and skipTotal) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts10k - loose large text search (no index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts10k - loose large text search (with index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts10k - loose large text search (with index and skipTotal) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20&skipTotal=1
]posts10k - multiple select :each (no index, match-all) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20
]posts10k - multiple select :each (no index, match-all, skipTotal) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20&skipTotal=1
]posts10k - multiple select :each (no index, at-least-one) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20
]posts10k - multiple select :each (no index, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20&skipTotal=1
]posts10k - nested single relations lookup (no indexes) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20
]posts10k - nested single relations lookup (no indexes, skipTotal) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20&skipTotal=1
]posts10k - nested multiple relations lookup (no indexes, match-all) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20
]posts10k - nested multiple relations lookup (no indexes, match-all, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20&skipTotal=1
]posts10k - nested multiple relations lookup (no indexes, at-least-one) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20
]posts10k - nested multiple relations lookup (no indexes, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20&skipTotal=1
]posts25k - simpleA (many requests, no rules, no concurrency) [reqs:1000, conc:1, rule:
""
, query:?perPage=20
]posts25k - simpleB (many requests, no rules, high concurrency) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts25k - simpleC (many requests, no rules, high concurrency, skipTotal) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20&skipTotal=1
]posts25k - mixed read and write (simpleA list with additional 300 concurrent random posts25k updates running in the background) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts25k - expand author [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author
]posts25k - expand author (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author&fields=id,collectionId,expand.author.id
]posts25k - expand author.permissions [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions
]posts25k - expand author.permissions (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions&fields=id,collectionId,expand.author.id,expand.author.expand.permissions.id
]posts25k - simple auth rule [reqs:100, conc:10, rule:
"@request.auth.id != ''"
, query:?perPage=20
]posts25k - author check (no index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts25k - author check (with index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts25k - author check (with index and skipTotal) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts25k - author.id (extra join) check (no index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts25k - author.id (extra join) check (with index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts25k - author.id (extra join) check (with index and skipTotal) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts25k - loose large text search (no index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts25k - loose large text search (with index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts25k - loose large text search (with index and skipTotal) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20&skipTotal=1
]posts25k - multiple select :each (no index, match-all) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20
]posts25k - multiple select :each (no index, match-all, skipTotal) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20&skipTotal=1
]posts25k - multiple select :each (no index, at-least-one) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20
]posts25k - multiple select :each (no index, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20&skipTotal=1
]posts25k - nested single relations lookup (no indexes) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20
]posts25k - nested single relations lookup (no indexes, skipTotal) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20&skipTotal=1
]posts25k - nested multiple relations lookup (no indexes, match-all) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20
]posts25k - nested multiple relations lookup (no indexes, match-all, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20&skipTotal=1
]posts25k - nested multiple relations lookup (no indexes, at-least-one) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20
]posts25k - nested multiple relations lookup (no indexes, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20&skipTotal=1
]posts50k - simpleA (many requests, no rules, no concurrency) [reqs:1000, conc:1, rule:
""
, query:?perPage=20
]posts50k - simpleB (many requests, no rules, high concurrency) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts50k - simpleC (many requests, no rules, high concurrency, skipTotal) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20&skipTotal=1
]posts50k - mixed read and write (simpleA list with additional 300 concurrent random posts50k updates running in the background) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts50k - expand author [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author
]posts50k - expand author (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author&fields=id,collectionId,expand.author.id
]posts50k - expand author.permissions [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions
]posts50k - expand author.permissions (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions&fields=id,collectionId,expand.author.id,expand.author.expand.permissions.id
]posts50k - simple auth rule [reqs:100, conc:10, rule:
"@request.auth.id != ''"
, query:?perPage=20
]posts50k - author check (no index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts50k - author check (with index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts50k - author check (with index and skipTotal) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts50k - author.id (extra join) check (no index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts50k - author.id (extra join) check (with index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts50k - author.id (extra join) check (with index and skipTotal) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts50k - loose large text search (no index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts50k - loose large text search (with index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts50k - loose large text search (with index and skipTotal) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20&skipTotal=1
]posts50k - multiple select :each (no index, match-all) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20
]posts50k - multiple select :each (no index, match-all, skipTotal) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20&skipTotal=1
]posts50k - multiple select :each (no index, at-least-one) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20
]posts50k - multiple select :each (no index, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20&skipTotal=1
]posts50k - nested single relations lookup (no indexes) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20
]posts50k - nested single relations lookup (no indexes, skipTotal) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20&skipTotal=1
]posts50k - nested multiple relations lookup (no indexes, match-all) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20
]posts50k - nested multiple relations lookup (no indexes, match-all, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20&skipTotal=1
]posts50k - nested multiple relations lookup (no indexes, at-least-one) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20
]posts50k - nested multiple relations lookup (no indexes, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20&skipTotal=1
]posts100k - simpleA (many requests, no rules, no concurrency) [reqs:1000, conc:1, rule:
""
, query:?perPage=20
]posts100k - simpleB (many requests, no rules, high concurrency) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts100k - simpleC (many requests, no rules, high concurrency, skipTotal) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20&skipTotal=1
]posts100k - mixed read and write (simpleA list with additional 300 concurrent random posts100k updates running in the background) [reqs:1000, conc:1000, rule:
""
, query:?perPage=20
]posts100k - expand author [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author
]posts100k - expand author (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author&fields=id,collectionId,expand.author.id
]posts100k - expand author.permissions [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions
]posts100k - expand author.permissions (limited fields) [reqs:100, conc:10, rule:
""
, query:?perPage=20&expand=author.permissions&fields=id,collectionId,expand.author.id,expand.author.expand.permissions.id
]posts100k - simple auth rule [reqs:100, conc:10, rule:
"@request.auth.id != ''"
, query:?perPage=20
]posts100k - author check (no index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts100k - author check (with index) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20
]posts100k - author check (with index and skipTotal) [reqs:100, conc:10, rule:
"author = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts100k - author.id (extra join) check (no index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts100k - author.id (extra join) check (with index) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20
]posts100k - author.id (extra join) check (with index and skipTotal) [reqs:100, conc:10, rule:
"author.id = @request.auth.id"
, query:?perPage=20&skipTotal=1
]posts100k - loose large text search (no index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts100k - loose large text search (with index) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20
]posts100k - loose large text search (with index and skipTotal) [reqs:100, conc:10, rule:
"description ~ 'ipsum dolor'"
, query:?perPage=20&skipTotal=1
]posts100k - multiple select :each (no index, match-all) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20
]posts100k - multiple select :each (no index, match-all, skipTotal) [reqs:100, conc:10, rule:
"type:each != 'c'"
, query:?perPage=20&skipTotal=1
]posts100k - multiple select :each (no index, at-least-one) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20
]posts100k - multiple select :each (no index, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"type:each ?!= 'c'"
, query:?perPage=20&skipTotal=1
]posts100k - nested single relations lookup (no indexes) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20
]posts100k - nested single relations lookup (no indexes, skipTotal) [reqs:100, conc:10, rule:
"author.organization.name != 'test'"
, query:?perPage=20&skipTotal=1
]posts100k - nested multiple relations lookup (no indexes, match-all) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20
]posts100k - nested multiple relations lookup (no indexes, match-all, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active = true"
, query:?perPage=20&skipTotal=1
]posts100k - nested multiple relations lookup (no indexes, at-least-one) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20
]posts100k - nested multiple relations lookup (no indexes, at-least-one, skipTotal) [reqs:100, conc:10, rule:
"author.permissions.active ?= true"
, query:?perPage=20&skipTotal=1
]Go vs JS route execution
JS route (high concurrency) [reqs:500, conc:500]
Go route (high concurrency) [reqs:500, conc:500]
JS route (medium concurrency) [reqs:500, conc:50]
Go route (medium concurrency) [reqs:500, conc:50]
JS route (no concurrency) [reqs:500, conc:1]
Go route (no concurrency) [reqs:500, conc:1]
Go vs JS hooks execution
JS OnRecordBeforeUpdateRequest hook handler - [reqs:100, conc:10]
Go OnRecordBeforeUpdateRequest hook handler - [reqs:100, conc:10]
Deleting records
deleting 100 posts10k - simple (no cascade, no rule) [conc:10, rule:
""
]deleting 100 posts10k - simple (no cascade, with rule) [conc:10, rule:
"@request.auth.id != ''"
]deleting 100 posts25k - simple (no cascade, no rule) [conc:10, rule:
""
]deleting 100 posts25k - simple (no cascade, with rule) [conc:10, rule:
"@request.auth.id != ''"
]deleting 100 posts50k - simple (no cascade, no rule) [conc:10, rule:
""
]deleting 100 posts50k - simple (no cascade, with rule) [conc:10, rule:
"@request.auth.id != ''"
]deleting 100 posts100k - simple (no cascade, no rule) [conc:10, rule:
""
]deleting 100 posts100k - simple (no cascade, with rule) [conc:10, rule:
"@request.auth.id != ''"
]deleting 100 users - with cascade deleting all associated posts [conc:10, rule:
""
]deleting 100 organizations - with cascade deleting all users and associated posts [conc:10, rule:
""
]Completed!
Beta Was this translation helpful? Give feedback.
All reactions