[MDEV-33078] SysInfo.pm reports incorrect CPU count on macOS Created: 2023-12-19  Updated: 2023-12-20

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Dave Gosselin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

macOS 13.6.3 aarch64 (apple silicon)


Issue Links:
Relates

 Description   

The SysInfo.pm module relies on /proc/cpuinfo to determine core count, but of course macOS does not implement the proc filesystem. There are other ways to reliably determine the number of cpus or cores on macOS.



 Comments   
Comment by Dave Gosselin [ 2023-12-19 ]

Naturally this affects the --parallel option for mtr. Regardless of core count, the module reports just one cpu.

Comment by Daniel Black [ 2023-12-20 ]

https://github.com/dkechag/System-CPU/blob/master/lib/System/CPU.pm#L227

Comment by Dave Gosselin [ 2023-12-20 ]

% sysctl -n hw.ncpu
8

Generated at Thu Feb 08 10:36:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.