Home

/

Library

/

arb_monitor_service.md

Arb Monitor Service

Arb Monitor Service

Run the arb monitor in a separate process so the API server stays responsive.

Environment

Set this in /var/www/cornice/.env for the API service:

arb_enabled=true
arb_monitor_in_process=false

Keep arb_opportunity_key aligned with your discovery key, e.g.:

arb_opportunity_key=arb_monitor

Systemd unit (example)

Create /etc/systemd/system/cornice-monitor.service:

[Unit]
Description=Cornice Arb Monitor
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/var/www/cornice/app
EnvironmentFile=/var/www/cornice/.env
ExecStart=/var/www/cornice/.venv/bin/python -m app.tools.arb_monitor_service
Restart=always
RestartSec=3
TimeoutStopSec=10
KillMode=mixed

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl daemon-reload
sudo systemctl enable --now cornice-monitor

Restart API service:

sudo systemctl restart cornice