-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[warm-reboot] apps crash due to redis is busy running 'tablue_dump.lua' during warm-start #3008
Comments
@kcudnik Are you the best person to look into this issue with suggestions? |
if there are a lot of entries in redis, it can a lot of time for apply view to dump redis DB, 8 seconds in this dump, this doesent't seem to me that much critical, but not sure if we can improve much this, and its not getting only keys, but all values as well, so basically its get keys first and then each value by key that increase of time is probably by linux kernel slowing down high usege of cpu by sycnd, since method to dump ASIC_STATE and TEMP_STATE is exactly the same, so if those sizes of dbs are the same, then time also should be the same, take a look here: |
So i also performed some tests on my side, and it seems like the issues is the LENGTH of the key, i changed prefix from "TEMP_" to just "T" and there is almost no difference, i have 100k ASIC_STATE entreis and 100k TASIC_STATE entries
suddenly when we start using keys inside eval:
we get jump from 0,13 sec to over 5 seconds !!!, i have no idea why we get such a huge jump here, but when we add also hgetall for all attributes, we gain addition 1,5 seconds:
my suspicion is that inside lua or redis, there is a structure representation for string, which is constant size like 16 chars etc, and when size is of string is longer than that, then new memory must be allocated, im not sure yet whether this is related only to table name or to entire key length, since key length ins ASIC_STATE are pretty long
here with sample data we can see that most item has length with 126 chars, but with TEMP_ prefix majority of keys are over 130 characters:
i cloned https://github.com/redis/redis repo, and grepped for 128 values and there are a lot of places where this pop up, it not obvious whether this is actual cause but that would be my bet on this:
but at this point is hard to tell which of those is making impact, if at all we can change "TEMP_" to just "T" as prefix, and this will put temporary asic view, and we can get away with this for ipv4, but when we use ipv6 we wont be able to use this trick here i also opened issue on redis repo redis/redis#8077, so maybe it could be explained faster |
Confirmed locally, that indeed this is lua hashing problem redis/redis#8077 (comment)
|
After merge redis/redis#8180 this problem will go away on it's own |
Unfortunately LUA in redis will not be updated since it has some backward comparability problems with new versions, but i asked for a fix in current repo and made PR here: redis/redis#9449 |
ok, that PR on redis was merged, so we just need to wait for next redis package release on ubuntu |
@kcudnik which official version are you referring to? Do you know if it will be released as part of Debian 11, going to SONiC 202111? |
im referring to official redis server package, please refer here: redis/redis#9449 |
…atically (#17846) src/sonic-utilities * 7a242eeb - (HEAD -> 202311, origin/202311) [202311] Support reading/writing module EEPROM data by page and offset (#3008) (#3073) (2 days ago) [Junchao-Mellanox] * cb0fd428 - [202311] Collect module EEPROM data in dump (#3009) (#3124) (3 days ago) [Junchao-Mellanox]
Description
[Topo summary]:
T0 with 20k ipv4 routes, each route with 2 ecmp members.
Steps to reproduce the issue
enable warm
sudo config warm_restart enable system
warm restart swss/system
sudo systemctl restart warm
WARMBOOT_FINALIZER found bgp did not change state to RECONCILED
NOTICE root: WARMBOOT_FINALIZER : Some components didn't finish reconcile: bgp ...
NOTICE root: WARMBOOT_FINALIZER : Finalizing warmboot...
Describe the results you received:
bgp did not finish reconcile.
Also, other apps(e.g. lldp-syncd) will throw an error whenever they try to access db but db is busy running 'table_dump.lua'.
Describe the results you expected:
All components should change the status to reconciled.
Additional information you deem important (e.g. issue happens only occasionally):
debug
test more with 22694 objects in ASIC_STATE table, 22559 objects in TEMP_ASIC_STATE table
The test result show us
KEYS ASIC_STATE: the fastest method
KEYS TEMP_ASIC_STATE: nearly the same as KEYS ASIC_STATE
KEYS ASIC_STATE with lua:~9 times slower than KEYS ASIC_STATE
KEYS TEMP_ASIC_STATE with lua: the slowest method, ~65 times slower than KEYS ASIC_STATE
It seems like we should improve the dump method of table for prevent blocking redis too long.
Or split each database to individual redis instances(processes).
Workaround
Currently, we can set lua-time-limit larger enough to prevent redis from sending reply
BUSY
to other client requests.runtime:
redis-cli -n 0 config set lua-time-limit 10000
redis.conf: lua-time-limit 10000
The text was updated successfully, but these errors were encountered: