ydb-platform / nbs

Network Block & File Store
Apache License 2.0
54 stars 21 forks source link

[NBS] Adjust performance profile according to cpus count used by nbs #1327

Open tpashkin opened 4 months ago

tpashkin commented 4 months ago

https://github.com/ydb-platform/nbs/blob/main/cloud/blockstore/libs/daemon/common/config_initializer.cpp#L168

Currently we calculate performance profile based solely on number of cpus used by compute. This results in lower limits that we could potentially give, when nbs is running with extended cpu set (e.g. on amd platforms etc)

Current limits were calculated with assumption nbs is running on 16 cores. We need to get current cpu set from procfs and adjust performance profile accordingly

$ cat /proc/`pidof nbsd`/status | grep -i cpu_allowed_list
Cpus_allowed_list: 0-7,66-71,128-135,194-199
$ cat /etc/systemd/system.conf | grep -i cpuaffinity
CPUAffinity=0,128,1,129,5,133,69,197,6,134,70,198,7,135,71,199,2,130,66,194,3,131,67,195,4,132,68,196
EvgeniyKozev commented 3 months ago

Тут еще нужно смотреть на пропускную способность сети т.к. нельзя выдать квоты на VM больше чем вообще сеть тянет. А на хосте еще могут быть и другие пользователи.