Administration/Configuration Files

Process Configuration

Configure how the Gigantics application runs as a process, including daemon mode settings.

Configuration Properties

The process configuration section in your config/default.yaml file controls how Gigantics runs as a system process:

process:
  daemon: false
  workers: 0

Property Details

daemon

  • Type: Boolean
  • Default: false
  • Description: Controls whether Gigantics runs as a daemon process in the background

workers

  • Type: Number
  • Default: 0
  • Description: Controls clustering mode for the application:
    • -1: Disable clustering
    • 0: Fork to all available CPUs
    • N: Fork to N workers (where N is a positive number)

Examples

Standard Process Configuration

process:
  daemon: false
  workers: 0

Daemon Mode Configuration

process:
  daemon: true
  workers: 0

Clustering Configuration

process:
  daemon: false
  workers: 4

Disable Clustering

process:
  daemon: false
  workers: -1

Running as a Daemon

To run Gigantics as a daemon process, you can either:

  1. Set daemon: true in the configuration file:

    process:
      daemon: true
      workers: 0
  2. Use the command line flag:

    ./gig start -d

Clustering Options

Gigantics supports running in cluster mode to utilize multiple CPU cores:

  • Single process (workers: -1): Runs as a single process, good for development
  • All CPUs (workers: 0): Forks a worker for each available CPU core
  • Specific number (workers: N): Forks exactly N worker processes

Best Practices

  1. Development: Use daemon: false and workers: -1 for easier debugging
  2. Production: Consider using daemon: true for background operation
  3. Performance: Use clustering (workers: 0) in production for better performance
  4. Resource Management: Set a specific number of workers if you need to limit resource usage

Testing Configuration Changes

After modifying process configuration, restart the application:

./gig stop
./gig start

You can also start with specific flags to override the configuration:

# Run as daemon regardless of config
./gig start -d
 
# Run with specific number of workers
./gig start -w=4

On this page