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

Laravel Stress Laravel Package

laramint/laravel-stress

Fire-and-forget HTTP stress testing for Laravel. Runs Guzzle request pools in a background subprocess to avoid deadlocks with php artisan serve, with an in-process fallback for multi-threaded servers. Returns JSON stats (throughput, percentiles, errors).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Performance-Driven Development: Enables data-backed optimizations during sprints by exposing bottlenecks (e.g., slow queries, N+1 issues) before production deployment. Aligns with shift-left testing principles.
  • CI/CD Enablement: Reduces flaky tests by automating load validation in pipelines (e.g., fail builds if success rate <90%). Example: GitHub Actions workflow to run stress tests post-deploy.
  • Tech Stack Consolidation: Avoids tool sprawl (e.g., JMeter, k6) by providing a Laravel-native solution with minimal learning curve.
  • Feature Flags & Canary Testing: Validates gradual rollouts by simulating traffic spikes for new features (e.g., "Does our new checkout API handle 1000 RPS?").
  • Cost Optimization: Identifies infrastructure inefficiencies (e.g., underprovisioned DB connections) to right-size cloud resources (e.g., AWS RDS, Heroku dynos).

When to Consider This Package

Adopt If:

  • Your team prioritizes developer velocity over enterprise-grade load testing (e.g., no need for Grafana dashboards or distributed testing).
  • You’re blocked by php artisan serve deadlocks during manual testing (e.g., Guzzle timeouts).
  • Your APIs are stateless (no WebSockets, long-polling, or server-sent events).
  • You need quick feedback loops (e.g., "Does this PR break performance?").
  • Your stack is Laravel-heavy (e.g., monolith or microservices using Laravel’s HTTP clients).

Look Elsewhere If:

  • You require distributed load testing (e.g., multi-region stress; use k6 or Locust).
  • Your APIs use non-HTTP protocols (e.g., gRPC, WebSockets; consider Artillery or k6).
  • You need advanced reporting (e.g., JMeter’s HTML reports; this outputs JSON).
  • Your team lacks PHP/Laravel expertise (steep learning curve for subprocess management).
  • You’re testing stateful services (e.g., WebSocket connections, server-side sessions).

How to Pitch It (Stakeholders)

For Executives:

*"This tool lets our Laravel devs simulate 1,000+ concurrent users in seconds—without blocking their local servers. It’s like having a performance ‘smoke test’ built into our workflow. Why it matters:

  • Catch regressions early: Identify slow API endpoints during sprints, saving days of fire-drill debugging in production.
  • Reduce cloud costs: Right-size infrastructure by validating load before scaling (e.g., ‘Does our Heroku app handle 500 RPS?’).
  • CI/CD safety net: Automatically fail builds if performance drops below thresholds (e.g., success rate <95%). Cost: Free. Risk: Minimal—integrates seamlessly with Laravel. ROI: Faster releases, fewer production incidents."*

For Engineering:

*"LaravelStress runs non-blocking stress tests in the background, so you can keep coding while it validates your APIs under load. Key perks:

  • No deadlocks: Works with php artisan serve (unlike Guzzle’s sync methods).
  • Rich metrics: Get success rates, latency percentiles (p95/p99), and error breakdowns in JSON.
  • CI-ready: Plugs into GitHub Actions/GitLab CI with a few lines of PHP.
  • Zero setup: Just composer require and go.

Use case: Before merging a PR, run:

$jobId = $runner->startBackground([
    'url' => 'http://localhost/api/payments',
    'count' => 1000,
    'concurrency' => 50,
]);

Then poll results in the background. No need to switch to k6 or JMeter—just Laravel-native testing.

Pro tip: Add a StressTest trait to PHPUnit for automated validation:

trait StressTests {
    public function testCheckoutLoad() {
        $result = $this->runStressTest([
            'method' => 'POST',
            'url' => '/api/checkout',
            'count' => 500,
            'concurrency' => 20,
        ]);
        $this->assertGreaterThan(98, $result->successRate);
    }
}
```"

---
**For DevOps/SRE:**
*"This tool helps **validate infrastructure changes** without external dependencies. For example:
- **Pre-deploy checks**: Run stress tests in staging to ensure new DB indexes or caching layers improve throughput.
- **Cost optimization**: Compare performance across hosting providers (e.g., ‘Does DigitalOcean outperform Heroku for our API?’).
- **Incident triage**: Reproduce 5xx errors under load to isolate root causes (e.g., ‘Is it the DB or our rate-limiting middleware?’).

**Integration tip**: Use the **synchronous mode** in CI/CD to block merges if performance degrades:
```yaml
# GitHub Actions example
- name: Run stress test
  run: php artisan stress:test --url=/api/users --count=1000 --min-success-rate=95
```"
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime