spiegel_podman/pkg/api/handlers/compat
Paul Holzinger 8e5adde0b3
compat API: speed up network list
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 <pholzing@redhat.com>
2023-09-20 13:08:42 +02:00
..
auth.go fix(deps): update module github.com/docker/docker to v24 2023-05-22 15:32:12 +02:00
changes.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_archive.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_attach.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_create.go Set StopTimeout for compat API if not set by client 2023-08-24 13:24:41 -04:00
containers_export.go export: use io.Writer instead of file 2022-12-20 14:38:41 +01:00
containers_logs.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_pause.go bump go module to version 4 2022-01-18 12:47:07 +01:00
containers_prune.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
containers_restart.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_start.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_stats_freebsd.go cmd/podman/system: add API server support on FreeBSD 2023-06-29 13:10:44 +01:00
containers_stats_linux.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_stop.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_top.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
containers_unpause.go bump go module to version 4 2022-01-18 12:47:07 +01:00
events.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
exec.go Fix stutters 2022-09-10 07:52:00 -04:00
images.go Remove a dependency on libimage from pkg/api/handlers 2023-08-28 23:05:30 +02:00
images_build.go wire in new buildah build options 2023-09-14 11:21:00 +02:00
images_history.go Add sha256: to images history id for docker compatibility 2023-04-26 14:38:07 -04:00
images_prune.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
images_push.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
images_remove.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
images_save.go golangci-lint: enable nolintlint 2022-06-14 16:29:42 +02:00
images_search.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
images_tag.go Fix stutters 2022-09-10 07:52:00 -04:00
info.go fix(deps): update module github.com/docker/docker to v24 2023-05-22 15:32:12 +02:00
networks.go compat API: speed up network list 2023-09-20 13:08:42 +02:00
ping.go /_ping handler: return OSType http header 2023-08-28 22:28:16 +08:00
resize.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
secrets.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00
system.go Vendor c/image after https://github.com/containers/image/pull/1816 2023-02-08 22:37:38 +01:00
types.go stats compat API: return "id" lowercase 2023-03-22 14:36:35 +01:00
unsupported.go bump go module to version 4 2022-01-18 12:47:07 +01:00
version.go api: fix slow version endpoint 2023-07-10 15:46:45 +02:00
volumes.go fix: Docker API compatible bool deserialization 2023-08-14 15:09:14 +02:00