Skip to content

Faster tunnel tracking in Redis

Mikhail Mazurskiy requested to merge ash2k/faster-registry into master

This MR makes the following two changes (third commit):

  1. When looking for tunnels, gateway kas no longer checks if a tunnel supports needed service/method. This is fine because this is done on the gateway kas anyway and in practice we've never needed to add a new method so far, so paying the price each time for no reason. This is not going to break anything if/when we add a new method as gateway kas will not route the request to an old agent without a service/method as it still does the check.
  2. Because we no longer need to filter for service/method, we no longer need to store them in Redis. This allows us to avoid proto marshal/unmarshal on each register/unregister. But we still need kas URL. So, instead of storing a key/value for each tunnel, we only store kas URL has a key in the hash for an agent ID. We also only do it once (+refresh) on the first tunnel for an agent ID and once when there is no more tunnels for this agent ID in this kas. This reduces Redis I/O a lot.

Fixes #165 (closed). I think CI tunnel is in excellent shape and I cannot come up with any more ideas to improve performance, so closing the issue.

Edited by Mikhail Mazurskiy

Merge request reports