Performance improvements #1080

Merged
dstepanov-yadro merged 4 commits from dstepanov-yadro/frostfs-node:fix/improve_ape_perf into master 2024-04-10 07:20:21 +00:00
  1. Do not Head object before Get or Head. Only basic checks will be performed. Extended (object-dependent) check will be performed on result.
  2. Use pool for APE requests. This resulted in an increase in the reading performance of 8KB objects by 1MB/s on a 1-hour test.
1. Do not `Head` object before `Get` or `Head`. Only basic checks will be performed. Extended (object-dependent) check will be performed on result. 2. Use pool for APE requests. This resulted in an increase in the reading performance of 8KB objects by 1MB/s on a 1-hour test.
dstepanov-yadro added 2 commits 2024-04-08 09:22:09 +00:00
25517fbdc4 [#9999] ape: Do not read object headers before Head/Get
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
DCO action / DCO (pull_request) Successful in 5m59s Details
Vulncheck / Vulncheck (pull_request) Failing after 8m50s Details
Tests and linters / gopls check (pull_request) Successful in 8m11s Details
Tests and linters / Lint (pull_request) Successful in 10m15s Details
Build / Build Components (1.21) (pull_request) Successful in 10m26s Details
Tests and linters / Staticcheck (pull_request) Successful in 11m11s Details
Build / Build Components (1.20) (pull_request) Successful in 16m3s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 17m28s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 18m41s Details
Tests and linters / Tests with -race (pull_request) Failing after 22m7s Details
8b897c8b3b
[#9999] ape: Use pool for APE requests
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro force-pushed fix/improve_ape_perf from 8b897c8b3b to 2f29975ef8 2024-04-08 09:23:25 +00:00 Compare
dstepanov-yadro force-pushed fix/improve_ape_perf from 2f29975ef8 to f9643ce94e 2024-04-08 09:24:06 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2024-04-08 09:39:40 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-04-08 09:40:10 +00:00
acid-ant approved these changes 2024-04-08 10:23:43 +00:00
aarifullin reviewed 2024-04-08 10:48:50 +00:00
@ -14,6 +15,14 @@ import (
nativeschema "git.frostfs.info/TrueCloudLab/policy-engine/schema/native"
)
var requestPool = &sync.Pool{
Collaborator

Great 👍

Great 👍
aarifullin reviewed 2024-04-08 10:48:54 +00:00
aarifullin approved these changes 2024-04-08 10:48:57 +00:00
dstepanov-yadro added 1 commit 2024-04-08 14:51:47 +00:00
DCO action / DCO (pull_request) Successful in 1m47s Details
Build / Build Components (1.21) (pull_request) Successful in 2m41s Details
Vulncheck / Vulncheck (pull_request) Successful in 3m17s Details
Build / Build Components (1.20) (pull_request) Successful in 4m22s Details
Tests and linters / gopls check (pull_request) Successful in 6m19s Details
Tests and linters / Staticcheck (pull_request) Successful in 6m36s Details
Tests and linters / Lint (pull_request) Successful in 7m0s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 8m6s Details
Tests and linters / Tests with -race (pull_request) Successful in 8m19s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 10m25s Details
025c2408ed
[#1080] metabase: Open bucket for container counter once
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
acid-ant approved these changes 2024-04-09 06:27:20 +00:00
fyrchik reviewed 2024-04-09 07:17:11 +00:00
@ -80,6 +92,7 @@ func (c *checkerImpl) CheckAPE(ctx context.Context, prm Prm) error {
if err != nil {
return fmt.Errorf("failed to create ape request: %w", err)
}
defer requestPool.Put(r)

I think it is a good practice to empty it before put *r = request{}, otherwise we can forget adding some new field if initialization is done in multiple places.

I think it is a good practice to empty it before put `*r = request{}`, otherwise we can forget adding some new field if initialization is done in multiple places.

Regarding sync.Pool: I am not opposed to the idea, but 1MB/s improvement can be from 5 to 6 or from 105 to 106 -- and these are completely different. Could you add relative improvement number?

Regarding `sync.Pool`: I am not opposed to the idea, but 1MB/s improvement can be from 5 to 6 or from 105 to 106 -- and these are completely different. Could you add relative improvement number?
dstepanov-yadro force-pushed fix/improve_ape_perf from 025c2408ed to f5c5a51668 2024-04-09 12:28:04 +00:00 Compare
dstepanov-yadro added 1 commit 2024-04-09 12:30:24 +00:00
DCO action / DCO (pull_request) Successful in 6m56s Details
Vulncheck / Vulncheck (pull_request) Successful in 7m16s Details
Build / Build Components (1.21) (pull_request) Successful in 10m54s Details
Tests and linters / gopls check (pull_request) Successful in 10m47s Details
Tests and linters / Staticcheck (pull_request) Successful in 11m22s Details
Build / Build Components (1.20) (pull_request) Successful in 12m8s Details
Tests and linters / Lint (pull_request) Successful in 12m8s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 18m13s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 18m15s Details
Tests and linters / Tests with -race (pull_request) Failing after 19m50s Details
316b965f33
[#1080] metabase: Add StorageID metric
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
Poster
Collaborator

Regarding sync.Pool: I am not opposed to the idea, but 1MB/s improvement can be from 5 to 6 or from 105 to 106 -- and these are completely different. Could you add relative improvement number?

256 -> 257 MB/s :)

> Regarding `sync.Pool`: I am not opposed to the idea, but 1MB/s improvement can be from 5 to 6 or from 105 to 106 -- and these are completely different. Could you add relative improvement number? 256 -> 257 MB/s :)
dstepanov-yadro force-pushed fix/improve_ape_perf from 316b965f33 to 21b3b4ba4f 2024-04-09 12:36:51 +00:00 Compare
fyrchik reviewed 2024-04-09 12:44:05 +00:00
@ -96,0 +110,4 @@
func returnToPool(r *request) {
r.operation = ""
r.properties = nil
r.resource.name = ""
  1. If resource is always non-nil, why is it a pointer in the request structure?
  2. These 2 lines are equivalent to *r.resource = resource{} (and if resource is not a pointer, the whole function will be *r = request{}.
1. If `resource` is always non-nil, why is it a pointer in the `request` structure? 2. These 2 lines are equivalent to `*r.resource = resource{}` (and if `resource` is not a pointer, the whole function will be `*r = request{}`.

The benefit of my approach is that it will remain unchanged after adding new items

The benefit of my approach is that it will remain unchanged after adding new items
Poster
Collaborator

Ok, replaced pointer with value.

Ok, replaced pointer with value.
dstepanov-yadro force-pushed fix/improve_ape_perf from 21b3b4ba4f to 4cae9a782a 2024-04-09 12:54:18 +00:00 Compare
dstepanov-yadro force-pushed fix/improve_ape_perf from 4cae9a782a to 2ad156387c 2024-04-09 14:13:14 +00:00 Compare
fyrchik approved these changes 2024-04-09 15:39:28 +00:00
dstepanov-yadro force-pushed fix/improve_ape_perf from 2ad156387c to e7203ae8cd 2024-04-09 15:42:27 +00:00 Compare
dstepanov-yadro changed title from Some APE performance improvements to Performance improvements 2024-04-09 15:53:23 +00:00
acid-ant approved these changes 2024-04-09 18:22:23 +00:00
dstepanov-yadro force-pushed fix/improve_ape_perf from e7203ae8cd to 76398c06b0 2024-04-10 07:00:29 +00:00 Compare
fyrchik approved these changes 2024-04-10 07:05:54 +00:00
fyrchik added this to the v0.39.0 milestone 2024-04-10 07:13:42 +00:00
acid-ant approved these changes 2024-04-10 07:20:13 +00:00
dstepanov-yadro merged commit 76398c06b0 into master 2024-04-10 07:20:21 +00:00
dstepanov-yadro deleted branch fix/improve_ape_perf 2024-04-10 07:20:22 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1080
There is no content yet.