# tf.data.experimental.service.WorkerConfig

<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#L222-L266) |

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.WorkerConfig`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/service/WorkerConfig)

<br />

    tf.data.experimental.service.WorkerConfig(
        dispatcher_address, worker_address=None, port=0, protocol=None,
        heartbeat_interval_ms=None, dispatcher_timeout_ms=None
    )

#### Fields:

- **`dispatcher_address`**: Specifies the address of the dispatcher.
- **`worker_address`**: Specifies the address of the worker server. This address is passed to the dispatcher so that the dispatcher can tell clients how to connect to this worker.
- **`port`**: Specifies the port to bind to. A value of 0 indicates that the worker can bind to any available port.
- **`protocol`**: (Optional.) Specifies the protocol to be used by the server, e.g. "grpc".
- **`heartbeat_interval_ms`**: How often the worker should heartbeat to the dispatcher, in milliseconds. If not set, the runtime will select a reasonable default. A higher value will reduce the load on the dispatcher, while a lower value will reduce the time it takes to reclaim resources from finished jobs.
- **`dispatcher_timeout_ms`**: How long, in milliseconds, to retry requests to the dispatcher before giving up and reporting an error. Defaults to 1 hour.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `dispatcher_address` | <br /> <br /> |
| `worker_address` | <br /> <br /> |
| `port` | <br /> <br /> |
| `protocol` | <br /> <br /> |
| `heartbeat_interval_ms` | <br /> <br /> |
| `dispatcher_timeout_ms` | <br /> <br /> |

<br />