Allow to limit engine size for local scenarios #110

Merged
dstepanov-yadro merged 2 commits from dstepanov-yadro/xk6-frostfs:feat/limit_shard_size into master 2024-09-04 19:51:18 +00:00

Now it is possible to specify maximum data size for entire storage engine in local scenarios.

Output example (s3local.js):

./k6 run -e DURATION=300 -e WRITE_OBJ_SIZE=100 -e READERS=0 -e WRITERS=30 \
-e PREGEN_JSON=/home/user/xk6-frostfs/s3_preset.json -e CONFIG_FILE=/home/user/xk6-frostfs/storage_config.yml \
-e MAX_TOTAL_SIZE=1 /home/user/xk6-frostfs/scenarios/s3local.js


          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: /home/user/xk6-frostfs/scenarios/s3local.js
     output: -

  scenarios: (100.00%) 1 scenario, 30 max VUs, 5m5s max duration (incl. graceful stop):
           * write: 30 looping VUs for 5m0s (exec: obj_write, gracefulStop: 5s)

INFO[16:18:57] Pregenerated buckets:          10             source=console
INFO[16:18:57] Pregenerated read object size: 8 Kb           source=console
INFO[16:18:57] Pregenerated total objects:    0              source=console
INFO[16:18:57] Reading VUs:                   0              source=console
INFO[16:18:57] Writing VUs:                   30             source=console
INFO[16:18:57] Total VUs:                     30             source=console
INFO[16:18:57] Load started at:               Thu Dec 14 2023 16:18:57 GMT+0300 (MSK)  source=console
ERRO[16:19:43] engine is full                                bucket=065c84cf-332f-481a-ba41-87d0d6be6cab config_dir=undefined config_file=/home/user/xk6-frostfs/storage_config.yml key=1cef4201-1eb6-4dc6-810b-ba3b2d0ae0d4
INFO[16:19:43] Load finished at:              Thu Dec 14 2023 16:19:43 GMT+0300 (MSK)  source=console
     █ setup

     █ teardown

     data_received.......................: 0 B    0 B/s
     data_sent...........................: 1.1 GB 23 MB/s
     iteration_duration..................: avg=131.78ms min=41.79µs med=100.62ms max=568.42ms p(90)=288.76ms p(95)=324.59ms
     iterations..........................: 10461  226.387843/s
     s3local_internal_obj_put_duration...: avg=37.8ms   min=5.33ms  med=37.94ms  max=134.71ms p(90)=57.8ms   p(95)=65.36ms 
     s3local_internal_obj_put_total......: 10486  226.928871/s
     s3local_obj_put_duration............: avg=131.63ms min=8.65ms  med=100.37ms max=568.21ms p(90)=288.63ms p(95)=324.43ms
     s3local_obj_put_total...............: 10460  226.366202/s
     vus.................................: 30     min=30       max=30

running (0m46.2s), 00/30 VUs, 10460 complete and 30 interrupted iterations
write ✗ [====>---------------------------------] 30 VUs  0m46.1s/5m0s
ERRO[16:19:43] test aborted at obj_write (file:///home/user/xk6-frostfs/scenarios/s3local.js:133:12(65)) 

Closes #106

Now it is possible to specify maximum data size for entire storage engine in local scenarios. Output example (s3local.js): ``` ./k6 run -e DURATION=300 -e WRITE_OBJ_SIZE=100 -e READERS=0 -e WRITERS=30 \ -e PREGEN_JSON=/home/user/xk6-frostfs/s3_preset.json -e CONFIG_FILE=/home/user/xk6-frostfs/storage_config.yml \ -e MAX_TOTAL_SIZE=1 /home/user/xk6-frostfs/scenarios/s3local.js /\ |‾‾| /‾‾/ /‾‾/ /\ / \ | |/ / / / / \/ \ | ( / ‾‾\ / \ | |\ \ | (‾) | / __________ \ |__| \__\ \_____/ .io execution: local script: /home/user/xk6-frostfs/scenarios/s3local.js output: - scenarios: (100.00%) 1 scenario, 30 max VUs, 5m5s max duration (incl. graceful stop): * write: 30 looping VUs for 5m0s (exec: obj_write, gracefulStop: 5s) INFO[16:18:57] Pregenerated buckets: 10 source=console INFO[16:18:57] Pregenerated read object size: 8 Kb source=console INFO[16:18:57] Pregenerated total objects: 0 source=console INFO[16:18:57] Reading VUs: 0 source=console INFO[16:18:57] Writing VUs: 30 source=console INFO[16:18:57] Total VUs: 30 source=console INFO[16:18:57] Load started at: Thu Dec 14 2023 16:18:57 GMT+0300 (MSK) source=console ERRO[16:19:43] engine is full bucket=065c84cf-332f-481a-ba41-87d0d6be6cab config_dir=undefined config_file=/home/user/xk6-frostfs/storage_config.yml key=1cef4201-1eb6-4dc6-810b-ba3b2d0ae0d4 INFO[16:19:43] Load finished at: Thu Dec 14 2023 16:19:43 GMT+0300 (MSK) source=console █ setup █ teardown data_received.......................: 0 B 0 B/s data_sent...........................: 1.1 GB 23 MB/s iteration_duration..................: avg=131.78ms min=41.79µs med=100.62ms max=568.42ms p(90)=288.76ms p(95)=324.59ms iterations..........................: 10461 226.387843/s s3local_internal_obj_put_duration...: avg=37.8ms min=5.33ms med=37.94ms max=134.71ms p(90)=57.8ms p(95)=65.36ms s3local_internal_obj_put_total......: 10486 226.928871/s s3local_obj_put_duration............: avg=131.63ms min=8.65ms med=100.37ms max=568.21ms p(90)=288.63ms p(95)=324.43ms s3local_obj_put_total...............: 10460 226.366202/s vus.................................: 30 min=30 max=30 running (0m46.2s), 00/30 VUs, 10460 complete and 30 interrupted iterations write ✗ [====>---------------------------------] 30 VUs 0m46.1s/5m0s ERRO[16:19:43] test aborted at obj_write (file:///home/user/xk6-frostfs/scenarios/s3local.js:133:12(65)) ``` Closes #106
dstepanov-yadro added 1 commit 2023-12-14 13:27:51 +00:00
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro requested review from storage-core-committers 2023-12-14 13:28:12 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-12-14 13:28:12 +00:00
dstepanov-yadro requested review from mmalygina 2023-12-14 13:28:25 +00:00
dstepanov-yadro requested review from anikeev-yadro 2023-12-14 13:28:26 +00:00
dstepanov-yadro force-pushed feat/limit_shard_size from f9dbd94a9b to 1e7cc95f61 2023-12-15 07:56:27 +00:00 Compare
anikeev-yadro approved these changes 2023-12-15 07:59:04 +00:00
abereziny reviewed 2023-12-15 08:05:01 +00:00
@ -35,0 +37,4 @@
if c.l.IsFull() {
return PutResponse{
Success: false,
Error: "engine is full",
Member

maybe Limit reached ?

maybe `Limit reached` ?
Author
Member

fixed

fixed
abereziny marked this conversation as resolved
abereziny reviewed 2023-12-15 08:07:06 +00:00
@ -36,0 +40,4 @@
return PutResponse{
Success: false,
Abort: true,
Error: "engine is full",
Member

same as above, feels like Limit reached rather than engine is full :)

same as above, feels like `Limit reached` rather than `engine is full` :)
Author
Member

fixed

fixed
abereziny marked this conversation as resolved
abereziny reviewed 2023-12-15 08:12:12 +00:00
dstepanov-yadro force-pushed feat/limit_shard_size from 1e7cc95f61 to c7bdfcebb7 2023-12-15 08:42:07 +00:00 Compare
aarifullin approved these changes 2023-12-15 09:11:48 +00:00
Owner

Using gigabytes here is probably ok, but I also created this #111
Having this in mind, maybe it is better to use bytes without units? Everyone will forget what the default units are.
Another option is to use MAX_TOTAL_SIZE_GB.

Using gigabytes here is probably ok, but I also created this https://git.frostfs.info/TrueCloudLab/xk6-frostfs/issues/111 Having this in mind, maybe it is better to use bytes without units? Everyone will forget what the default units are. Another option is to use `MAX_TOTAL_SIZE_GB`.
fyrchik reviewed 2023-12-15 10:12:10 +00:00
@ -0,0 +54,4 @@
func (sl *sizeLimiter) IsFull() bool {
cur := sl.currentSize.Load()
// fmt.Printf("current %d, max %d\n", cur, sl.maxSize)
Owner

debug?

debug?
Author
Member

oops, fixed

oops, fixed
fyrchik marked this conversation as resolved
@ -74,3 +76,3 @@
}
func NewLocalModuleInstance(vu modules.VU, resolveEngine func(context.Context, string, string, bool) (*engine.StorageEngine, error)) *Local {
func NewLocalModuleInstance(vu modules.VU, resolveEngine func(context.Context, string, string, bool, int) (*engine.StorageEngine, Limiter, error)) *Local {
Owner

Why is it int and not int64? (we later convert anyway)

Why is it `int` and not `int64`? (we later convert anyway)
Author
Member

Fixed. I thought JS number can be a maximum of 4 bytes, but it isn't so: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER

Fixed. I thought JS number can be a maximum of 4 bytes, but it isn't so: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed feat/limit_shard_size from c7bdfcebb7 to bc47d66316 2023-12-15 11:07:45 +00:00 Compare
Author
Member

Using gigabytes here is probably ok, but I also created this #111
Having this in mind, maybe it is better to use bytes without units? Everyone will forget what the default units are.
Another option is to use MAX_TOTAL_SIZE_GB.

Fixed

> Using gigabytes here is probably ok, but I also created this https://git.frostfs.info/TrueCloudLab/xk6-frostfs/issues/111 > Having this in mind, maybe it is better to use bytes without units? Everyone will forget what the default units are. > Another option is to use `MAX_TOTAL_SIZE_GB`. Fixed
acid-ant approved these changes 2023-12-15 11:51:13 +00:00
fyrchik approved these changes 2023-12-15 13:46:18 +00:00
mmalygina approved these changes 2023-12-15 13:55:12 +00:00
dstepanov-yadro merged commit bc47d66316 into master 2023-12-15 13:55:52 +00:00
dstepanov-yadro deleted branch feat/limit_shard_size 2023-12-15 13:55:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
7 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/xk6-frostfs#110
No description provided.