Dagster daemon#

Several Dagster features, like schedules, sensors, and run queueing, require a long-running dagster-daemon process to be included with your deployment.


Starting the daemon#

Running locally#

The Dagster daemon can be started locally in a few ways, which are outlined in the following tabs. Once started, the process should be kept running.

The Dagster daemon can load a file directly as a code location. In the following example, we used the -f argument to supply the name of the file to dagster-daemon:

dagster-daemon run -f my_file.py

This command loads the definitions in my_file.py as a code location in the same Python environment where the daemon resides.

You can also include multiple files at a time:

dagster-daemon run -f my_file.py -f my_second_file.py

Deploying the daemon#

For information on deploying the daemon to environments like Docker or Kubernetes, refer to the deployment guides.


Available daemons#

The dagster-daemon process reads from your Dagster instance file to determine which daemons should be included. Each of the included daemons then runs on a regular interval in its own threads.

The following daemons are currently available:

NameDescriptionEnabled by
Scheduler daemonCreates runs from active schedulesEnabled / runs as long as the default DagsterDaemonScheduler isn't overriden as the scheduler on your instance.
Run queue daemonLaunches queued runs, taking into account any limits and prioritization rules set on your instanceSetting the run coordinator on your instance to QueuedRunCoordinator.
Sensor daemonCreates runs from active sensors that are turned onAlways enabled
Run monitoring daemonHandles run worker failuresUsing the run_monitoring field in your instance. Refer to the Run monitoring documentation for more info.

If the daemon is configured to use a workspace file to load code location(s), note that they will periodically reload the file. This means that the dagster-daemon process doesn't need to be restarted when workspace files are changed.


Checking daemon status in Dagit#

To check the status of the dagster-daemon process within Dagit:

  1. In the top navigation, click Deployment.
  2. Click the Daemons tab.

This tab displays information about all the daemons currently configured on your instance.

Each daemon periodically writes a heartbeat to your instance storage. If a daemon doesn't show a recent heartbeat, check the logs from your dagster-daemon process for errors.