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

Console neglect can cause excessive memory use in browser and backend and possibly lead to OutOfMemoryErrors #278

Open
justparking opened this issue Jan 24, 2023 · 0 comments
Labels
concern enhancement feature request proposal A feature or update proposal where feedback is sought.

Comments

@justparking
Copy link
Contributor

By design Nodel keeps its console and activity logs in in-memory circular buffers to avoid unnecessary disk thrashing.

It's obviously possible for nodes to produce excessively lengthy console lines by accident or deliberately which can easily cause substantial memory use, possibly exhausting all available memory and leading to OutOfMemoryErrors.

On hardware with abundant memory, this is typically never a problem however hardware with restricted memory can quickly be affected by this.

To prevent either of these situations I propose Nodel hosts, by default, cap both the number of lines (already in place) as well as the length of the console lines.

This would means there would be a practical cap on the amount of memory a node could consume through its use of the console.

If lengthy lines were needed for development use, a flag (via bootstrap or live API call) could be used to disable console line length capping.

I propose a length maximum of about 500 characters. That'd equate maximum memory consumption of ~1000 bytes × 2000 lines = just over 2 MB per node.

An additional feature could be to have a diagnostics chart entry showing console use for a given host:

  • Console character write rate
  • Console total size
@justparking justparking added enhancement concern feature request proposal A feature or update proposal where feedback is sought. labels Jan 24, 2023
justparking pushed a commit to automaticau/nodel that referenced this issue Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concern enhancement feature request proposal A feature or update proposal where feedback is sought.
Projects
None yet
Development

No branches or pull requests

1 participant