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

[Issue] Cosmos is Extremely Slow Due to Excessive URL Querying #380

Open
quinb96 opened this issue Jan 13, 2025 · 3 comments
Open

[Issue] Cosmos is Extremely Slow Due to Excessive URL Querying #380

quinb96 opened this issue Jan 13, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@quinb96
Copy link

quinb96 commented Jan 13, 2025

What happened?

Running Cosmos 17.5

I've been watching the Cosmos logs for weeks now. What I've been able to gather is that it uses a cron job to periodically query for docker container IP addresses, if the URL is a SERVAPP url and also trying to fetch the favicon of the docker container. I have about 50 URLS. I don't run 50 docker containers at the same time but maybe like 15. Cosmos will try to fetch the favicon and the docker container IP of all 50 URLs but it takes forever because every docker container or website that is not currently up, I have to wait for it to time out on getting the docker container IP address, and wait for it to time out on fetching the favicon. Which is causing an insane amount of overhead and slows down my entire server.

I'm making a suggestion to remove the cron job or scheduled event that is always querying for the docker container IP and favicon and make it optional for to fetch the favicon. For example, have a "Fetch favicon" button and once you click it, then try to fetch the favicon. At least then you can choose what docker containers you want to query. But all the upstream querying and waiting for timeouts, is causing Cosmos and my entire server to go extremely slow. Restarting Cosmos always fixes that issue but it just happens again. This is the only issue I'm having with Cosmos, otherwise I love this app. But this speed issue is almost making me decide to go with something else.

What should have happened?

Not to query docker containers or only query docker containers and favicons of containers that are actually running.

How to reproduce the bug?

Configure 5+ URLs and once Cosmos starts trying to query for the docker container and or favicon, if the docker container is not running, it will timeout.

Relevant log output

No response

Other details

No response

System details

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]
@quinb96 quinb96 added the bug Something isn't working label Jan 13, 2025
@quinb96
Copy link
Author

quinb96 commented Jan 13, 2025

Relavent Log Output

2025/01/13 17:21:54 [ERROR] HTTP Request returned Error 504 : Gateway Timeout :
2025/01/13 17:21:57 [ERROR] FaviconFetch : Get "https://10.0.0.194:85": http: server gave HTTP response to HTTPS client
2025/01/13 17:21:57 [ERROR] FaviconFetch : Get "https://10.0.0.194:4470": dial tcp 10.0.0.194:4470: connect: connection refused
2025/01/13 17:22:13 [ERROR] FaviconFetch : Get "https://10.0.0.194:20211": dial tcp 10.0.0.194:20211: connect: connection refused
2025/01/13 17:22:13 [ERROR] FaviconFetch : Get "https://10.0.0.194:5555": http: server gave HTTP response to HTTPS client
2025/01/13 17:22:15 [ERROR] FaviconFetch : Get "https://10.0.0.194:7080": dial tcp 10.0.0.194:7080: connect: connection refused

There WERE way more URLs but I tried to see if I could solve the issue by deleting almost all of them and the issue still persists.

@quinb96 quinb96 changed the title [Issue] Cosmos Is Extremely Slow Due to Excessive URL Querying [Issue] Cosmos is Extremely Slow Due to Excessive URL Querying Jan 13, 2025
@azukaar
Copy link
Owner

azukaar commented Jan 13, 2025

  • this is not a CRON job, it is happening when you open the homepage so that the icon can be displayed
  • Normally it used to be that if the container is not running, the url should not appear in the homepage, but this has been removed temporarily because of an issue with non admin user
  • This favicon fetch should not impact performance, because it is done multithreaded (so it does not block anything). The only thing that you will see is that the page itself in your browser take longer to be fully loaded because it waits to get the icons it cant get

@quinb96
Copy link
Author

quinb96 commented Jan 14, 2025

I've not seen that the favicon fetching is multithreaded because when the logs start showing that Cosmos is timing out when querying either docker containers or favicons, Cosmos is stuck loading until all that querying is done. Which sometimes will take so long that I end up restarting Cosmos. When it finally stops querying, Cosmos finally loads the requested webpage. I don't know what to do then because I'm pretty positive this is what's causing the speed issue. Also I have quite a few apps that use the Cosmos reverse proxy and they also go slow because of Cosmos doing what I just explained earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants