-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The network list compat API requires us to include all containers with their ip addresses for the selected networks. Because we have no network -> container mapping in the db we have to go through all containers every time. However the old code did it in the most ineffective way possible, it quered the containers from the db for each individual network. The of course is extremely expensive. Now the other expensive call is calling Inspect() on the container each time. Inspect does for more than we need. To fix this we fist query containers only once for the API call, then replace the inspect call with directly accessing the network status. This will speed things up a lot! The reported scenario includes 100 containers and 25 networks, previously it took 1.5s for the API call not it takes 24ms, that is a more than a 62x improvement. (tested with curl) [NO NEW TESTS NEEDED] We have no timing tests. Fixes #20035 Signed-off-by: Paul Holzinger <[email protected]>
- Loading branch information
Showing
2 changed files
with
74 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters