How it works

Swoole is different from the traditional PHP model, it is running in CLI mode.

How Swoole works

Swoole internal

The differences between Swoole with PHP-FPM the traditional PHP model are:

  • Swoole uses Non-blocking I/O mode with epoll or kqueue
  • Swoole forks several worker processes based on CPU core number to utilise all CPU cores.
  • Swoole supports Long-live connections for WebSocket server or TCP/UDP server.
  • Swoole supports more server-side protocols: TCP/UDP/HTTP/HTTP2/WebSocket
  • Swoole preload PHP files into memory.
  • Swoole can manage and reuse the status in memory with Swoole Memory Management Modules.
  • Coroutine based concurrency compare with waterfall in PHP-FPM.

Interested with Swoole? Get Started with Swoole now!