Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portainer local unresponsive and slow #12354

Open
2 tasks done
tomarigr opened this issue Oct 25, 2024 · 19 comments
Open
2 tasks done

Portainer local unresponsive and slow #12354

tomarigr opened this issue Oct 25, 2024 · 19 comments
Labels

Comments

@tomarigr
Copy link

Before you start please confirm the following.

Problem Description

the web ui gets slow and unresponsive. A simple container action takes ages to load to the point where it's unusable anymore. This used to go away after a few restarts of the machine, I used to get a lucky boot where everything worked perfect. There is no excessive CPU/RAM/DISK load, everything is on idle and all other containers are fast and responsive.

Even focusing on an other tab and back to portainer tab triggers a slow load that might last 3-4 minutes.

Updated to latest

Expected Behavior

fast

Actual Behavior

slow

Steps to Reproduce

any action takes ages of loading.

Portainer logs or screenshots

please let me know what logs you need.

Portainer version

2.21.4

Portainer Edition

Community Edition (CE)

Platform and Version

Docker

OS and Architecture

Ubuntu 22.04 amd64

Browser

any

What command did you use to deploy Portainer?

docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.21.4

Additional Information

No response

@Nick-Portainer
Copy link

What are the specs of your environment? How many environments do you have added to the Portainer server, how many containers are you running and what is the storage space free? The more details of your environment the better :)

@tomarigr
Copy link
Author

tomarigr commented Oct 30, 2024

hello,
image
image
image
PC is an intel 10105 with 32GB of RAM and 1TB disk out of which 830GB are free.

It's mostly sitting idle at 1% CPU and disk utilisation. All containers are lightning fast even when Portainer is slow.
When portainer is slow, no CPU spikes or excessive ram/disk/network usage on the system, everything looks normal.
Usually it works like this: I have to reboot the system for some reason, then portainer is slow forever, if i reboot one more time, portainer is lightning fast again and will never demonstrate the slow behaviour until I reboot again.

Lately, I have to reboot 5-6-7 times to get the lucky hit of fast portainer again.
as seen in the picture, there are 23 containers and 1 local environment.
some of my containers are:
nodejs
mariadb
cloudflared
nextcloud
home assistant
esphome
wireguard
filegator
keycloack

all these stuff were running on an RPI never exceeding 20% CPU or 25% ram before I move to this mini pc/(por)(con)tainer setup. Albeit, not in containers.

Portainer had this hit or miss upon reboot behaviour since day 1 when it was running on it's own with no other containers added. At first I thought it's just a glitch but I now am heavily invested in it and can't afford a weeks work to move out, but seriously considering since just a thought of rebooting gives me anxiety wondering if I will have to eventually reboot 20 times to get it to work straight.

again, to make it clear, there is no resource getting even close to being used more than 10% at any point and the rest of the OS/PC/Network is lightning fast and responsive.

If that helps - and I think it's a clue - I had the slow behaviour without reboot triggering it once and it happened right after a docker update was applied to the system via apt. As always, a reboot sorted it out.

All others cases of slow behaviour are after rebooting. I once let it sit for a day or two in case it goes back to being normal again but that didn't help, rebooted and it was fast and snappy again immediately for weeks.....until next reboot.

@jusvit
Copy link

jusvit commented Oct 30, 2024

I'm having the same issue with the latest version (2.21.4), other version were perfectly fine.

It just seems to hang randomly, no extreme resource usage, just unresponsive.

@jusvit
Copy link

jusvit commented Oct 30, 2024

2024-10-30.20-33-57.mp4

Example of slowness, works as-expected and then randomly hangs. (This is via lan)

@tomarigr
Copy link
Author

tomarigr commented Oct 30, 2024

for me, the problem was there since 2.21.1 and I was hoping updating will fix it, but it looks like it made it slightly worse.
Happy to troubleshoot and provide any logs needed.

EDIT: the problem I have is similar to the one posted in the video from @jusvit. Most of the time even login screen loads forever, if i refresh it will load fast sometimes up to dashboard, then clicking stacks or containers or selecting the environment loads forever again.

@jusvit
Copy link

jusvit commented Oct 30, 2024

for me, the problem was there since 2.21.1 and I was hoping updating will fix it, but it looks like it made it slightly worse. Happy to troubleshoot and provide any logs needed.

EDIT: the problem I have is similar to the one posted in the video from @jusvit.

Correction, I didn't check each version, the issue was just recent since I updated.

@Nick-Portainer
Copy link

@jusvit @tomarigr Could you please enable --log-level=DEBUG on your Portainer server? You’ll need to redeploy it with this flag enabled. Once set up, please check the slow request logs and share them with me.

@tomarigr
Copy link
Author

Hello, happy to do it, during the weekend. Will there be any sensitive info in the logs that I need to mask before uploading?

@tomarigr tomarigr reopened this Oct 31, 2024
@tomarigr
Copy link
Author

Sorry for accidental closure, fat fingers..

@Nick-Portainer
Copy link

Hello, happy to do it, during the weekend. Will there be any sensitive info in the logs that I need to mask before uploading?

@tomarigr No you should not find any sensitive information in these logs, it's always good to double check before sharing logs for sensitive information though

@AKASGaming
Copy link

Commenting to follow this as well. I'm having similar issues making it hard to access my dashboards over VPN sometimes :/

@Nick-Portainer
Copy link

@AKASGaming Can you please share your Portainer environment details?

@AKASGaming
Copy link

@jusvit
Copy link

jusvit commented Nov 4, 2024

Hello, happy to do it, during the weekend. Will there be any sensitive info in the logs that I need to mask before uploading?

@tomarigr No you should not find any sensitive information in these logs, it's always good to double check before sharing logs for sensitive information though

I enabled debug logging, this was the logs during a slowdown:
image
Might be related to GitOps sync? There doesn't seem to anything indicative of an issue.

The slowdown was a good 15 seconds, the api/motd seems unrelated.

Another one:
image

@tomarigr
Copy link
Author

tomarigr commented Nov 4, 2024

hello, unfortunately didn't have the time to do the debug, just wanted to report that today, I had to reboot 18 times to get it to work fast again. Slowness amount seems to be random from reboot to reboot, from a few seconds, to not loading even after 5 minutes, then 1 more reboot and BAM, it's back working again.

@Lenitr
Copy link

Lenitr commented Nov 18, 2024

This really sounds similar to an issue I'm having, I'm thinking it's related to OAuth login somehow, since especially the login process takes ages, and sometimes randomly logs me out since the latest portainer version. (Business Edition 2.21.4).

When I avoid OAuth and login through /#!/internal-auth everything works blazing fast as before.... And no random logouts anymore. (Using Google as an OAuth provider), session lifetime is set to 8 hours, but in some cases logout happens within a minute when navigating through Portainer pages.

My host details:
Screenshot 2024-11-18 at 12 34 23

P.S.
The main reason I'm using OAuth is because of 2FA, since it's not available in the internal authentication unfortunately #4968

@Nick-Portainer
Copy link

@jusvit Can you share the complete log?

@tomarigr
Copy link
Author

Hello, FYI I don't have 2FA and still get the slowness after reboot, but the root cause could be the same.

@jusvit please also try rebooting a few times when 2FA enabled and see if you get a lucky boot where everything works perfect.

@jusvit
Copy link

jusvit commented Nov 19, 2024

Apologies folks, that's as far as I want to mess around diagnosing. I've already downgraded, hopefully you find the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@jusvit @tomarigr @AKASGaming @Lenitr @Nick-Portainer and others