# tf.data.experimental.service.DispatcherConfig

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.6.0/tensorflow/python/data/experimental/service/server_lib.py#L32-L82) |

Configuration class for tf.data service dispatchers.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.data.experimental.service.DispatcherConfig`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/service/DispatcherConfig)

<br />

    tf.data.experimental.service.DispatcherConfig(
        port=0, protocol=None, work_dir=None, fault_tolerant_mode=False,
        job_gc_check_interval_ms=None, job_gc_timeout_ms=None
    )

#### Fields:

- **`port`**: Specifies the port to bind to. A value of 0 indicates that the server may bind to any available port.
- **`protocol`**: The protocol to use for communicating with the tf.data service, e.g. "grpc".
- **`work_dir`**: A directory to store dispatcher state in. This argument is required for the dispatcher to be able to recover from restarts.
- **`fault_tolerant_mode`** : Whether the dispatcher should write its state to a journal so that it can recover from restarts. Dispatcher state, including registered datasets and created jobs, is synchronously written to the journal before responding to RPCs. If `True`, `work_dir` must also be specified.
- **`job_gc_check_interval_ms`**: How often the dispatcher should scan through to delete old and unused jobs, in milliseconds. If not set, the runtime will select a reasonable default. A higher value will reduce load on the dispatcher, while a lower value will reduce the time it takes for the dispatcher to garbage collect expired jobs.
- **`job_gc_timeout_ms`**: How long a job needs to be unused before it becomes a candidate for garbage collection, in milliseconds. A value of -1 indicates that jobs should never be garbage collected. If not set, the runtime will select a reasonable default. A higher value will cause jobs to stay around longer with no consumers. This is useful if there is a large gap in time between when consumers read from the job. A lower value will reduce the time it takes to reclaim the resources from expired jobs.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `port` | <br /> <br /> |
| `protocol` | <br /> <br /> |
| `work_dir` | <br /> <br /> |
| `fault_tolerant_mode` | <br /> <br /> |
| `job_gc_check_interval_ms` | <br /> <br /> |
| `job_gc_timeout_ms` | <br /> <br /> |

<br />