portainer: Environments page is slow to load when the docker nodes have lots of volumes
Bug description When I have lots on volumes (500 - 3000) on multiple docker swarm endpoints (10), loading the endpoints list takes a long time, mostly due to the DockerSnapshotRaw property that includes details on every single volume on every endpoint.
Expected behavior I expect the Environments(endpoints) list to load fast since it’s the first thing that opens when a user logs in and it gives a very bad impression for end users when the first page takes so long to load.
Older Portainer versions (at least 1.19.1) didn’t have the DockerSnapshotRaw data and just showed the numbers of volumes etc. which makes the Environments page (/api/endpoints call) small and quick, 190 KB on old compared to 2.9 MB on the current version.
Portainer Logs Nothing special in the logs, normal startup.
$ docker logs 8dab049a2b65
2022/12/12 02:32PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:530 > encryption key file not present | filename=portainer
2022/12/12 02:32PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:549 > proceeding without encryption key |
2022/12/12 02:32PM INF github.com/portainer/portainer/api/database/boltdb/db.go:124 > loading PortainerDB | filename=portainer.db
2022/12/12 14:32:36 server: Reverse tunnelling enabled
2022/12/12 14:32:36 server: Fingerprint 07:cc:a5:b5:95:89:d6:43:ff:39:49:7a:0d:9f:7a:5c
2022/12/12 14:32:36 server: Listening on 0.0.0.0:8000...
2022/12/12 02:32PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:789 > starting Portainer | build_number=25294 go_version=1.19.3 image_tag=linux-amd64-2.16.2 nodejs_version=18.12.1 version=2.16.2 webpack_version=5.68.0 yarn_version=1.22.19
2022/12/12 02:32PM INF github.com/portainer/portainer/api/http/server.go:337 > starting HTTPS server | bind_address=:9443
2022/12/12 02:32PM INF github.com/portainer/portainer/api/http/server.go:322 > starting HTTP server | bind_address=:9000
Steps to reproduce the issue: We can reproduce this same thing on a single node since it’s just about the combined amount of raw data from the endpoints.
- Create 10000 volumes on a docker swarm node, a simple shell command to do this
for n in {1..10000};do docker volume create;done
- Install a clean Portainer instance,
$ curl -L https://downloads.portainer.io/ce2-16/portainer-agent-stack.yml -o portainer-agent-stack.yml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 791 100 791 0 0 658 0 0:00:01 0:00:01 --:--:-- 658
$ docker stack deploy -c portainer-agent-stack.yml portainer
Creating network portainer_agent_network
Creating service portainer_portainer
Creating service portainer_agent
- Open Portainer, notice it takes a long time to load the first page (Environments) after logging in. (Note: if you do this on the local machine then it’s faster, but the data amount is still very big)
Technical details:
- Portainer version: 2.16.2
- Docker version (managed by Portainer): 20.10.21
- Kubernetes version (managed by Portainer): n/a
- Platform (windows/linux): linux / Ubuntu 22.04.1 LTS
- Command used to start Portainer:
docker stack deploy -c portainer-agent-stack.yml portainer
- Browser: Brave, Version 1.46.138 Chromium: 108.0.5359.94 (Official Build) (64-bit)
- Use Case (delete as appropriate): Using Portainer in a Commercial setup.
- Have you reviewed our technical documentation and knowledge base? Yes
Additional context Another thing that makes this issue more prominent is the fact that if I jump from the Portainer Endpoints list to another browser tab and back to Portainer again it immediately loads the whole endpoints list again…
In this browser dev tools image you can see the 10k volumes results in a 2.9 MB reply on the /api/endpoints call. Since this is a local test instance the data loads fast, but using our real Portainer instance and over VPN it can take 5-30 seconds to load.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 15
myllya thank you for all of the info and ideas you’ve shared. We are looking into performance issues in Portainer and we hope to incorporate some of what you’re talking about. It won’t be in the next release (2.17) that’s coming out shortly but I hope it’ll be in a release soon after. I may well msg again if we need more info, hope that’s all good.
@tamarahenson yes it did! 😃 great work, running 2.18.3 and is really fast with less impact now 👍
I did notice when you filter for only “unused”, the UI still requests the two filters,
dangling true
anddangling false
It would be great that when you filter, it only completes one http request for that filtered state, not both states when the other state (dangling false) was not required
@t0mtaylor
Did upgrading to 2.18.1 help?
Thanks!
Actually, there should be some changes around this in 2.17. As mentioned, we are also looking to include more performance changes in a few areas of Portainer in 2.18 too. Cheers for now.
@myllyja
While I rolled thru this testing, the page that loaded the longest for me was the Dashboard. All other pages loaded quickly. I am going to forward to Product for review. I will update you as I learn more.
Thanks!