zoukankan      html  css  js  c++  java
  • hbase mlockall


    mlockall

    头文件:#include <sys/mman.h>

    函数原型:int mlockall(int flags);

    flags:

          MCL_CURRENT ——Lock all pages which are currently mapped into the address space of the process.
          MCL_FUTURE ——— Lock all pages which will become mapped into the address space of the process in the future. These could be for instance new pages required by a growing heap and stack as well as new memory mapped files or shared memory regions.

    返回值:
      成功:返回0;
      错误:返回-1,errno被设置。

    该函数的功能:
         将进程使用的部分或者全部的地址空间锁定在物理内存中,防止其被交换到swap空间。
         有些对时间敏感的应用会希望全部使用物理内存,以提高数据访问和操作的效率。

    HBase中使用该功能:
       mlockall_agent VM是一个简单的代理,允许锁的地址空间的过程。这避免了在压力下进程的内存回收。
      一个例子是当regionserver的服务器运行在同一台机器上和一些使用mapreduce任务中,一些未使用的数据在该地区的服务器可能会交换,这影响服务器性能。
          在hbase-env.sh中添加:(并且JVM必须是在root用户下运行)

         export HBASE_REGIONSERVER_OPTS="-agentpath:./libmlockall_agent.so=user=hbase"

  • 相关阅读:
    代码管理工具SonarQube的搭建和使用
    WebFlux Logs日志
    WebFlux WebClient异常处理
    WebFlux- WebClient(二)
    WebFlux- WebClient(一)
    WebFlux-Server-Sent Event服务器推送事件
    Reactive Stack
    Flink
    Gradle
    springboot
  • 原文地址:https://www.cnblogs.com/cl1024cl/p/6205119.html
Copyright © 2011-2022 走看看