cabanga/coiote-turbo
Composer 安装命令:
composer require cabanga/coiote-turbo
包简介
Coiote is a lightweight, fast, and practical web server and performance accelerator for Laravel applications. Built to be simple and functional, it brings native Swoole support to Laravel without the complexity.
README 文档
README
A fast, lightweight, and high-performance application server for Laravel, powered by Swoole. Coiote Turbo dramatically reduces latency and boosts your application's capacity by keeping the framework bootstrapped in memory.
About Coiote Turbo
Traditional PHP applications running under PHP-FPM have to bootstrap the entire Laravel framework on every single request. This process, while fast, introduces a small amount of latency that adds up under heavy load.
Coiote Turbo solves this by running your Laravel application on top of a powerful, event-driven Swoole server. The framework is booted only once, when the server starts, and then stays resident in memory to process thousands of requests per second with minimal overhead.
This package provides an elegant and robust way to manage the Swoole server, including integrated supervisors for your queue workers and scheduled tasks, transforming your Laravel application into a long-running, high-performance service.
Key Features
- High-Performance HTTP Server: Serves your application directly via Swoole, eliminating the need for Nginx or Apache.
- Drastically Reduced Latency: By keeping the framework in memory, response times are significantly faster.
- Integrated Queue Worker: A multi-process queue worker supervisor, managed directly by Coiote Turbo.
- Integrated Scheduler: A dedicated process to run your Laravel scheduled tasks reliably.
- Simple Configuration: A single configuration file to manage server settings.
- Easy-to-Use Commands: Familiar
artisancommands to start, stop, and monitor your server.
Requirements
- PHP
^8.2 - Laravel Framework
^10.0 || ^11.0 || ^12 - PHP Extension:
swoole(version^5.1recommended) - PHP Extension:
pcntl(usually included in CLI builds, required for worker management)
Shell script to install Laravel dependencies with Swoole (Ubuntu/Debian)
#!/bin/bash # Update system packages sudo apt update # Add ondrej/php PPA if PHP 8.2 is not available if ! apt-cache show php8.2 >/dev/null 2>&1; then echo "Adding PHP 8.2 PPA..." sudo apt install -y software-properties-common sudo add-apt-repository -y ppa:ondrej/php sudo apt update fi # Install PHP 8.2 and common Laravel extensions sudo apt install -y php8.2 php8.2-cli php8.2-common php8.2-mbstring php8.2-xml php8.2-curl php8.2-mysql php8.2-sqlite3 php8.2-zip php8.2-bcmath php8.2-intl php8.2-opcache php8.2-readline php-pear php-dev unzip curl git zlib1g-dev # Install Composer (if not present) if ! command -v composer &> /dev/null; then curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer fi # Ensure PECL is available sudo apt install -y php-pear php-dev # Uninstall any existing Swoole sudo pecl uninstall swoole || true # Install Swoole 5.1.1 with zlib and OpenSSL support sudo pecl install swoole-5.1.1 --enable-openssl --with-zlib # Add Swoole to php.ini if not already present PHP_INI=$(php --ini | grep "Loaded Configuration" | awk '{print $NF}') if ! grep -q "extension=swoole" "$PHP_INI"; then echo "extension=swoole" | sudo tee -a "$PHP_INI" fi # Confirm Swoole + zlib is active php --ri swoole | grep zlib
Installation (Coiote Turbo)
You can install the package via Composer:
composer require cabanga/coiote-turbo
Note: You must have the swoole and pcntl PHP extensions installed on your server. You can usually install Swoole by running pecl install swoole.
Configuration
To publish the configuration file, run the following Artisan command. The configuration will be placed in config/coioteTurbo.php.
php artisan vendor:publish --provider="Cabanga\CoioteTurbo\CoioteTurboServiceProvider" --tag="config"
This file allows you to configure the server's host, port, number of workers, PID file location, and more.
Usage
Coiote Turbo is controlled via simple Artisan commands. You will run these commands on your production server, preferably managed by a process manager like Supervisor or systemd.
Starting the HTTP Server
To start the main HTTP server and your application workers, run:
php artisan coiote:start
Running Queue Workers
To start the dedicated queue worker pool, run the coiote:work command. This will start a supervisor that manages multiple queue processes.
# Start a worker pool with 8 processes for the default queue php artisan coiote:work # Specify queues and connection php artisan coiote:work --workers=4 --queue=high,default --connection=redis
Running the Scheduler
To start the scheduler, run the turbo:schedule command. This will start a single, long-running process that dispatches your scheduled jobs every minute.
php artisan coiote:schedule
Checking Server Status
To check if the main server is running, use the status command:
php artisan coiote:status
Setup (Docker)
Step 1: Copy Deployment Files
Copy the deploy folder (https://github.com/delcioPHP/coiote-turbo/tree/main/deploy) into the root of your Laravel project and move the Dockerfile to the root project:
Step 2: Verify Project Structure
Your project structure should look like this:
your-laravel-project/
├── deploy/
│ ├── server.conf
│ └── start.sh
├── Dockerfile
├── composer.json
├── composer.lock
└── ...
Step 3: Configure Server
Edit deploy/server.conf to customize how Coiote Turbo starts.
# Start the HTTP server with 2 worker processes command:start=php artisan coiote:start # Start the queue worker with high and default priority queues using Redis # command:queue=php artisan coiote:work --queue=high,default --connection=redis # Start the queue worker in default mode # command:queue=php artisan coiote:work # Start the task scheduler process # command:schedule=php artisan coiote:schedule
Uncomment or adjust commands based on the desired process:
start: HTTP serverqueue: queue workerschedule: scheduler
Build the Docker Image
# Build with default PHP version (8.2) docker build -t your-app-name . docker run -p 9000:9000 your-app-name
License
The Coiote Turbo is open-source software licensed under the MIT license.
cabanga/coiote-turbo 适用场景与选型建议
cabanga/coiote-turbo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 06 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「performance」 「laravel」 「swoole」 「turbo」 「coiote」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cabanga/coiote-turbo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cabanga/coiote-turbo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cabanga/coiote-turbo 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
g4 application profiler package
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
WordPress mu-plugin to remove jQuery Migrate from the list of jQuery dependencies and to allow jQuery to enqueue before </body> instead of in the <head>.
Create link to static resources with cache-breaking segment based on md5 of the file
Production-ready Laravel Prometheus metrics package with built-in collectors for HTTP, database, cache, queue, events, errors, filesystem, and mail monitoring
annotations-scan-plugin
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-26