• Stars
    star
    7,073
  • Rank 5,512 (Top 0.2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿคฏ High-performance PHP application server, process manager written in Go and powered with plugins

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.

Join our discord server: Link

Official Website | Documentation | Forum | Release schedule

Features:


  • Production-ready
  • PCI DSS compliant (HTTP plugin)
  • PSR-7 HTTP server (file uploads, error handling, static files, hot reload, middleware, event listeners)
  • HTTPS and HTTP/2 support (including HTTP/2 Push, H2C)
  • A Fully customizable http(s)/2 server
  • FastCGI support (HTTP plugin)
  • Flexible environment configuration
  • No external PHP dependencies (64bit version required)
  • Integrated metrics (Prometheus)
  • Workflow engine by Temporal.io
  • Works over TCP, UNIX sockets and process pipes
  • Automatic worker replacement, graceful and safe PHP process destruction
  • Worker create/allocate/destroy timeouts
  • Max requests per worker limitation
  • Worker lifecycle management (controller)
    • max_memory (graceful stop)
    • ttl (graceful stop)
    • idle_ttl (graceful stop)
    • exec_tll (brute, max_execution_time)
  • Protocol, worker and job level error management (including PHP errors)
  • Development Mode
  • Integrations with Symfony, Laravel, Slim, CakePHP, Zend Expressive
  • Application server for Spiral
  • Works on Windows 10/11 and WSL2

Installation

The easiest way to get the latest RoadRunner version is to use one of the pre-built release binaries, which are available for OSX, Linux, FreeBSD, and Windows. Instructions for using these binaries are on the GitHub releases page.

Docker:

To get the roadrunner binary file you can use our docker image: ghcr.io/roadrunner-server/roadrunner:2023.X.X (more information about image and tags can be found here).

FROM ghcr.io/roadrunner-server/roadrunner:2023.X.X AS roadrunner
FROM php:8.2-cli

COPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr

# USE THE RR

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

Installation via Composer

You can also install RoadRunner automatically using command shipped with the composer package, run:

composer require spiral/roadrunner-http nyholm/psr7
./vendor/bin/rr get-binary

Server binary will be available at the root of your project.

Note

PHP's extensions php-curl and php-zip are required to download RoadRunner automatically. PHP's extensions php-sockets need to be installed to run roadrunner. Check with php --modules your installed extensions.

Installation option for the Debian-derivatives (Ubuntu, Mint, MX, etc)

wget https://github.com/roadrunner-server/roadrunner/releases/download/v2023.X.X/roadrunner-2023.X.X-linux-amd64.deb
sudo dpkg -i roadrunner-2023.X.X-linux-amd64.deb

Dowload the latest release via curl:

curl --proto '=https' --tlsv1.2 -sSf  https://raw.githubusercontent.com/roadrunner-server/roadrunner/master/download-latest.sh | sh

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

version: '3'

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:

<?php

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);
    }
}

Available Plugins: link

Run:

To run application server:

$ ./rr serve -c .rr.yaml

License:

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

Contributors

Thanks to all the people who already contributed!

More Repositories

1

goridge

๐Ÿง™ High-performance PHP-to-Golang IPC/RPC bridge
Go
1,150
star
2

endure

โšก Fault-tolerant service container for Golang applications
Go
38
star
3

roadrunner-plugins

๐Ÿ“ฆ Home for the roadrunner plugins
Go
25
star
4

roadrunner-docs

RoadRunner application server documentation (automatic sync to the website).
24
star
5

birddog

Birddog is a free tool for monitoring workers, services and jobs of a RoadRunner instance.
PHP
18
star
6

velox

๐Ÿงฑ Automated build system for the RR with custom plugins.
Go
13
star
7

kafka

RoadRunner Kafka driver for the Jobs plugin
Go
7
star
8

api

๐Ÿ”Œ RoadRunner API, powered with protobuf. Contains plugins interfaces and proto api.
Go
7
star
9

rr-e2e-tests

Roadrunner end-to-end tests dashboard
4
star
10

http

HTTP(1, 2)/TLS/fCGI plugin
Go
3
star
11

errors

Golang SpiralScout errors package, fully compatible with the standard errors. Include stacktrace and operations.
Go
3
star
12

metrics

RR metrics plugin
Go
3
star
13

grpc

RRv2 gRPC plugin
Go
3
star
14

jobs

RRv2 jobs plugin
Go
3
star
15

kv

RRv2 KV (key-value) plugin
Go
3
star
16

logger

RR logger plugin
Go
3
star
17

proxy_ip_parser

X-Forwarded-*, Forwarded, True-Client-IP, X-Real-Ip parser http middleware
Go
3
star
18

roadrunner-rs

[WIP] RoadRunnen in RUST
Rust
3
star
19

samples

RR2 plugins samples
Go
3
star
20

rpc

RRv2 RPC plugin
Go
3
star
21

sdk

๐Ÿค– RoadRunner Go SDK. Contains worker, pool, queues and other utilities and core RR features.
Go
3
star
22

prometheus

RRv2 prometheus metrics HTTP middleware
Go
3
star
23

goridge-rs

Goridge protocol written in Rust
Rust
2
star
24

beanstalk

Beanstalk plugin for the RRv2
Go
2
star
25

boltdb

RRv2 BoltDB plugin
Go
2
star
26

amqp

AMQP-0-9-1 protocol drivers (RabbitMQ)
Go
2
star
27

new_relic

RRv2 NewRelic HTTP middleware
Go
2
star
28

websockets

RRv2 websockets HTTP middleware
Go
2
star
29

memcached

RRv2 memcached plugin
Go
2
star
30

plugin_template

RR plugin template.
Go
2
star
31

tcp

RRv2 TCP plugin
Go
2
star
32

redis

RRv2 Redis plugin
Go
2
star
33

tcplisten

๐ŸŒ Package tcplisten provides a customizable TCP net.Listener with various performance-related options
Go
2
star
34

send

RRv2 HTTP X-Sendfile middleware
Go
2
star
35

headers

RRv2 Headers HTTP middleware
Go
2
star
36

config

RRv2 configuration parser
Go
2
star
37

service

RRv2 service plugin
Go
2
star
38

memory

RRv2 memory plugin
Go
2
star
39

reload

RRv2 reload plugin
Go
2
star
40

nats

RRv2 NATS plugin
Go
2
star
41

otel

OpenTelemetry HTTP middleware
Go
2
star
42

gzip

RRv2 gzip HTTP middleware
Go
2
star
43

server

RRv2 worker's server plugin
Go
2
star
44

google-pub-sub

Google PubSub Jobs driver
Go
1
star
45

broadcast

RRv2 Broadcast plugin
Go
1
star
46

plugin_sample

RR plugin sample
Dockerfile
1
star
47

informer

RRv2 informer plugin
Go
1
star
48

cache

RRv2 RFC 7234 HTTP Cache middleware
Go
1
star
49

resetter

RRv2 resetter plugin
Go
1
star
50

sqs

RRv2 SQS plugin
Go
1
star
51

fileserver

RRv2 fileserver plugin
Go
1
star
52

status

RRv2 status plugin
Go
1
star
53

middleware_sample

RR http middleware sample
Go
1
star
54

static

RRv2 HTTP static files middleware
Go
1
star
55

fastcgi

FastCGI protocol implementation
Rust
1
star