免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3657 | 回复: 18
打印 上一主题 下一主题

[服务应用] 请问centos6.5是否支持zram? [复制链接]

论坛徽章:
1
IT运维版块每日发帖之星
日期:2016-05-24 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-03-16 00:04 |只看该作者 |倒序浏览
centos6.5内核是2.6请问是否支持zram或者zswap内存压缩技术?

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
2 [报告]
发表于 2015-03-16 11:29 |只看该作者

论坛徽章:
1
IT运维版块每日发帖之星
日期:2016-05-24 06:20:00
3 [报告]
发表于 2015-03-16 22:58 |只看该作者
回复 2# dengbao2001
这个意思就是说得3.14内核以上才支持吗?


   

论坛徽章:
12
技术图书徽章
日期:2014-07-11 16:27:5215-16赛季CBA联赛之山西
日期:2016-01-08 16:10:11操作系统版块每日发帖之星
日期:2015-08-01 06:20:002015亚冠之武里南联
日期:2015-06-11 01:12:162015年亚洲杯之阿联酋
日期:2015-03-20 11:41:462015年亚洲杯纪念徽章
日期:2015-03-18 18:08:422015年辞旧岁徽章
日期:2015-03-03 16:54:15丑牛
日期:2015-01-10 22:23:32天秤座
日期:2014-08-20 15:53:35水瓶座
日期:2014-08-11 12:08:51午马
日期:2014-07-23 23:03:38IT运维版块每日发帖之星
日期:2016-02-18 06:20:00
4 [报告]
发表于 2015-03-16 23:16 |只看该作者
本帖最后由 phanx 于 2015-03-16 23:23 编辑

在RHEL 6中,ZRAM没有在内核主线中,而是以独立模块存在的。

[root@localhost Desktop]# lsb_release -a
LSB Version:        :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:        RedHatEnterpriseServer
Description:        Red Hat Enterprise Linux Server release 6.4 (Santiago)
Release:        6.4
Codename:        Santiago

[root@localhost Desktop]# modinfo zram
filename:       /lib/modules/2.6.32-358.el6.x86_64/kernel/drivers/staging/zram/zram.ko
description:    Compressed RAM Block Device
author:         Nitin Gupta <ngupta@vflare.org>
license:        Dual BSD/GPL
srcversion:     AD0B60E37ED8152B15E6FBA
depends:        lzo_compress,lzo_decompress
staging:        Y
vermagic:       2.6.32-358.el6.x86_64 SMP mod_unload modversions
parm:           num_devices:Number of zram devices (uint)
[root@localhost Desktop]#


https://access.redhat.com/solutions/443893

The zram driver: Supportability in Red Hat Enterprise Linux

问题
· Is the zram driver fully supported in Red Hat Enterprise Linux 6 ?
· Is the zram driver recommended to use in production environment ?
· Why zram module is present inside "staging" directory ?

环境

· Red Hat Enterprise Linux 7
· Red Hat Enterprise Linux 6.2
· zram

决议

· The zram driver is present inside "staging" directory but it is fully supported in Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 by Red Hat Global Support Service and can be used in the production environment.

·As per Greg Kroah-Hartman, the Linux "staging" tree is used to hold stand-alone drivers and filesystems that are not ready to be merged into the main portion of the Linux kernel tree at this point in time for various technical reasons. It is contained within the main Linux kernel tree so that users can get access to the drivers much easier than before, and to provide a common place for the development to happen.

论坛徽章:
1
IT运维版块每日发帖之星
日期:2016-05-24 06:20:00
5 [报告]
发表于 2015-03-17 10:56 |只看该作者
回复 4# phanx
那请问centos6该如何开启azram呢?

   

论坛徽章:
12
技术图书徽章
日期:2014-07-11 16:27:5215-16赛季CBA联赛之山西
日期:2016-01-08 16:10:11操作系统版块每日发帖之星
日期:2015-08-01 06:20:002015亚冠之武里南联
日期:2015-06-11 01:12:162015年亚洲杯之阿联酋
日期:2015-03-20 11:41:462015年亚洲杯纪念徽章
日期:2015-03-18 18:08:422015年辞旧岁徽章
日期:2015-03-03 16:54:15丑牛
日期:2015-01-10 22:23:32天秤座
日期:2014-08-20 15:53:35水瓶座
日期:2014-08-11 12:08:51午马
日期:2014-07-23 23:03:38IT运维版块每日发帖之星
日期:2016-02-18 06:20:00
6 [报告]
发表于 2015-03-17 11:24 |只看该作者
本帖最后由 phanx 于 2015-03-21 09:35 编辑

回复 5# bobopu

启用zram

[root@localhost ~]# modprobe zram


使用4个G的内存做zram设备
[root@localhost ~]# echo $((4*1024*1024*1024)) > /sys/block/zram0/disksize


用作ZSwap
[root@localhost ~]# mkswap /dev/zram0
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=6d01cf03-0eb0-425f-a99c-710b3adda2ad

[root@localhost ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       8388600 132     -1

启用这个zram设备做swap
[root@localhost ~]# swapon -p 1 /dev/zram0
[root@localhost ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       8388600 132     -1
/dev/zram0                              partition       4194296 0       1
  

论坛徽章:
1
IT运维版块每日发帖之星
日期:2016-05-24 06:20:00
7 [报告]
发表于 2015-03-17 12:03 |只看该作者
回复 6# phanx
我现在内核还是2.6.32,请问可以用这个方法开启吗?


   

论坛徽章:
12
技术图书徽章
日期:2014-07-11 16:27:5215-16赛季CBA联赛之山西
日期:2016-01-08 16:10:11操作系统版块每日发帖之星
日期:2015-08-01 06:20:002015亚冠之武里南联
日期:2015-06-11 01:12:162015年亚洲杯之阿联酋
日期:2015-03-20 11:41:462015年亚洲杯纪念徽章
日期:2015-03-18 18:08:422015年辞旧岁徽章
日期:2015-03-03 16:54:15丑牛
日期:2015-01-10 22:23:32天秤座
日期:2014-08-20 15:53:35水瓶座
日期:2014-08-11 12:08:51午马
日期:2014-07-23 23:03:38IT运维版块每日发帖之星
日期:2016-02-18 06:20:00
8 [报告]
发表于 2015-03-17 13:11 |只看该作者
回复 7# bobopu


    好像是RHEL 6.2 以上的都支持。

再说一遍,RHEL的内核版本号跟标准Linux内核版本号的含义不一样。 再说,这个zram是独立模块,你自己执行modinfo zram就看得到。

论坛徽章:
1
IT运维版块每日发帖之星
日期:2016-05-24 06:20:00
9 [报告]
发表于 2015-03-17 15:10 |只看该作者
回复 8# phanx
哦,我执行了。生成了个zram0,但是在原有的swap后面,怎样能把他调到swap前面呢?


   

论坛徽章:
12
技术图书徽章
日期:2014-07-11 16:27:5215-16赛季CBA联赛之山西
日期:2016-01-08 16:10:11操作系统版块每日发帖之星
日期:2015-08-01 06:20:002015亚冠之武里南联
日期:2015-06-11 01:12:162015年亚洲杯之阿联酋
日期:2015-03-20 11:41:462015年亚洲杯纪念徽章
日期:2015-03-18 18:08:422015年辞旧岁徽章
日期:2015-03-03 16:54:15丑牛
日期:2015-01-10 22:23:32天秤座
日期:2014-08-20 15:53:35水瓶座
日期:2014-08-11 12:08:51午马
日期:2014-07-23 23:03:38IT运维版块每日发帖之星
日期:2016-02-18 06:20:00
10 [报告]
发表于 2015-03-17 18:23 |只看该作者
回复 9# bobopu


    swap设备是依据 Priority 的高低来优先使用的,跟显示的前后没关系。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP