Skip to content

nc_ps_poll use usleep(NC_TIMEOUT_STEP), cpu usage is too high #164

@lumanyu180

Description

@lumanyu180

I have a netconf server with libnetconf2,i found the cpu usage is too high。After analysing and testing . I found it is because nc_ps_poll use usleep(NC_TIMEOUT_STEP), the NC_TIMEOUT_STEP is 50 Microseconds, it is too small 。When NC_TIMEOUT_STEP is 50 Microseconds, cpu is 8%。Then i modify NC_TIMEOUT_STEP, when it is 1000 Microseconds, cpu is 1.7%。If the usleep time can be a config , so we can modify it。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions