Linux性能调优之内存调优
2017-05-18 13:40
127 查看
内存的调优
1.内存测试
安装内存测试软件:memtest
rpm -ivh /media/Packages/memtest86+-4.10-2.el6.x86_64.rpm
内存测试:
memtest-setup
执行结果查看:
cat /etc/grub.conf //启动项已经添加了一个启动选项
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Memtest86+ (4.10)
root (hd0,0)
kernel --type=netbsd /elf-memtest86+-4.10
title Red Hat Enterprise Linux(2.6.32-431.el6.x86_64)
root(hd0,0)
kernel/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=1760ae83-ad1c-48dd-8785-915950691d72
rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16
crashkernel=auto KEYBOARDTYPE=pc
KEYTABLE=us rd_NO_DM rhgb quiet
initrd/initramfs-2.6.32-431.el6.x86_64.img
reboot
2.内存缓存
BUFFER 索引缓存 缓存 写时用,先写入到内存
CACHE 页缓存 快取 读时用,先读入到内存
buffers #缓存从磁盘读出的内容,这种理解是片面的
cached #缓存需要写入磁盘的内容,这种理解是片面的
终端1:[root@localhost ~]# free -m
终端2:[root@localhost ~]# find /
CACHE:页缓存, 内存页是内存中的最小存储单位,一页尺寸4kB
对象文件系统 块block 1kB 2kB 4kB
扇区sectors 512b
终端1: [root@localhost ~]# free -m //查看 buffer 增长
total used free shared buffers cached
Mem: 1004412 462792 541620 0 27892 190344
-/+ buffers/cache: 244556 759856
Swap: 1048568 0 1048568
手动清空buffer+cache :
查看缓存
[root@localhost ~]# cat /proc/sys/vm/drop_caches //默认是 0
[root@localhost ~]# free –m
total used free shared buffers cached
Mem: 1137 783 353 0 67 411
-/+ buffers/cache: 303 833
Swap: 999 0 999
清空缓存:
sync
#内存和硬盘的数同步,内存数据写入硬盘
echo 1 > /proc/sys/vm/drop_caches
#清空缓存
查看清空结果
[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 1137 367 770 0 0 67
-/+ buffers/cache: 299 838
Swap: 999 0 999
1.内存测试
安装内存测试软件:memtest
rpm -ivh /media/Packages/memtest86+-4.10-2.el6.x86_64.rpm
内存测试:
memtest-setup
执行结果查看:
cat /etc/grub.conf //启动项已经添加了一个启动选项
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Memtest86+ (4.10)
root (hd0,0)
kernel --type=netbsd /elf-memtest86+-4.10
title Red Hat Enterprise Linux(2.6.32-431.el6.x86_64)
root(hd0,0)
kernel/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=1760ae83-ad1c-48dd-8785-915950691d72
rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16
crashkernel=auto KEYBOARDTYPE=pc
KEYTABLE=us rd_NO_DM rhgb quiet
initrd/initramfs-2.6.32-431.el6.x86_64.img
reboot
2.内存缓存
BUFFER 索引缓存 缓存 写时用,先写入到内存
CACHE 页缓存 快取 读时用,先读入到内存
buffers #缓存从磁盘读出的内容,这种理解是片面的
cached #缓存需要写入磁盘的内容,这种理解是片面的
终端1:[root@localhost ~]# free -m
终端2:[root@localhost ~]# find /
CACHE:页缓存, 内存页是内存中的最小存储单位,一页尺寸4kB
对象文件系统 块block 1kB 2kB 4kB
扇区sectors 512b
终端1: [root@localhost ~]# free -m //查看 buffer 增长
total used free shared buffers cached
Mem: 1004412 462792 541620 0 27892 190344
-/+ buffers/cache: 244556 759856
Swap: 1048568 0 1048568
手动清空buffer+cache :
查看缓存
[root@localhost ~]# cat /proc/sys/vm/drop_caches //默认是 0
[root@localhost ~]# free –m
total used free shared buffers cached
Mem: 1137 783 353 0 67 411
-/+ buffers/cache: 303 833
Swap: 999 0 999
清空缓存:
sync
#内存和硬盘的数同步,内存数据写入硬盘
echo 1 > /proc/sys/vm/drop_caches
#清空缓存
查看清空结果
[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 1137 367 770 0 0 67
-/+ buffers/cache: 299 838
Swap: 999 0 999
相关文章推荐
- CPU和内存调优(非常全)
- [Spark性能调优] 第四章 : Spark Shuffle 中 JVM 内存使用及配置内幕详情
- Linux内存监控与调优 推荐
- JVM--内存调优
- Java内存区域与内存溢出异常与Eclipse运行速度调优
- JVM学习笔记(四)------内存调优
- JVM学习笔记(四)------内存调优
- JVM常用的内存调优(1)
- spark调优第二篇:spark内存溢出还可能是你的driver memory的内存内存不够
- JVM调优之---常见内存模型总结
- 调优JVM内存,并解决OutOfMemoryError,StackOverflowError等异常问题
- oracle内存调优参数详解
- JVM学习笔记(4)------内存调优
- JVM内存原理,weblogic内存的调优
- 系统调优一之内存子系统
- Java内存调优经验总结
- JVM学习笔记(四)------内存调优
- Linux之性能调优--CPU_内存_IO_网络
- Java jvm内存调优(来自小强公开课)
- linux性能分析及调优__cpu 性能瓶颈调优可调性能参数 、内存性能瓶颈可调性能参数(操作系统设置swap的目的、在写程序时、如何使自己的内存不被换出swap,常驻物理内存)、磁盘I/O可调性能参