-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
High CPU, RAM and I/O usage #885
Comments
What's in the logs on the server? |
If you tell me which logs I should share, I will gladly do so |
Sorry. If you're using Docker, they will be in the mounted volume under the If you're hosting "bare metal" with systemd, it will be in the content root directory (where the binaries are located), under I'm basically wondering if there's an error that's spamming rapidly. |
Sorry for the delay in replaying. The log files in /var/www/remotely/logs contain no information apart from what I did (so like six lines after a reboot). I ran ncdu on / while it was happening but it didn't find any additional files |
Is it still possible to run Remotely without docker, so I can test whether it's docker-related? if so, how? |
How many agents are connected to the server? Remotely won't scale well into the thousands or anything.
It's still possible. There's a ZIP with each release that contains linux-x64 binaries. You'd extract them, then set up a systemd service that executes the Below is an example systemd service and caddy configuration. Official docs can be found here. /etc/systemd/system/remotely-server.service:
/etc/caddy/Caddyfile:
|
Like 30 or so. I'll try the barebones and report back |
I don't know how to help in this situation. I've never seen this before. I would try starting with a basic out-of-the-box configuration and change one thing at a time until you find the configuration item that's setting it off. |
Out of the box works, so I'm assuming it's connected to the database or settings somehow. But how do I import them one at a time? |
@SoWhy Have you run some scheduled scripts? |
As @gravasio asked, what have you done since "taking it out of the box"? Scheduled scripts could indeed cause this if they're sending a lot of output. To be fair, though, the whole process of handling script output was put together hastily and could use some optimization.
By default, it uses SQLite, and the database file will be created in Did you change the defaults? Are you using an external Postgres or SQL Server database? |
In the past, I encountered significant CPU usage issues with scheduled scripts, which required clearing the DeviceScriptRun table to resolve. I intended to conduct a detailed investigation but am currently short on time. |
@bitbound: I only copied the Remotely.Db* and appsettings.json from the previous install to a fresh install, both docker and bare-bones (for the latter, I did change the path in the appsettings.json since it contained the docker-path). I made no other changes and the OS was a freshly installed Debian 12 each time without an external SQL server @gravasio: Good idea but there are no scheduled scripts in my Db unfortunately, the table is empty |
Describe the bug
Okay, since a few days, even after the upgrade to the 2024 version, I noticed the VM on which Remotely is running will quickly start using a lot of CPU and RAM and I can literally watch the free space being eaten by the "overlay" device:
For a while, it will only spike in intervals, filling up a lot of space before returning to 2.2G but after that, it will fill up everything and the CPU will keep being at 99% until I kill the server and restart which will only give me a short reprieve before the circle repeats
htop will show (when it works) that "dotnet Remotely_Server.dll" is the culprit I assume that the problem is some runaway setting for logging but I cannot find it.
Trying to analyze the mount directory with ncdu shows no additional files, especially not of that size
I set up a new VM with a manual Debian install (instead of the Debian CT), installed Remotely fresh and copied the settings from the old install but the problem persists. It also persists when installing Debian and Docker on a fresh PC and copying over the configuration files from the old install
The problem does not seem to appear before accessing the web interface for the first time. So the service will run with 0% CPU for hours but once you access the web interface, it will start acting up.
Assigning more CPU cores will mitigate the problem but it's not a fix because it will still create spikes in usage, just not as high.
I found some information online that indicates that it might be related to dotnet 8.x but the problem started with my dotnet 7.x based version before the upgrade. Unfortunately, I cannot remember what changed on that day and I cannot find anything related in the log files.
To Reproduce
Steps to reproduce the behavior:
Remotely Version
Server (can be found on about page): 2024.02.23.1927
Agent (can be found in device card): 2024.02.23.1927
Expected Behavior
No runaway CPU, memory and I/O usage
Screenshots
See https://www.reddit.com/r/remotely_app/comments/1ccyhs8/docker_overlay_eating_up_all_my_space_quickly_and/
Desktop (please complete the following information):
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: