Skip to content
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] natsort import is taking more time with python 3.11 in bookworm #17246

Closed
vivekrnv opened this issue Nov 21, 2023 · 3 comments · Fixed by #19962 or sonic-net/sonic-platform-common#492

Comments

@vivekrnv
Copy link
Contributor

vivekrnv commented Nov 21, 2023

Description

import natsort is adding 0.5 - 0.6 sec to the CLI runtime in bookworm.

This is affecting WR LACP Session down time because every call to sonic-cfggen is taking 0.5 sec more and there is degradation in CLI. Average lacp_session_wait time in around 93-94 sec.

Tested on a following system on the following CPU.

Vendor ID:               GenuineIntel
  Model name:            Intel(R) Celeron(R) CPU 1047UE @ 1.40GHz
    CPU family:          6
    Model:               58
    Thread(s) per core:  1
    Core(s) per socket:  2

Steps to reproduce the issue:

admin@arc-switch1025:~$ docker exec -it syncd bash 
root@arc-switch1025:/# time python3 -c "import natsort" <bullseye>
real    0m0.105s
user    0m0.074s
sys     0m0.028s

root@arc-switch1025:/# exit
exit

admin@arc-switch1025:~$ time python3 -c "import natsort"
real    0m0.695s
user    0m0.549s
sys     0m0.122s

Triage:

This is fixed by updating the natsort to latest bookworm version. Run the following steps on the host and containers to upgrade the version.

 pip3 uninstall --yes natsort
Found existing installation: natsort 6.2.1
Uninstalling natsort-6.2.1:
  Successfully uninstalled natsort-6.2.1

 pip3 install natsort
Collecting natsort
  Downloading natsort-8.4.0-py3-none-any.whl.metadata (21 kB)
Downloading natsort-8.4.0-py3-none-any.whl (38 kB)
Installing collected packages: natsort

After updating to latest version, downtime fell to 84 sec.

@arlakshm
Copy link
Contributor

to be discussed in the platform subgroup.

@saiarcot895
Copy link
Contributor

Likely cause is because of /usr/lib/python3/dist-packages/_distutils_hack/__init__.py, related to pypa/setuptools#417.

@dgsudharsan
Copy link
Collaborator

@saiarcot895 Any updates on this bug?

@vivekrnv vivekrnv changed the title [CLI] natsort import is taking more time with python 3.11 in bookworm [warm-reboot] natsort import is taking more time with python 3.11 in bookworm Aug 16, 2024
liat-grozovik pushed a commit that referenced this issue Sep 3, 2024
- Why I did it
Fix #17246

- How to verify it
root@sn2700:/home/admin# docker exec swss pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# docker exec syncd pip3 show natsort
Name: natsort
Version: 8.4.0
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this issue Sep 6, 2024
- Why I did it
Fix sonic-net#17246

- How to verify it
root@sn2700:/home/admin# docker exec swss pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# docker exec syncd pip3 show natsort
Name: natsort
Version: 8.4.0
mssonicbld pushed a commit that referenced this issue Sep 7, 2024
- Why I did it
Fix #17246

- How to verify it
root@sn2700:/home/admin# docker exec swss pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# docker exec syncd pip3 show natsort
Name: natsort
Version: 8.4.0
vvolam pushed a commit to vvolam/sonic-buildimage that referenced this issue Sep 12, 2024
- Why I did it
Fix sonic-net#17246

- How to verify it
root@sn2700:/home/admin# docker exec swss pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# pip3 show natsort
Name: natsort
Version: 8.4.0

root@sn2700:/home/admin# docker exec syncd pip3 show natsort
Name: natsort
Version: 8.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants