Requesting information from the Controller via NBI takes very long
Requesting information from the controller via the NBI takes very long and makes the overall experience of the CLI and the controller in general very sluggish.
Description
If a request via the NBI is made, multiple database request are made. In general, this is fine, but here is a little example of the problematic in our case:
Let's assume someone wants to get all the registered ONDs for a specific PND. Normally, we would expect that a single request to the database is made.
In our case, the process is a bit different. We are requesting the same objects multiple times within a single request and marshal them into our internal object definitions, which slows down the whole process a lot. In the log below, one can see that multiple transports are created. This means that multiple instances of the same device are created through the whole request.
{"level":"info","msg":"listening to [::]:55055","time":"2022-07-12T16:59:47+02:00"}
{"level":"info","msg":"set up grpc server in secure mode","time":"2022-07-12T16:59:47+02:00"}
{"level":"info","msg":"Server exiting","time":"2022-07-12T16:59:47+02:00"}
{"level":"info","msg":"initialisation finished","time":"2022-07-12T16:59:47+02:00"}
SBIS: [0xc0011f45a0]
SBIS: [id:"bf7db1e4-d20a-400b-b25f-6dad296ed7b2"]
{"level":"info","msg":"building new gNMI transport","target":"172.100.0.11:6030","time":"2022-07-12T17:01:02+02:00","tls":false}
{"level":"info","msg":"building new gNMI transport","target":"172.100.0.11:6030","time":"2022-07-12T17:01:03+02:00","tls":false}
{"level":"info","msg":"sending gNMI get request","path":[{"element":["interfaces"],"elem":[{"name":"interfaces"}]}],"target":"172.100.0.11:6030","time":"2022-07-12T17:01:04+02:00"}
{"level":"info","msg":"building new gNMI transport","target":"172.100.0.11:6030","time":"2022-07-12T17:01:13+02:00","tls":false}
{"level":"info","msg":"building new gNMI transport","target":"172.100.0.11:6030","time":"2022-07-12T17:01:14+02:00","tls":false}
{"level":"info","msg":"building new gNMI transport","target":"172.100.0.11:6030","time":"2022-07-12T17:01:15+02:00","tls":false}
Expected Behavior
A request should result in a single request and in single internal struct creations.
Actual Behavior
Multiple calls for each request are made and multiple internal structs are created
Possible Fix
Steps to Reproduce
Context
Your Environment
- Version used:
- Environment name and version (e.g. go v1.16.3 on FreeBSD 13.0-current):
- Server type and version:
- Operating System and version: