Example Tuning
Различия
Здесь показаны различия между двумя версиями данной страницы.
Следующая версия | Предыдущая версия | ||
example:example_tuning [20.04.2017 07:48] admin создано |
example:example_tuning [20.05.2019 06:52] admin Approved(admin 2019/05/20 06:52) |
||
---|---|---|---|
Строка 1: | Строка 1: | ||
- | #linux #selinux ### отключить selinux | + | <code bash> |
- | #linux #selinux echo 0 > /selinux/enforce | + | |
- | #linux #selinux vi /etc/selinux/config | + | |
- | #linux #selinux SELINUX=disabled | + | |
- | #linux #selinux SELINUXTYPE=targeted | + | |
- | #linux #selinux SETLOCALDEFS=0 | + | |
- | #linux | + | |
- | #linux #tuning ### оптимизация и тюнинг | + | |
- | #linux #tuning vi /etc/resolv.conf | + | |
- | #linux #tuning nameserver 10.90.1.3 | + | |
- | #linux #tuning nameserver 8.8.8.8 | + | |
- | #linux #tuning options single-request | + | |
- | #linux #tuning sudo apt-get install nscd && sudo service nscd restart | + | |
- | #linux #tuning yum -y install nscd && service nscd restart; grep single-request /etc/resolv.conf || echo -e '\noptions single-request' >>/etc/resolv.conf ### Кеширование dns и не только | + | |
+ | # кеширование и ускорение dns passwd groups services protocols ###linux ###tuning ###cache | ||
+ | vi /etc/resolv.conf | ||
+ | nameserver 192.168.1.1 | ||
+ | nameserver 8.8.8.8 | ||
+ | options single-request | ||
+ | # end vi | ||
+ | sudo apt-get install nscd || yum -y install nscd | ||
+ | sudo service nscd restart | ||
+ | grep single-request /etc/resolv.conf || echo -e '\noptions single-request' >>/etc/resolv.conf | ||
+ | </code> | ||
+ | ==== perf ==== | ||
+ | <code bash> | ||
+ | # профилирование ###perf ###oprofile ###nmi | ||
+ | yum --enablerepo='base-debuginfo' install kernel-debuginfo-`uname -r` kernel-devel perf oprofile gdb kexec-tools crash | ||
+ | perf top -d 5 -U | ||
+ | perf top -d 5 -g -U | ||
+ | perf stat -e task-clock,cycles,instructions,cache-references,cache-misses sleep 5 | ||
+ | perf record -a sleep 5 и потом perf report | ||
+ | # профилирование ###perf ###oprofile ###nmi | ||
+ | echo 0 > /proc/sys/kernel/nmi_watchdog | ||
+ | opcontrol --deinit | ||
+ | opcontrol --init | ||
+ | opcontrol --reset | ||
+ | opcontrol --start --vmlinux=/usr/lib/debug/lib/modules/2.6.32-642.el6.x86_64/vmlinux | ||
+ | # но иногда можно и --no-vmlinux если нам не важно про ядро, а только про юспейс | ||
+ | # если баг Failed to open profile device: Device or resource busy, то стопаем все виртуалки KVM, одна из них залочила nmi | ||
+ | sleep 10 # ждем сбора статистики | ||
+ | opcontrol --stop | ||
+ | # включаем watchdog обратно | ||
+ | echo 1 > /proc/sys/kernel/nmi_watchdog | ||
+ | </code> | ||
+ | |||
+ | ~~OWNERAPPROVE~~ | ||