ape: Add morph chain cache #1044

Merged
dstepanov-yadro merged 1 commit from dstepanov-yadro/frostfs-node:fix/get_performance into master 2024-09-04 19:51:07 +00:00

Morph chain cache added. It is required to reduce get latency.

with cache:
     data_received..............: 833 GB    231 MB/s
     data_sent..................: 0 B       0 B/s
     frostfs_obj_get_bytes......: 835 GB    232 MB/s
     frostfs_obj_get_duration...: avg=20.91ms min=1.26ms   med=13.84ms max=658.58ms p(90)=50.68ms p(95)=63.82ms
     frostfs_obj_get_success....: 101936920 28314.893816/s
     iteration_duration.........: avg=21.17ms min=335.38µs med=13.99ms max=1.12s    p(90)=50.9ms  p(95)=64.01ms
     iterations.................: 101936920 28314.893816/s
     vus........................: 600       min=600        max=600


without cache
     data_received..............: 145 GB   40 MB/s
     data_sent..................: 0 B      0 B/s
     frostfs_obj_get_bytes......: 145 GB   40 MB/s
     frostfs_obj_get_duration...: avg=121.82ms min=2.86ms  med=122ms    max=281.63ms p(90)=173.12ms p(95)=178.78ms
     frostfs_obj_get_success....: 17684480 4912.125631/s
     iteration_duration.........: avg=122.12ms min=185.8µs med=122.49ms max=806.44ms p(90)=173.37ms p(95)=179.05ms
     iterations.................: 17684480 4912.125631/s
     vus........................: 600      min=600       max=600
Morph chain cache added. It is required to reduce `get` latency. ``` with cache: data_received..............: 833 GB 231 MB/s data_sent..................: 0 B 0 B/s frostfs_obj_get_bytes......: 835 GB 232 MB/s frostfs_obj_get_duration...: avg=20.91ms min=1.26ms med=13.84ms max=658.58ms p(90)=50.68ms p(95)=63.82ms frostfs_obj_get_success....: 101936920 28314.893816/s iteration_duration.........: avg=21.17ms min=335.38µs med=13.99ms max=1.12s p(90)=50.9ms p(95)=64.01ms iterations.................: 101936920 28314.893816/s vus........................: 600 min=600 max=600 without cache data_received..............: 145 GB 40 MB/s data_sent..................: 0 B 0 B/s frostfs_obj_get_bytes......: 145 GB 40 MB/s frostfs_obj_get_duration...: avg=121.82ms min=2.86ms med=122ms max=281.63ms p(90)=173.12ms p(95)=178.78ms frostfs_obj_get_success....: 17684480 4912.125631/s iteration_duration.........: avg=122.12ms min=185.8µs med=122.49ms max=806.44ms p(90)=173.37ms p(95)=179.05ms iterations.................: 17684480 4912.125631/s vus........................: 600 min=600 max=600 ```
dstepanov-yadro force-pushed fix/get_performance from 9b5c58f9df to 93af379bab 2024-03-14 11:30:54 +00:00 Compare
dstepanov-yadro force-pushed fix/get_performance from 93af379bab to 500f327fe9 2024-03-14 11:32:04 +00:00 Compare
dstepanov-yadro force-pushed fix/get_performance from 500f327fe9 to 73afc06913 2024-03-14 11:56:12 +00:00 Compare
dstepanov-yadro force-pushed fix/get_performance from 73afc06913 to 18170a3153 2024-03-14 11:56:49 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2024-03-14 12:48:39 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-03-14 12:48:39 +00:00
fyrchik reviewed 2024-03-14 12:57:14 +00:00
@ -0,0 +28,4 @@
// from "access_policy_engine" section.
//
// Returns MorphCacheTTLDefault if the value is not positive duration.
func MorphCacheTTL(c *config.Config) time.Duration {
Owner

We already have c.cfgMorph.cacheTTL = morphconfig.CacheTTL(c.appCfg), why wasn't it used?
It also has 0 default and is adjusted to be taken as TimePerBlock, 5 second is a magic constant in comparison.

We already have `c.cfgMorph.cacheTTL = morphconfig.CacheTTL(c.appCfg)`, why wasn't it used? It also has 0 default and is adjusted to be taken as TimePerBlock, 5 second is a magic constant in comparison.
Author
Member

right, fixed.

right, fixed.
dstepanov-yadro force-pushed fix/get_performance from 18170a3153 to a54fc52281 2024-03-14 13:19:00 +00:00 Compare
fyrchik reviewed 2024-03-14 17:36:03 +00:00
@ -0,0 +15,4 @@
// from "access_policy_engine" section.
//
// Returns false if the value is not valid bool.
func MorphCacheEnabled(c *config.Config) bool {
Owner

Other TTL caches are always enabled, maybe stick with this policy here too?
It clearly has benefits (and again, enabling it explicitly now is another task on our platform team).

Other TTL caches are always enabled, maybe stick with this policy here too? It clearly has benefits (and again, enabling it explicitly now is another task on our platform team).
Author
Member

Done

Done
Owner

Other then the comment LGTM

Other then the comment LGTM
dstepanov-yadro force-pushed fix/get_performance from a54fc52281 to 0146c033a0 2024-03-15 07:15:26 +00:00 Compare
dstepanov-yadro force-pushed fix/get_performance from 0146c033a0 to 35dbe84124 2024-03-15 07:21:21 +00:00 Compare
dstepanov-yadro force-pushed fix/get_performance from 35dbe84124 to 4690c4ac4c 2024-03-15 07:23:06 +00:00 Compare
aarifullin approved these changes 2024-03-15 07:40:45 +00:00
dstepanov-yadro force-pushed fix/get_performance from 4690c4ac4c to 5d58b44bc8 2024-03-18 15:44:33 +00:00 Compare
fyrchik approved these changes 2024-03-18 15:45:09 +00:00
dstepanov-yadro merged commit 5d58b44bc8 into master 2024-03-18 16:00:58 +00:00
dstepanov-yadro deleted branch fix/get_performance 2024-03-18 16:00:58 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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#1044
No description provided.