Why EasySwoole 3.x Is the High‑Performance PHP Framework for API Services

EasySwoole 3.x is a resident‑memory, coroutine‑based PHP framework built on Swoole that supports HTTP, WebSocket, TCP/UDP, offers numerous ready‑made components, and provides simple installation and startup steps for building high‑performance API services.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
Why EasySwoole 3.x Is the High‑Performance PHP Framework for API Services

Overview

EasySwoole 3.x is a resident‑memory distributed PHP framework built on Swoole Server, designed for API services. It heavily encapsulates Swoole coroutine features and supports mixed HTTP, WebSocket, custom TCP/UDP listeners, offering many ready‑made components.

Features

Core positioning : high‑performance coroutine framework, event‑driven, asynchronous tasks, millisecond timers; API‑first but also suitable for WebSocket, TCP/UDP real‑time communication.

Key advantages :

Supports millions of concurrent connections.

Resident memory; files loaded once for ultra‑fast response.

Production‑grade validation, adopted by Tencent IEG, Wangsu, 360 Finance, Meitu, etc.

Supported protocols : HTTP, WebSocket, custom TCP/UDP, UnixSocket.

Runtime modes : async/sync/coroutine, multi‑process/multi‑thread, CPU affinity, daemon, SSL/TLS encryption.

Components

The framework ships with a rich set of coroutine components ready out‑of‑the‑box:

Database/Cache : coroutine MySQL/Redis/Memcached pools, ORM similar to ThinkPHP.

Message/Search : coroutine Kafka, NSQ, ElasticSearch clients.

Network/Client : coroutine HTTP/SMTP clients.

Config/Permission : distributed RPC, Consul/Apollo config centers, JWT/OAuth/Casbin authentication.

Tools : Snowflake ID generator, second‑level Crontab, custom processes, message queues, tracing, rate limiter, Fast‑Cache.

Others : coroutine template engine, EventLoop API, object pool, micro‑service support.

Installation & Startup

Environment requirements : PHP 7.2+ and Swoole 4.4+ extension.

Composer installation : composer require easyswoole/easyswoole=3.* Initialize project :

php vendor/easyswoole/easyswoole/bin/easyswoole.php install

Start service :

# Start framework
cd /var/www
php easyswoole.php server start

Defaults to listening on port 9501 (HTTP) and works with Nginx reverse proxy.

Configuration file : located under EasySwoole/Conf for server and listener settings.

Basic Usage

HTTP service : create controllers extending App\HttpController. Example:

class IndexController extends EasySwoole\Http\AbstractInterface\Controller
{
    public function index()
    {
        $this->response()->write('Hello EasySwoole');
    }
}

WebSocket/TCP : configure listeners and implement WebSocketInterface or custom handlers.

Extension development : custom processes, scheduled tasks, middleware, exception handling.

Development mode : hot reload, logging, debugging tools.

Official site: https://www.easyswoole.com

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PHPBackend FrameworkAPI developmentSwooleEasySwoole
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.