-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
H3C switches are too slow in executing commands #3552
Comments
@LeisureZhao Can you quantify (roughly) how long the |
Discovered that when using Netmiko to test the execution of commands on H3C and Cisco switches, the H3C switch takes 11 seconds, while the Cisco switch only takes 1 second. The test code example is as follows.
|
Same to me. It seems netmiko has spent too much time waiting results on hp_comware like devices... |
@LeisureZhao @TaylorTrz I think historically Comware devices didn't have a way to set the terminal width which causes From Comware driver: class HPComwareBase(CiscoSSHConnection):
def __init__(self, **kwargs: Any) -> None:
# Comware doesn't have a way to set terminal width which breaks cmd_verify
global_cmd_verify = kwargs.get("global_cmd_verify")
if global_cmd_verify is None:
kwargs["global_cmd_verify"] = False
super().__init__(**kwargs) Is there any way to set the terminal width on Comware devices? You could possibly try setting |
@ktbyers The global_cmd_verify is set to False, which will only cause the read_channel_timing function to be called once during the send_config_set function. More significantly, the check_config_mode function is called four times throughout a complete command execution process. This includes entering the config mode twice and exiting the config mode twice. Each call will invoke read_channel_timing due to the pattern not being set. Therefore, setting global_cmd_verify to False saves 2 seconds, and setting a specific pattern reduces the time by 8 seconds. The test records are as follows.
|
@LeisureZhao Sounds good--do you want to do a PR on that? |
Description of Issue/Question
Compared to Cisco switches, H3C switches are too slow in executing commands because
the value of the pattern is not set in the check_config_mode function.
This function is called twice in both the config_mode and exit_config_mode,
each time using read_channel_timing instead of read_until_pattern, which greatly
extends the duration.
So, can it be modified to the following code?
Netmiko version
(Paste verbatim output from
pip freeze | grep netmiko
between quotes below)Netmiko device_type (if relevant to the issue)
(Paste
device_type
between quotes below)The text was updated successfully, but these errors were encountered: