@cryptotaxi247 / netdata-1 / commits / 7a02ba52d

added warning about KSM; now it shows the exact installation paths

Costa Tsaousis (ktsaou) committed Feb 6, 2016 at 07:09 UTC 7a02ba52d11601759e4442f9ce837ac99b16c574
1 file changed +52 -21
netdata-installer.sh
+52 -21
@@ -96,29 +96,17 @@ Nice to see you are giving it a try!
96
97 You are about to build and install netdata to your system.
98
99 -By default netdata will be installed as any other package:
99 +It will be installed at these locations:
100
101 - - the daemon at /usr/sbin/netdata
102 - - config files at /etc/netdata
103 - - web files at /usr/share/web/netdata
104 - - plugins at /usr/libexec/netdata
105 - - cache files at /var/cache/netdata
106 - - log files at /var/log/netdata
101 + - the daemon at ${NETDATA_PREFIX}/usr/sbin/netdata
102 + - config files at ${NETDATA_PREFIX}/etc/netdata
103 + - web files at ${NETDATA_PREFIX}/usr/share/web/netdata
104 + - plugins at ${NETDATA_PREFIX}/usr/libexec/netdata
105 + - cache files at ${NETDATA_PREFIX}/var/cache/netdata
106 + - log files at ${NETDATA_PREFIX}/var/log/netdata
107
108 -If you want to install it to another directory, run the
109 -installer like this:
110 -
111 - $ME --install /path/to/install
112 -
113 -A new directory called netdata will be created as
114 -
115 - /path/to/install/netdata
116 -
117 -and all of netdata will be installed into it.
118 -Nothing will be touched on your system.
119 -
120 -This installer accepts more options.
121 -Run it with --help for help.
108 +This installer allows you to change the installation path.
109 +Press Control-C and run the same command with --help for help.
110
111 BANNER
112
@@ -396,3 +384,46 @@ To start it, just run it:
384 Enjoy!
385
386 END
387 +
388 +ksm_is_available_but_disabled() {
389 + cat <<KSM1
390 +
391 +INFORMATION:
392 +
393 +I see you have kernel memory de-duper (called Kernel Same-page Merging,
394 +or KSM) available, but it is not currently enabled.
395 +
396 +To enable it run:
397 +
398 +echo 1 >/sys/kernel/mm/ksm/run
399 +echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
400 +
401 +If you enable it, you will save 20-60% of netdata memory.
402 +
403 +KSM1
404 +}
405 +
406 +ksm_is_not_available() {
407 + cat <<KSM2
408 +
409 +INFORMATION:
410 +
411 +I see you do not have kernel memory de-duper (called Kernel Same-page
412 +Merging, or KSM) available.
413 +
414 +To enable it, you need a kernel built with CONFIG_KSM=y
415 +
416 +If you can have it, you will save 20-60% of netdata memory.
417 +
418 +KSM2
419 +}
420 +
421 +if [ -f "/sys/kernel/mm/ksm/run" ]
422 + then
423 + if [ $(cat "/sys/kernel/mm/ksm/run") != "1" ]
424 + then
425 + ksm_is_available_but_disabled
426 + fi
427 +else
428 + ksm_is_not_available
429 +fi