Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cpu Core Counter Laravel Package

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().

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • How reliably does it detect CPU limits in containerized environments (e.g., Kubernetes CPU quotas)?
  • What fallback behavior occurs when core detection fails in production (e.g., cloud VMs with non-standard configurations)?
  • Does it conflict with Laravel's built-in queue worker scaling mechanisms?

Integration Approach

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:

  1. Adding via composer require fidry/cpu-core-counter
  2. Creating a service provider or config helper to wrap CpuCoreCounter usage (e.g., config('queue.workers') = (new CpuCoreCounter())->getCountWithFallback(4))
  3. Adding diagnostic scripts to CI/CD for environment validation

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.

Operational Impact

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests