Linkerd sending every request to namerd for dTabs

Hi All,

We have online storage application, where user can upload/download his data from the private space allocated to user similar to Google Drive and Dropbox.
We have micro services like Upload and download. Upload micro service generates unique file identifier for each content uploaded by the user and these content accessible from those unique URLs.
So for each download and upload with got unique URLs like mentioned below

  1. myapp/uploads/e997bbffd4144ce2822120134447f6ba
  2. myapp/download/e997bbffd4144ce2822120134447f6ba

(removed https:// from above mentioned urls due that its was not allowing me tor create topic)

We are using sidecar linkerd setup, and Namerd is separated from linkerd. We have got our all dTabs in consul KV. Namerd fetches all the dTabs from consul and linkerd fetches dTabs from namerd.
So according to the implementation linkerd should not send request to namerd for each and every request for fetching updated dtabs. But in our case as all the request are unique so it’s searching for dtabs entries in namerd

Like i am downloading object mentioned on [2.] first time my request will to till namerd to fetch the dtab, and for next occurrence it will fullfill from linkerd itself. But if user has multiple objects downloading all retests will go till namerd as all object endpoints are unique.

dTabs which i am using for both the micro service mentioned below

/http/*/*/*/upload/* => /#/io.l5d.consul/myapp/upload
/http/*/*/*/download/* => /#/io.l5d.consul/myapp/download

Also attaching, linkerd and namerd configuration. Can you please suggest us in such scenario what are the changes in dTabs or configuration is required so we can optimize our network traffic.

linkerd.yml


namerd.yml

PS: i have replaced the application name from myapp.com in configuration.

-Rohit

Hi @rohitrsh!

You are correct that the problem is that each unique URL will create a unique service in Linkerd and cause a request to namerd for each one. I see that you’re using the methodAndHost identifier which produces service names like:

/http/1.1/GET/myapp/uploads/e997bbffd4144ce2822120134447f6ba

If you switch from using the methodAndHost identifier to using the io.l5d.path identifier with segments: 1 then you’ll get service names like this instead:

/http/uploads

These are no longer unique per endpoint which should give you much better performance. You will also have to modify your dtab:

/http/upload => /#/io.l5d.consul/myapp/upload
/http/download => /#/io.l5d.consul/myapp/download

Hope this helps!

Hello @Alex

Thanks it worked. But we have multiple micro-services upload and download are two of them. So we have to mange multiple segments. We have changed the config as below and its working fine for us.

Is it good practice to have array of identifiers?

    - kind: io.l5d.path
      segments: 2
    - kind: io.l5d.path
      segments: 3
    - kind: io.l5d.path
      segments: 4
    - kind: io.l5d.path
      segments: 5
    - kind: io.l5d.path
      segments: 6
    - kind: io.l5d.path
      segments: 7```


-Rohit

Hi @rohitrsh. Yes, chaining multiple io.l5d.path identifiers together is fine.

Hey @siggy/@Alex

Thanks for the quick help, As of now we are good. You may go ahead and close this topic.

-Rohit