vinyl: factor load regulator out of quota
Turned out that throttling isn't going to be as simple as maintaining the write rate below the estimated dump bandwidth, because we also need to take into account whether compaction keeps up with dumps. Tracking compaction progress isn't a trivial task and mixing it in a module responsible for resource limiting, which vy_quota is, doesn't seem to be a good idea. Let's factor out the related code into a separate module and call it vy_regulator. Currently, the new module only keeps track of the write rate and the dump bandwidth and sets the memory watermark accordingly, but soon we will extend it to configure throttling as well. Since write rate and dump bandwidth are now a part of the regulator subsystem, this patch renames 'quota' entry of box.stat.vinyl() to 'regulator'. It also removes 'quota.usage' and 'quota.limit' altogether, because memory usage is reported under 'memory.level0' while the limit can be read from box.cfg.vinyl_memory, and renames 'use_rate' to 'write_rate', because the latter seems to be a more appropriate name. Needed for #1862
Showing
- src/box/CMakeLists.txt 1 addition, 0 deletionssrc/box/CMakeLists.txt
- src/box/vinyl.c 33 additions, 16 deletionssrc/box/vinyl.c
- src/box/vy_quota.c 3 additions, 130 deletionssrc/box/vy_quota.c
- src/box/vy_quota.h 2 additions, 57 deletionssrc/box/vy_quota.h
- src/box/vy_regulator.c 211 additions, 0 deletionssrc/box/vy_regulator.c
- src/box/vy_regulator.h 146 additions, 0 deletionssrc/box/vy_regulator.h
- test/vinyl/errinj.result 2 additions, 2 deletionstest/vinyl/errinj.result
- test/vinyl/errinj.test.lua 2 additions, 2 deletionstest/vinyl/errinj.test.lua
- test/vinyl/info.result 3 additions, 11 deletionstest/vinyl/info.result
- test/vinyl/info.test.lua 3 additions, 5 deletionstest/vinyl/info.test.lua
- test/vinyl/quota.result 13 additions, 13 deletionstest/vinyl/quota.result
- test/vinyl/quota.test.lua 13 additions, 13 deletionstest/vinyl/quota.test.lua
- test/vinyl/quota_timeout.result 3 additions, 3 deletionstest/vinyl/quota_timeout.result
- test/vinyl/quota_timeout.test.lua 3 additions, 3 deletionstest/vinyl/quota_timeout.test.lua
- test/vinyl/recovery_quota.result 3 additions, 3 deletionstest/vinyl/recovery_quota.result
- test/vinyl/recovery_quota.test.lua 3 additions, 3 deletionstest/vinyl/recovery_quota.test.lua
Loading
Please register or sign in to comment