找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1997|回复: 10

Openwrt X86下无法使用多核心CPU

[复制链接]
本帖最后由 chinattw 于 2021-9-26 16:00 编辑

我是自编译的最新的V21.02.0版本,是一颗E5300的双核CPU
发现在运行时,单个进程最多只能占用50%的CPU
19.07好像也有类似的问题。

各位有遇到过吗?
截图是在docker里进行python。
在非DOCKER里运行也有类似的问题。各位大佬有遇到过吗?单进程怎么才能突破50%?




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
本帖最后由 隐形的肩膀 于 2021-9-26 16:08 编辑

没有懂你的意思,你希望你圈出的地方是 100%  吗?  那个是负载。


cat /proc/cpuinfo   这个命令信息贴出来我们看看。




给你看下我的,我的是三核,虚拟机。
  1. processor        : 0
  2. vendor_id        : GenuineIntel
  3. cpu family        : 6
  4. model                : 42
  5. model name        : Intel(R) Xeon(R) CPU E31220 @ 3.10GHz
  6. stepping        : 7
  7. microcode        : 0xffffffff
  8. cpu MHz                : 3092.469
  9. cache size        : 8192 KB
  10. physical id        : 0
  11. siblings        : 3
  12. core id                : 0
  13. cpu cores        : 3
  14. apicid                : 0
  15. initial apicid        : 0
  16. fpu                : yes
  17. fpu_exception        : yes
  18. cpuid level        : 13
  19. wp                : yes
  20. flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl cpuid pni ssse3 cx16 sse4_1 sse4_2 popcnt xsave avx hypervisor lahf_lm pti
  21. bugs                : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
  22. bogomips        : 6184.93
  23. clflush size        : 64
  24. cache_alignment        : 64
  25. address sizes        : 36 bits physical, 48 bits virtual
  26. power management:

  27. processor        : 1
  28. vendor_id        : GenuineIntel
  29. cpu family        : 6
  30. model                : 42
  31. model name        : Intel(R) Xeon(R) CPU E31220 @ 3.10GHz
  32. stepping        : 7
  33. microcode        : 0xffffffff
  34. cpu MHz                : 3092.469
  35. cache size        : 8192 KB
  36. physical id        : 0
  37. siblings        : 3
  38. core id                : 1
  39. cpu cores        : 3
  40. apicid                : 1
  41. initial apicid        : 1
  42. fpu                : yes
  43. fpu_exception        : yes
  44. cpuid level        : 13
  45. wp                : yes
  46. flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl cpuid pni ssse3 cx16 sse4_1 sse4_2 popcnt xsave avx hypervisor lahf_lm pti
  47. bugs                : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
  48. bogomips        : 6184.93
  49. clflush size        : 64
  50. cache_alignment        : 64
  51. address sizes        : 36 bits physical, 48 bits virtual
  52. power management:

  53. processor        : 2
  54. vendor_id        : GenuineIntel
  55. cpu family        : 6
  56. model                : 42
  57. model name        : Intel(R) Xeon(R) CPU E31220 @ 3.10GHz
  58. stepping        : 7
  59. microcode        : 0xffffffff
  60. cpu MHz                : 3092.469
  61. cache size        : 8192 KB
  62. physical id        : 0
  63. siblings        : 3
  64. core id                : 2
  65. cpu cores        : 3
  66. apicid                : 2
  67. initial apicid        : 2
  68. fpu                : yes
  69. fpu_exception        : yes
  70. cpuid level        : 13
  71. wp                : yes
  72. flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl cpuid pni ssse3 cx16 sse4_1 sse4_2 popcnt xsave avx hypervisor lahf_lm pti
  73. bugs                : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
  74. bogomips        : 6184.93
  75. clflush size        : 64
  76. cache_alignment        : 64
  77. address sizes        : 36 bits physical, 48 bits virtual
  78. power management:

复制代码


点评

是的, 按我对linux的理解,双核CPU,在单个线程的值最高值应该可以到200%。 我认为通过TOP看,最高应该看到200%才对。  详情 回复 发表于 2021-9-26 17:15
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 99010 于 2021-9-26 16:36 编辑

用htop来看

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

用htop看,值可以到100%,为什么用TOP就只能看到50%呢?到底是top的BUG还是显示的机制不太对。 [attachimg]503561[/attachimg]  详情 回复 发表于 2021-9-26 17:20
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
本帖最后由 chinattw 于 2021-9-26 17:17 编辑
隐形的肩膀 发表于 2021-9-26 16:04
没有懂你的意思,你希望你圈出的地方是 100%  吗?  那个是负载。
不是的,圈出来1分钟,5分钟负载的我觉得1.0是合理的。我是希望用TOP看CPU利用率时,最少应该是100%或200%(按我对linux的理解,双核CPU,在单个线程的值最高值应该可以到200%)。

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层

用htop看,值可以到100%,为什么用TOP就只能看到50%呢?到底是top的BUG还是显示的机制不太对。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

top统计全部使用率,再取平均值显示。 htop按进程显示。  详情 回复 发表于 2021-9-26 17:32
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
chinattw 发表于 2021-9-26 17:20
用htop看,值可以到100%,为什么用TOP就只能看到50%呢?到底是top的BUG还是显示的机制不太对。

top统计全部使用率,再取平均值显示。
htop按进程显示。

点评

也就是现在的情况就是一核CPU忙死,其它核心围观。 这是CPU的问题还是Openwrt的锅呢。 CPU是比较老了E5300的双核CPU  详情 回复 发表于 2021-9-26 17:58
仔细想了想,还是觉得不太对。 即使用htop来看,线程的CPU的用率最高也就100%,按逻辑来说,双核CPU最高可以达到200%才对。 并且从htop顶部的CPU占用率来看是,CPU 0利用率基本上为0%,CPU 1利用率为100%。 这也  详情 回复 发表于 2021-9-26 17:54
明白,学习了! 感谢!  详情 回复 发表于 2021-9-26 17:34
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
99010 发表于 2021-9-26 17:32
top统计全部使用率,再取平均值显示。
htop按进程显示。

明白,学习了!
感谢!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
99010 发表于 2021-9-26 17:32
top统计全部使用率,再取平均值显示。
htop按进程显示。

仔细想了想,还是觉得不太对。
即使用htop来看,线程的CPU的用率最高也就100%,按逻辑来说,双核CPU最高可以达到200%才对。
并且从htop顶部的CPU占用率来看是,CPU 0利用率基本上为0%,CPU 1利用率为100%。
这也变向的说明了一个进程只能用单核的CPU。

虽然这可能和运行的程序是否支持多线程有关。
但我同时也检查过mariadb,也只能用到单核心。

所以是否可以得出结论:openwrt的任一进程,只能用到单核心CPU?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
99010 发表于 2021-9-26 17:32
top统计全部使用率,再取平均值显示。
htop按进程显示。

也就是现在的情况就是一核CPU忙死,其它核心围观。
这是CPU的问题还是Openwrt的锅呢。
CPU是比较老了E5300的双核CPU

点评

是不是创建容器是添加了--cpus=1参数?  详情 回复 发表于 2021-9-27 00:59
这个不清楚了。没遇到过。  详情 回复 发表于 2021-9-26 18:12
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
chinattw 发表于 2021-9-26 17:58
也就是现在的情况就是一核CPU忙死,其它核心围观。
这是CPU的问题还是Openwrt的锅呢。
CPU是比较老了E5 ...

这个不清楚了。没遇到过。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

chinattw 发表于 2021-9-26 17:58
也就是现在的情况就是一核CPU忙死,其它核心围观。
这是CPU的问题还是Openwrt的锅呢。
CPU是比较老了E5 ...

是不是创建容器是添加了--cpus=1参数?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-27 01:33

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表