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

[RFC] gluon-status-page: update memory usage estimation #1517

Merged
merged 2 commits into from
Aug 24, 2018

Conversation

blocktrron
Copy link
Member

This commit changes the way gluon estimates memory-usage on the status-page. Currently memory consumption in percent gets calculated using

MEM = 1-(free+cached+buffers)/total

This commit (torvalds/linux@34e431b) suggests that this might not the best way to calculate such an estimation.

TL-MR3020 v1

MemTotal:          27368 kB
MemFree:            4508 kB
MemAvailable:       8368 kB
Buffers:            1940 kB
Cached:             4108 kB

Old: 1-((4508+1940+4108)/27368) = 61.42%
New: 1-(8368/27368) = 69.42%

TL-WR1043 v3

MemTotal:          60000 kB
MemFree:           29280 kB
MemAvailable:      23388 kB
Buffers:            2672 kB
Cached:             4108 kB

Old: 1-((29280+2672+4108)/60000) = 39.90%
New: 1-(23388/60000) = 61.02%

As those results are not all small differences but somewhat drastic differences (and I'm lacking in-depth knowledge about memory-management) I'm not sure which way better reflects true memory availability.

@neocturne
Copy link
Member

LGTM.

Even if it's only two two-line changes, please split this into two commits, as the respondd change is already useful by itself.

Let gluon-respondd expose "MemAvailable" from /proc/meminfo to allow for
a more realistic memory-usage estimation.

Information on MemAvailable can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
@blocktrron blocktrron force-pushed the pr-memory-calculation branch from cbc6e3b to 02dfc66 Compare August 24, 2018 22:57
@blocktrron
Copy link
Member Author

Pull-Request updated

@neocturne neocturne merged commit d3d6637 into freifunk-gluon:master Aug 24, 2018
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 24, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
skorpy2009 added a commit to skorpy2009/yanic that referenced this pull request Aug 25, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
@blocktrron blocktrron deleted the pr-memory-calculation branch August 25, 2018 11:20
@rotanid rotanid added the 0. type: enhancement The changeset is an enhancement label Aug 25, 2018
genofire pushed a commit to FreifunkBremen/yanic that referenced this pull request Aug 30, 2018
Fix memory usage estimation following this commit:
freifunk-gluon/gluon#1517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants