Performance improvements #1080

Merged
dstepanov-yadro merged 4 commits from dstepanov-yadro/frostfs-node:fix/improve_ape_perf into master 2024-09-04 19:51:07 +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 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{
Member

Great 👍

Great 👍
aarifullin reviewed 2024-04-08 10:48:54 +00:00
aarifullin approved these changes 2024-04-08 10:48:57 +00:00
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)
Owner

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.
Owner

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
Author
Member

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 = ""
Owner
  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{}`.
Owner

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
Author
Member

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 project
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
No description provided.