CLI Commands
RoadRunner offers a convenient CLI to start and manage the server.
Version
To display the version of RoadRunner, you can use the -v or --version option:
./rr -vThis command will display the version of RoadRunner, as well as information about the build time, operating system, and architecture.
rr version 2023.1.2 (build time: 2023-05-04T13:19:13+0000, go1.20.4), OS: linux, arch: amd64Starting the Server
To start the server, you can use the following command:
./rr serve By default, RoadRunner looks for a .rr.yaml file in the current working directory where the binary is placed. However, you can also specify the configuration file from a different location using the -c option:
./rr serve -c /var/www/.rr.yamlYou can also specify the working directory using the -w option:
./rr serve -w /var/wwwRoadRunner also supports .env files. To read environment variables from the .env file, use the --dotenv CLI command:
./rr serve --dotenv .env -c .rr.yamlBackground mode
Additionally, you can start the server in background mode using the -p option. In this mode, RoadRunner creates a .pid file:
./rr serve -pDebug mode
RoadRunner also supports running the Golang pprof server in debug mode using the -d option. This option enables the debug mode, which starts the pprof server and listens for incoming requests on the configured port.
./rr serve -d -c .rr.yamlExperimental features
RoadRunner also supports experimental features. To enable experimental features, use the --enable-experimental or -e option:
./rr serve --enable-experimental -c .rr.yaml./rr serve -e -c .rr.yamlOptions
-c- specifies the path to the configuration file. By default, RoadRunner looks for a.rr.yamlfile in the current working directory. However, you can specify a different file using this option.-w- sets the working directory for the server. By default, RoadRunner uses the current working directory.--dotenv- populates the process with environment variables from the.dotenvfile. This can be useful when you want to set environment variables for your application.-d- starts a Golang profiling server. This allows you to analyze the performance of your application and identify potential bottlenecks. (Read more here.)-s- enables silent mode. In this mode, RoadRunner does not display any output in the console.-o- allows you to override configuration keys with your values. For example,-o=http.address=8080will override thehttp.addressconfiguration key from the.rr.yamlfile.-p- creates a.pidfile to use with the rr stop command later. This can be useful when you want to run RoadRunner in the background mode.-eor--enable-experimental- enables experimental features. This option is useful when you want to test new features that are not yet available in the stable release.
Stopping the Server
To stop RoadRunner, you have a few options:
You can send a
SIGINTorSIGTERMsystem call to the main RoadRunner process. Inside a Kubernetes environment, this is done automatically when you're stopping the pod.If you want to stop RoadRunner manually, you can hit
ctrl+cfor a graceful stop or hitctrl+cone more time to force stop.
You can also use the following command to stop the server:
./rr stopIf you want to force stop the server, you can use the -f option:
./rr stop -fOptions
-f- force stop.-s- silent mode.
Reloading workers
RoadRunner allows you to reload all workers.
./rr resetThis command reloads all RoadRunner workers, including HTTP, gRPC, and others, and starts them with a new worker pool. This can be useful when you make changes to your application code and want to see the changes reflected in the running server.
By default, this command displays output in the console. However, if you want to reload the workers silently, you can use the --silent option:
./rr reset --silentAdditionally, you can reload only particular plugins by specifying their names:
./rr reset httpOptions
-c- specifies the path to the configuration file. By default, RoadRunner looks for a .rr.yaml file in the current working directory. However, you can specify a different file using this option.
Workers status (OS metrics)
RoadRunner provides a command to view the status of active workers. You can use this command to monitor the health and performance of your workers and diagnose any issues.
./rr workersThis command displays a table with the status of all workers, including their PID, status, number of executions, memory usage, and creation time.
Workers of [jobs]:
+---------+-----------+---------+---------+---------+--------------------+
| PID | STATUS | EXECS | MEMORY | CPU% | CREATED |
+---------+-----------+---------+---------+---------+--------------------+
| 3458 | ready | 0 | 45 MB | 0.00 | 1 day ago |
| 3460 | ready | 0 | 45 MB | 0.00 | 1 day ago |
| 3461 | ready | 0 | 46 MB | 0.00 | 1 day ago |
| 3462 | ready | 0 | 46 MB | 0.00 | 1 day ago |
+---------+-----------+---------+---------+---------+--------------------+
Workers of [http]:
+---------+-----------+---------+---------+---------+--------------------+
| PID | STATUS | EXECS | MEMORY | CPU% | CREATED |
+---------+-----------+---------+---------+---------+--------------------+
| 3454 | ready | 396 | 79 MB | 0.04 | 1 day ago |
+---------+-----------+---------+---------+---------+--------------------+You can also specify plugin names to view the status of workers for a particular plugin:
./rr workers httpUse the -i option to enable interactive mode. In this mode, the command will update the statistics every second:
./rr workers -iThis command is useful for debugging performance issues and identifying workers that are not performing as expected. Additionally, you can use this command to monitor the health of your workers and identify any potential problems before they become critical.
Options
-c- specifies the path to the configuration file. By default, RoadRunner looks for a.rr.yamlfile in the current working directory. However, you can specify a different file using this option.-w- sets the working directory for the server. By default, RoadRunner uses the current working directory.-i- interactive mode (updates statistics every second).
Jobs commands
RoadRunner provides several CLI commands to manage jobs and pipelines.
This command allows you to specify one or more pipelines to pause. For example, to pause pipelines pipeline1 and pipeline2, you can use the following command:
./rr jobs --pause pipeline1,pipeline2This command allows you to specify one or more pipelines to resume. For example, to resume pipelines pipeline1 and pipeline2, you can use the following command:
./rr jobs --resume pipeline1,pipeline2This command allows you to specify one or more pipelines to destroy. For example, to destroy pipelines pipeline1 and pipeline2, you can use the following command:
./rr jobs --destroy pipeline1,pipeline2To list all running pipelines, you can use the following command:
./rr jobs --listOptions
-c- specifies the path to the configuration file. By default, RoadRunner looks for a.rr.yamlfile in the current working directory. However, you can specify a different file using this option.
RoadRunner client
The reset, workers, and jobs commands use RoadRunner's RPC interface to interact with the server, and the connection information is obtained from the configuration file.
This means that you can use a local RoadRunner binary as a client to connect to a remote server, as long as the server's host and port information is specified in the local configuration. This can be useful in situations where you want to manage a remote RoadRunner instance from your local machine.
To specify the server host and port information, you can use the rpc section of the .rr.yaml file.
For example:
rpc:
listen: "127.0.0.1:6001"Last updated
Was this helpful?