Does linkerd and/or namerd cache routes?

Hello everyone. I have a few questions with regards to a couple of scenarios we’re testing towards linkerd adoption.

Currently we’re trialling

  1. linkerd with Zookeeper

  2. linkerd via named with Zookeeper

Given scenario 1: Does linkerd cache routing entries received from Zookeeper or does it query Zookeeper for every inbound call?

Given scenario 2: Does linkerd query named for routing for every inbound call? Given a linkerd and namerd instance on the same host, is it fair to say that the overhead is negligible?

Good questions!

  1. The first time linkerd receives a request for a service, it gets the list of replicas from Zookeeper and store it in memory. It also establishes a Zookeeper watch on that service so that it gets updates immediately as they happen. Therefore, linkerd does not need to query Zookeeper for every inbound call.

  2. In this case, namerd establishes watches on zookeeper and linkerd establishes watches on namerd. So again, no need for a namerd or zookeeper query on each call.

I hope that clears it up!

1 Like

Thanks that’s actually very helpful. Are the watches implemented as 5second long poll in the namerd scenario? A colleague stuck a proxy in between namerd and linkerd and noticed these every 5s

........> 2017/05/15 06:27:03.681778  length=8 from=845 to=852
....A...< 2017/05/15 06:27:03.683436  length=8 from=343 to=350

It depends on the which namerd interface you’re using. If you’re using the io.l5d.thriftNameInterpreter then the watch is implemented as a long-poll. Linkerd will issue a request to namerd that will only be satisfied when there is an update. If updates are happening roughly every 5 seconds, then you would see the behavior you described.

The io.l5d.mesh, and io.l5d.httpController interfaces use streaming to push updates to linkerd.

Yes we are actually using that, but during the test, we made no updates in ZK, nor any queries to linkerd so this is something of a puzzle still!

One other piece of information I omitted, we’re using linkerd/named 1.0.0