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).
php artisan serve deadlocks during manual testing (e.g., Guzzle timeouts).*"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:
*"LaravelStress runs non-blocking stress tests in the background, so you can keep coding while it validates your APIs under load. Key perks:
php artisan serve (unlike Guzzle’s sync methods).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
```"
How can I help you explore Laravel packages today?