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

用taskset把程序绑定到多核心以后,性能不如taskset绑定到单核心 #433

Open
huangmingyou opened this issue Jan 11, 2023 · 5 comments
Labels
help wanted Extra attention is needed needs investigation needs more info question Further information is requested waiting for response waiting for the response from commenter

Comments

@huangmingyou
Copy link

Questions with details

本来的计划是在机器上隔离出单独的cpu给应用使用。 但是用taskset绑定多核心以后,性能反而不如在单核心上面好。multicore 这个参数有什么设置技巧吗?

Code snippets (optional)

No response

@huangmingyou huangmingyou added help wanted Extra attention is needed question Further information is requested labels Jan 11, 2023
@panjf2000
Copy link
Owner

你的业务场景是不是单核心就足够了,设置多核心反而因为上下文切换而降低了性能?

@huangmingyou
Copy link
Author

单核心不太够用,还是希望能多核心运行。同样的配置,如果不使用 cpuset或者taskset做cpu绑定,性能会比作了cpu绑定好。是否是cpu绑定会影响到gnet的性能。

@panjf2000
Copy link
Owner

你绑了多少个 CPU 到进程上?

然后你说不设置 option.multicore 和 option.NumEventLoop 性能更好?

@huangmingyou
Copy link
Author

通过cgroup方式绑定到了两颗cpu , 对,把multicore=false,性能更好。

@panjf2000
Copy link
Owner

你能提供一下复现步骤吗?最好是有 demo 代码可以测试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs investigation needs more info question Further information is requested waiting for response waiting for the response from commenter
Projects
None yet
Development

No branches or pull requests

2 participants