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

Feature: UKSM support #2994

Closed
drdeimos opened this issue Nov 10, 2017 · 13 comments
Closed

Feature: UKSM support #2994

drdeimos opened this issue Nov 10, 2017 · 13 comments
Labels
area/collectors Everything related to data collection feature request New features

Comments

@drdeimos
Copy link

It's possible to add uksm monitoring charts?
https://github.com/dolohow/uksm

Like KSM but more effectivity

@ktsaou
Copy link
Member

ktsaou commented Nov 10, 2017

interesting!

If I understand this right, UKSM is an extension of KSM. It replaces the core algorithm of it, but everything else remains the same.

So, netdata already monitors it. Just enable KSM and UKSM and you will have charts like these:

screenshot from 2017-11-10 22-53-43

@drdeimos
Copy link
Author

drdeimos commented Nov 12, 2017

It use another /sys directory for metrics but similar file names:

$ ll /sys/kernel/mm/uksm/
total 0
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 abundant_threshold
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 cpu_governor
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 cpu_ratios
-r--r--r-- 1 root root 4.0K Nov 12 03:58 ema_per_page_time
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 eval_intervals
-r--r--r-- 1 root root 4.0K Nov 12 03:58 full_scans
-r--r--r-- 1 root root 4.0K Nov 12 03:58 hash_strength
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 max_cpu_percentage
-r--r--r-- 1 root root 4.0K Nov 12 03:56 pages_scanned
-r--r--r-- 1 root root 4.0K Nov 12 03:56 pages_shared
-r--r--r-- 1 root root 4.0K Nov 11 21:28 pages_sharing
-r--r--r-- 1 root root 4.0K Nov 12 03:56 pages_unshared
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 run
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 sleep_millisecs
-r--r--r-- 1 root root 4.0K Nov 12 03:58 sleep_times
-rw-r--r-- 1 root root 4.0K Nov 12 03:58 thrash_threshold

Can I just fix the path in the netdata config file?
Where exactly?

@ktsaou
Copy link
Member

ktsaou commented Nov 12, 2017

At netdata.conf:

[plugin:proc:/sys/kernel/mm/ksm]
	# /sys/kernel/mm/ksm/pages_shared = /sys/kernel/mm/ksm/pages_shared
	# /sys/kernel/mm/ksm/pages_sharing = /sys/kernel/mm/ksm/pages_sharing
	# /sys/kernel/mm/ksm/pages_unshared = /sys/kernel/mm/ksm/pages_unshared
	# /sys/kernel/mm/ksm/pages_volatile = /sys/kernel/mm/ksm/pages_volatile
	# /sys/kernel/mm/ksm/pages_to_scan = /sys/kernel/mm/ksm/pages_to_scan

uncomment them too.

@ktsaou
Copy link
Member

ktsaou commented Nov 12, 2017

If it works, I'll make netdata lookup for it.

@drdeimos
Copy link
Author

Uncommented this section and set new paths for pages_shared, pages_sharing, pages_unshared.
pages_volatile and pages_to_scan set to wrong files because without it netdata does now show Memory Deduper menu and this metrics non exist in UKSM:

[plugin:proc:/sys/kernel/mm/ksm]
        /sys/kernel/mm/ksm/pages_shared = /sys/kernel/mm/uksm/pages_shared
        /sys/kernel/mm/ksm/pages_sharing = /sys/kernel/mm/uksm/pages_sharing
        /sys/kernel/mm/ksm/pages_unshared = /sys/kernel/mm/uksm/pages_unshared
        /sys/kernel/mm/ksm/pages_volatile = /sys/kernel/mm/uksm/thrash_threshold # WRONG
        /sys/kernel/mm/ksm/pages_to_scan = /sys/kernel/mm/uksm/pages_scanned #WRONG

and get this (see screenshot):
979935d184e582f35cb14731751c4ec8958f899c

@drdeimos
Copy link
Author

On screen shot i've get "Saved 47 Mb". But
/sys/kernel/mm/uksm/pages_sharing = 18080 pages.
18080 pages with PAGESIZE 4096 byte =~ 70 Mbyte saved
18080*4096/1024/1024 = 70.625

@ktsaou
Copy link
Member

ktsaou commented Nov 13, 2017

You have to subtract pages_shared to find the savings. sharing pages have reduced to shared, so their diff is the savings.

ok, I can make a PR with this...

@drdeimos
Copy link
Author

On official website doc:

  • pages_shared: how many pages has been mapped by different page table entries, i.e. shared by different processes.
  • pages_sharing: this is roughly the number of redundant pages you have saved, with uksm.

@ktsaou
Copy link
Member

ktsaou commented Nov 13, 2017

I think the key here is the word "roughly".

The redundant pages (sharing) have been merged into a smaller set of pages (shared). So the actual savings is their difference.

So, If you have 1000 sharing into 500 shared, you have 50% savings.
But, if you have 1000 sharing into 10 shared, you have 99% savings.

@drdeimos
Copy link
Author

Ok. Thank you

@ktsaou
Copy link
Member

ktsaou commented Jan 20, 2018

It seems I was wrong here.
Issue #3304 describes it in detail and PR #3318 fixes it.

@paulfantom paulfantom added feature request New features and removed enhancement labels Sep 22, 2018
@stale
Copy link

stale bot commented Nov 23, 2018

Currently netdata team doesn't have enough capacity to work on this issue. We will be more than glad to accept a pull request with a solution to problem described here. This issue will be closed after another 60 days of inactivity.

@stale stale bot added the stale label Nov 23, 2018
@ktsaou ktsaou added area/collectors Everything related to data collection and removed stale labels Nov 23, 2018
@cakrit
Copy link
Contributor

cakrit commented Nov 23, 2018

Seems fixed. Please reopen if necessary.

@cakrit cakrit closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection feature request New features
Projects
None yet
Development

No branches or pull requests

4 participants