# Request for examples for service configurations

**URL:** <https://openziti.discourse.group/t/request-for-examples-for-service-configurations/869>\
**Category:** General Questions\
**Created:** [November 15, 2022, 11:35pm UTC](https://openziti.discourse.group/t/request-for-examples-for-service-configurations/869 "2022-11-15T23:35:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![plorenz](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/plorenz/32/54_2.png) [@plorenz](https://openziti.discourse.group/u/plorenz)\
**Post date:** [November 16, 2022, 2:03pm UTC](https://openziti.discourse.group/t/request-for-examples-for-service-configurations/869/2 "2022-11-16T14:03:23Z")

</div>

Hi @av-dev,

We did a couple of ZitiTV episodes on this topic, viewable here:

- [Apr 8th - Configuring HA Services - YouTube](https://www.youtube.com/watch?v=FattSxBNRFg)
- [Apr 29 - More HA Services (Part 2) - YouTube](https://www.youtube.com/watch?v=k0c31sdX-h4)

See also this response here: [Best Way for Providing HA Access](https://openziti.discourse.group/t/best-way-for-providing-ha-access/323)

It has a lot of the same information, but covers some additional/different facets.

I’ll do a quick post for each of the three, starting with Router HA. This is the simplest, it means we have some client application and it should bind to multiple routers when it is hosting the service.

Looking at the Go SDK as an example, you ca bind a service by calling the `ListenWithOptions` method on a `ziti.Context`

```auto
	ListenWithOptions(serviceName string, options *ListenOptions) (edge.Listener, error)

```

The `ListenOptions` type looks as follows:

```auto
type ListenOptions struct {
	Cost uint16
	Precedence Precedence
	ConnectTimeout time.Duration
	MaxConnections int
	Identity string
	BindUsingEdgeIdentity bool
	ManualStart bool
}

```

`MaxConnections` controls the number of terminators we’ll try to create. This will depend on how many edge routers we have access to, which will be determined by some combination of the total number of edge routers and which one we can use, determined by edge router policies.

`MaxConnections` defaults to 3, but if we only have access to 2 edge routers, then we’ll only try and create 2 terminators. If this number of available edge routers changes, either because of new edge routers coming on-line or because of policy changes, we’ll notice when our session refreshes and we may scale up in response.

So to recap, at least for Go SDK hosted services, each hosting process will try to create a terminator on three different edge routers, causing incoming traffic to be load balanced across those three routers. That number can be affected by the number of running edge routers, edge router policy and configuration in the `ListenOptions`.

Finally you generally want Router HA for all your hosting services, to avoid single points of failure in the Ziti network. So whether you’ve got a single hosting process or multiple hosting process running either in a failure mode or horizontally scaled mode, you want to make sure that traffic for that service isn’t being bottle-necked at a single router.

Let me know if that makes sense,  
Paul

---

_[View the full topic](https://openziti.discourse.group/t/request-for-examples-for-service-configurations/869)._
