RoadRunner: an open-source high-performance PHP application server, load balancer, and process manager

RoadRunner

Total alerts All releases

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a service with the ability to extend its functionality on a per-project basis.

RoadRunner includes PSR-7/PSR-17 compatible HTTP and HTTP/2 server and can be used to replace classic Nginx+FPM setup with much greater performance and flexibility.

Official Website | Documentation | Release schedule

Features:

  • Production-ready
  • PCI DSS compliant
  • PSR-7 HTTP server (file uploads, error handling, static files, hot reload, middlewares, event listeners)
  • HTTPS and HTTP/2 support (including HTTP/2 Push, H2C)
  • A Fully customizable server, FastCGI support
  • Flexible environment configuration
  • No external PHP dependencies (64bit version required), drop-in (based on Goridge)
  • Load balancer, process manager and task pipeline
  • Integrated metrics (Prometheus)
  • Workflow engine by Temporal.io
  • Works over TCP, UNIX sockets and standard pipes
  • Automatic worker replacement and safe PHP process destruction
  • Worker create/allocate/destroy timeouts
  • Max jobs per worker
  • Worker lifecycle management (controller)
    • maxMemory (graceful stop)
    • TTL (graceful stop)
    • idleTTL (graceful stop)
    • execTTL (brute, max_execution_time)
  • Payload context and body
  • Protocol, worker and job level error management (including PHP errors)
  • Development Mode
  • Integrations with Symfony, Laravel, Slim, CakePHP, Zend Expressive
  • Application server for Spiral
  • Included in Laravel Octane
  • Automatic reloading on file changes
  • Works on Windows (Unix sockets (AF_UNIX) supported on Windows 10)

Installation:

$ composer require spiral/roadrunner:v2.0 nyholm/psr7
$ ./vendor/bin/rr get-binary

For getting roadrunner binary file you can use our docker image: spiralscout/roadrunner:X.X.X (more information about image and tags can be found here).

Important notice: we strongly recommend to use a versioned tag (like 1.2.3) instead latest.

Configuration can be located in .rr.yaml file (full sample):

rpc:
  listen: tcp://127.0.0.1:6001

server:
  command: "php worker.php"

http:
  address: "0.0.0.0:8080"

logs:
  level: error

Read more in Documentation.

Example Worker:

waitRequest()) { try { $rsp = new Psr7\Response(); $rsp->getBody()->write('Hello world!'); $worker->respond($rsp); } catch (\Throwable $e) { $worker->getWorker()->error((string)$e); } }">


use Spiral\RoadRunner;
use Nyholm\Psr7;

include "vendor/autoload.php";

$worker = RoadRunner\Worker::create();
$psrFactory = new Psr7\Factory\Psr17Factory();

$worker = new RoadRunner\Http\PSR7Worker($worker, $psrFactory, $psrFactory, $psrFactory);

while ($req = $worker->waitRequest()) {
    try {
        $rsp = new Psr7\Response();
        $rsp->getBody()->write('Hello world!');

        $worker->respond($rsp);
    } catch (\Throwable $e) {
        $worker->getWorker()->error((string)$e);
    }
}

Run:

To run application server:

$ ./rr serve

License:

The MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.

Owner
Spiral Scout
Spiral Scout is a full-service digital agency, providing design, development and online marketing services to businesses around San Francisco and beyond.
Spiral Scout
Similar Resources

OpenAPI specs for your Go server, generated at server runtime. No CLI, no code generation, and no HTTP

Overview "oas" is short for "OpenAPI Spec". Go package for generating OpenAPI docs at runtime. Non-features: No code generation. No CLI. No magic comm

Dec 3, 2021

Go web server - A web server that can accept a GET request and serve a response.

go_web_server A web server that can accept a GET request and serve a response. Go is a great language for creating simple yet efficient web servers an

Jan 3, 2022

a simple http server as replacement of python -m http.server

ser a simple http server as replacement of python -m http.server

Dec 5, 2022

A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server A Language Server Protocol (LSP) server for Jsonnet. Features Jump to definition self-support.mp4 dollar-support.mp4 Error/War

Dec 14, 2022

Open platform to collect and prioritize product feedback

Open platform to collect and prioritize product feedback

Fider A platform to collect and organize customer feedback. Let your customers share, vote and discuss on suggestions they have to make your product e

Jan 1, 2023

ready-to-use RTSP / RTMP server and proxy that allows to read, publish and proxy video and audio streams

ready-to-use RTSP / RTMP server and proxy that allows to read, publish and proxy video and audio streams

rtsp-simple-server is a simple, ready-to-use and zero-dependency RTSP / RTMP server and proxy, a software that allows users to publish, read and proxy live video and audio streams. RTSP is a specification that describes how to perform these operations with the help of a server, that is contacted by both publishers and readers and relays the publisher's streams to the readers.

Dec 31, 2022

Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

SFTPGo Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support, written in Go. Several storage backends are supporte

Jan 9, 2023

⚡ A fast, lightweight, and secure chat protocol, client and server, written in Go.

⚡ A fast, lightweight, and secure chat protocol, client and server, written in Go.

Oct 27, 2022

RBTI Golang Server uses PostgreSQL and for its main database and uses Elasticsearch

RBTI Golang Server This server is used for my thesis project, it uses PostgreSQL and for its main database and uses Elasticsearch for faster query spe

Jan 17, 2022
Heart 💜A high performance Lua web server with a simple, powerful API
Heart 💜A high performance Lua web server with a simple, powerful API

Heart ?? A high performance Lua web server with a simple, powerful API. See the full documentation here. Overview Heart combines Go's fasthttp with Lu

Aug 31, 2022
CasaOS - A simple, easy-to-use, elegant open-source home server system.
CasaOS - A simple, easy-to-use, elegant open-source home server system.

CasaOS - A simple, easy-to-use, elegant open-source home server system. CasaOS is an open-source home server system based on the Docker ecosystem and

Jan 8, 2023
High Performance, Kubernetes Native Object Storage
High Performance, Kubernetes Native Object Storage

MinIO Quickstart Guide MinIO is a High Performance Object Storage released under Apache License v2.0. It is API compatible with Amazon S3 cloud storag

Jan 6, 2023
Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.
Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact. It provides feature flags, experimentation (A/B testing), and dynamic configuration. It has clear swagger REST APIs for flags management and flag evaluation.

Dec 25, 2022
The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat
The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

Dec 26, 2022
An open-source, on-prem feature flag solution
An open-source, on-prem feature flag solution

An open-source, on-prem feature flag solution Documentation | Features | Values | Examples | Enterprise Flipt is an open source, on-prem feature flag

Dec 24, 2022
Go package for the BeagleBone open source hardware

go-beaglebone Go package for the BeagleBone open source hardware Also check out https://github.com/SpaceLeap/go-embedded This package builds on top of

Jul 6, 2019
A registry for resilient mid-tier load balancing and failover.

Discovery Discovery is a based service that is production-ready and primarily used at Bilibili for locating services for the purpose of load balancing

Dec 28, 2022
Backend for Workery application server implemented in Golang

workery-server Backend for Workery application server implemented in Golang. This is a rewrite of the workery-django project. Development Goals: Rewri

Dec 14, 2022