fidry/cpu-core-counter
Tiny PHP utility to detect CPU core count (logical or physical) with memoized results. Provides sensible defaults plus configurable “finders” per OS, parallelisation-friendly available cores, and safe fallbacks via exception handling or getCountWithFallback().
Architecture fit is strong for Laravel applications requiring dynamic CPU core detection for parallel processing (e.g., queue workers, async task scheduling). The package is lightweight (no external dependencies), PSR-4 compliant, and integrates seamlessly with Laravel's ecosystem. It handles OS-specific detection logic transparently, aligning with Laravel's cross-platform support needs.
Integration feasibility is high due to Composer-based installation and minimal boilerplate code. The package has no Laravel-specific dependencies but works with standard PHP interfaces used in Laravel services. Existing Laravel queue or task scheduling systems can directly consume its output without architectural changes.
Technical risks include low adoption (0 dependents) despite 234 stars, which may indicate limited real-world validation. The package's OS detection logic could fail in constrained environments (e.g., highly restricted Docker containers), though Kubernetes support was added in v1.3.0. The "2025-08-14" release date appears erroneous and warrants verification.
Key questions:
Stack fit is excellent for Laravel 8+ (PHP 7.3+ required) due to PHP 7.2+ compatibility and Symfony-like BCP adherence. The package complements Laravel's existing infrastructure without requiring framework modifications.
Migration path involves:
composer require fidry/cpu-core-counterCpuCoreCounter usage (e.g., config('queue.workers') = (new CpuCoreCounter())->getCountWithFallback(4))Compatibility is confirmed across all supported PHP versions (7.2+), OSes (Linux, Windows, macOS), and container runtimes (via Kubernetes CPU limit detection). No Laravel-specific API conflicts exist.
Sequencing should prioritize early integration during initial queue/task system design. For existing projects, introduce during next major release cycle to validate behavior in staging environments before production rollout.
Maintenance burden is low due to the package's small codebase (~1k LOC) and active maintenance (1.3.0 released in 2023). However, low adoption may slow issue resolution; teams should monitor GitHub issues for critical fixes.
Support relies on community GitHub activity.
How can I help you explore Laravel packages today?