Linux系统Large Pages设置

Large Pages说明

sun文档: http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html

说白了,就是在操作系统级别上,针对进程的虚拟内存空间,使用大内存页,避免频繁的进行页换入换出,出现系统抖动。同样使用大内存分页,也会有一些负面影响,两快大内存分页之间会出现一些内存碎片,从而影响整体系统的性能,当一旦没有足够的大内存块时,整个OS下系统进程又会将原先的大内存打散恢复默认的内存分页。

摘自sun文档的原话 写道

A Translation-Lookaside Buffer (TLB) is a page translation cache that holds the most-recently used virtual-to-physical address translations. TLB is a scarce system resource. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses. By using bigger page size, a single TLB entry can represent larger memory range. There will be less pressure on TLB and memory-intensive applications may have better performance.

However please note sometimes using large page memory can negatively affect system performance. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system. Also please note for a system that has been up for a long time, excessive fragmentation can make it impossible to reserve enough large page memory. When it happens, either the OS or JVM will revert to using regular pages.

Linux下如何配置large Page

Large page support is included in 2.6 kernel. Some vendors have backported the code to their 2.4 based releases. To check if your system can support large page memory, try the following:

1.cat /proc/meminfo | grep Huge
2.HugePages_Total: 0
3.HugePages_Free: 0
4.Hugepagesize: 2048 kB

If the output shows the three "Huge" variables then your system can support large page memory, but it needs to be configured. If the command doesn't print out anything, then large page support is not available. To configure the system to use large page memory, one must log in as root, then:

Increase SHMMAX value. It must be larger than the Java heap size. On a system with 4 GB of physical RAM (or less) the following will make all the memory sharable: 

1.echo 4294967295 > /proc/sys/kernel/shmmax  

Specify the number of large pages. In the following example 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048k, then 3g = 3 x 1024m = 3072m = 3072 * 1024k = 3145728k, and 3145728k / 2048k = 1536): 

1.echo 1536 > /proc/sys/vm/nr_hugepages  

Note the /proc values will reset after reboot so you may want to set them in an init script (e.g. rc.local or sysctl.conf).

参数配置
sun jdk :

jrockit jdk :

效果

摘录校长的测试结果: 写道

这个设置, 目前观察下来的结果是EDEN区域收集明显速度比较快, 最多几个ms, 但是,对于FGC, 大约需要0。9, 但是发生时间非常的长, 应该是影响不大。 但是对于非web应用的中间件服务, 这个设置很要不得, 可能导致很严重延迟效果.这时需要搭配cms,加速old区的并发收集

时间: 2024-08-04 02:39:47

Linux系统Large Pages设置的相关文章

Linux系统init级别设置错误导致系统不能正常启动怎么办?

  Linux系统init级别设置错误导致系统不能正常启动怎么办? 1.在Linux启动过程中,按Esc键进入Grub界面. 2.按e修改当前Linux系统的配置. 3.选择第二行,按e键,并按如下步骤执行 1)在出现的命令行后加1(单用户模式); 2)按Enter键接收操作并后退到当前Linux配置页面; 3)按b重启Linux. 4.重启后进入Linux系统,修改/etc/inittab文件.将init级别改成你想要的,比如我在这里改成3(完整多用户模式). id:3:initdefault

Linux系统时间怎么设置

Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel中的时钟,而硬件时钟则是主板上由电池供电的时钟,这个硬件时钟可以在BIOS中进行设置.当Linux启动时,硬件时钟会去读取系统时钟的 设置,然后系统时钟就会独立于硬件运作. Linux 中的所有命令(包括函数)都是采用的系统时钟设置.在Linux中,用于时钟查看和设置的命令主要有date.hwclock和clock.其 中,clock和hwclo

Linux 系统为用户设置复杂密码度策略

假设你已经在你的 Linux 系统上使用了 PAM (Pluggable Authentication Modules,插入式验证模块),因为这些年所有的 Linux 发行版都在使用它. 一.准备工作 安装 PAM 的 cracklib 模块,cracklib 能提供额外的密码检查能力. Debian.Ubuntu 或 Linux Mint 系统上: $ sudo apt-get install libpam-cracklib CentOS.Fedora.RHEL 系统已经默认安装了 crack

linux系统日期时间设置查看命令

1.date命令 date命令的功能是显示和设置系统日期和时间. 该命令的一般格式为: date [选项] 显示时间格式(以+开头,后面接格式) date 设置时间格式 命令中各选项的含义分别为: -d datestr, --date datestr 显示由datestr描述的日期 -s datestr, --set datestr 设置datestr 描述的日期 -u, --universal 显示或设置通用时间  代码如下 复制代码 查看系统时间 # date 设置系统时间 # date -

Linux系统mrtg安装设置教程

MRTG(Multi Router Traffic Grapher)是一套可用来绘出网络流量图的软件,由瑞士奥尔滕的Tobias Oetiker与Dave Rand所开发,此软件以GPL授权. 下面是网卡流量监控图 MRTG最早的版本是在1995年春天所推出,以Perl所写成,因此可以跨平台使用,它利用了SNMP送出带有物件识别码(OIDs)的请求给要查询的网络设备,因此设备本身需支援SNMP.MRTG再以所收集到的资料产生HTML档案并以GIF或PNG格式绘制出图形,并可以日.周.月等单位分别

用Linux系统共享上网设置案例

  环境:一台Linux机器单网卡,一台window机器单网卡,一个四口集线器. 背景:房东只提供了一条上网线,并且限定了只能用一个网卡上网(就是我的Linux机器的网卡). 目的:通过Linux共享上网设置将window机器也带入网络中. 方法:利用Linux机器做个DHCP服务器,用集线器做成一个局域网.再转发此网段的IP请求. 建立Linux DHCP服务器.如果是Ubuntu系统的话,直接 #apt-get install dhcpd 安装完毕后更改/etc/dhcpd.conf文件,加

Linux系统crontab定时任务设置参数实例及常用技巧

般情况下,我们在操作和运维VPS.服务器的时候可能会用到crontab定时任务的配置,比如定时的重启服务器.定时备份数据等操作使用的还是比较多的.这里就离不开使用crontab命令的任务配置,在这篇文章中,老左将会整理较为齐全的crontab命令使用的方法以及常用的实例操作.     从上图中,我们其实就可以看到crontab具体用法.一共有6个段落,前面5个标示定时的时间设定,后面一个标示文件的路径定时执行.   第一.crontab安装   一般我们使用的centos或者debian发行版本

为Linux系统的服务器设置防火墙的方法

  防火墙有助于过滤出入端口和阻止使用暴力法的登录尝试.我倾向于使用CSF(Config Server Firewall)这个强力防火墙.它使用了iptables,易于管理,而且对于不擅于输入命令的用户提供了web界面. 要安装CSF,先登录到服务器,切换到这个目录下: 代码如下: cd /usr/local/src/ 然后以root权限执行下面命令: 代码如下: wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz cd

Linux系统下Apache服务器设置与优化

Apache服务器的设置文件位于/usr/local/apache/conf/目录下,传统上使用三个配置文件httpd.conf,access.conf和srm.conf,来配置Apache服务器的行为. httpd.conf提供了最基本的服务器配置,是对守护程序httpd如何运行的技术描述:srm.conf是服务器的资源映射文件,告诉服务器各种文件的MIME类型,以及如何支持这些文件:access.conf用于配置服务器的访问权限,控制不同用户和计算机的访问限制:这三个配置文件控制着服务器的各