Skip to main content
These commands control production-related behaviors such as automatic service restarts, DNS multitenancy, and HTTP settings.

restart_supervisor_on_update

Enable or disable automatic restart of supervisor processes when running bench update.
bench config restart_supervisor_on_update {on|off}

Arguments

state
choice
required
Either on to enable or off to disable

Examples

# Enable auto-restart
bench config restart_supervisor_on_update on

# Disable auto-restart
bench config restart_supervisor_on_update off

When to Use

Enable this when:
  • Running production benches
  • You want automatic service restarts after updates
  • Using supervisor for process management
Disable this when:
  • You want manual control over restarts
  • Running maintenance windows
  • Testing updates before restart
Location: bench/commands/config.py:13

restart_systemd_on_update

Enable or disable automatic restart of systemd units when running bench update.
bench config restart_systemd_on_update {on|off}

Arguments

state
choice
required
Either on to enable or off to disable

Examples

# Enable auto-restart for systemd
bench config restart_systemd_on_update on

# Disable auto-restart
bench config restart_systemd_on_update off

When to Use

Use this when:
  • Using systemd instead of supervisor
  • Running on modern Linux distributions
  • Want automatic service management
Location: bench/commands/config.py:22

dns_multitenant

Enable or disable DNS-based multitenancy for the bench.
bench config dns_multitenant {on|off}

Arguments

state
choice
required
Either on to enable or off to disable

Examples

# Enable DNS multitenancy
bench config dns_multitenant on

# Disable DNS multitenancy
bench config dns_multitenant off

What is DNS Multitenancy?

When enabled, the bench will:
  • Route requests based on the domain name
  • Allow multiple sites with different domains
  • Automatically serve the correct site based on the Host header

Configuration

When DNS multitenancy is enabled:
  1. Create sites with domain names:
    bench new-site tenant1.example.com
    bench new-site tenant2.example.com
    
  2. Configure DNS: Point all domains to your server’s IP
  3. Update nginx:
    bench setup nginx
    sudo service nginx reload
    
Location: bench/commands/config.py:30

serve_default_site

Configure nginx to serve the default site on port 80.
bench config serve_default_site {on|off}

Arguments

state
choice
required
Either on to enable or off to disable

Examples

# Enable default site serving
bench config serve_default_site on

# Disable default site serving
bench config serve_default_site off

Use Cases

  • On: Serve a specific site when accessing the server by IP
  • Off: Require domain-based routing for all sites
Location: bench/commands/config.py:38

rebase_on_pull

Configure git to rebase instead of merge when pulling updates.
bench config rebase_on_pull {on|off}

Arguments

state
choice
required
Either on to enable or off to disable

Examples

# Enable rebase on pull
bench config rebase_on_pull on

# Disable rebase (use merge)
bench config rebase_on_pull off

Git Behavior

  • On: Uses git pull --rebase for cleaner history
  • Off: Uses git pull (merge) - safer for production
Rebase can cause issues if you have local commits. Use with caution in production.
Location: bench/commands/config.py:46

http_timeout

Set the HTTP timeout for bench operations in seconds.
bench config http_timeout SECONDS

Arguments

seconds
integer
required
Timeout value in seconds

Examples

# Set 5 minute timeout
bench config http_timeout 300

# Set 30 second timeout
bench config http_timeout 30

# Set 2 minute timeout
bench config http_timeout 120

When to Adjust

Increase timeout when:
  • Working with slow connections
  • Downloading large apps
  • Operating in high-latency environments
Decrease timeout when:
  • You want faster failure detection
  • Working on fast local networks
Location: bench/commands/config.py:52

Complete Production Setup Example

# Configure a production bench
bench config restart_supervisor_on_update on
bench config dns_multitenant on
bench config serve_default_site off
bench config rebase_on_pull off
bench config http_timeout 120

# Regenerate configuration
bench setup nginx
bench setup supervisor

# Reload services
sudo service nginx reload
sudo service supervisor restart

Configuration Summary

Supervisor Restart

Auto-restart supervisor on update

Systemd Restart

Auto-restart systemd units on update

DNS Multitenant

Enable domain-based site routing

Default Site

Serve default site on port 80

Rebase on Pull

Use rebase instead of merge

HTTP Timeout

Configure request timeouts

Build docs developers (and LLMs) love