jemalloc

【巨杉数据库SequoiaDB】巨杉Tech | 巨杉数据库的并发 malloc 实现

江枫思渺然 提交于 2020-02-25 19:39:31
本文由巨杉数据库北美实验室资深数据库架构师撰写,主要介绍巨杉数据库的并发malloc实现与架构设计。 原文为英文撰写,我们提供了中文译本在英文之后。 SequoiaDB Concurrent malloc Implementation Introduction In a C/C++ application, the dynamic memory allocation function malloc(3) can have a significant impact on the application’s performance. For multi-threaded applications such as a database engine, a sub-optimal memory allocator can also limit the scalability of the application. In this paper, we will discuss several popular dynamic memory allocator, and how SequoiaDB addresses the dynamic memory allocation problem in its database engine. dlmalloc/ptmalloc The GNU C

Ubuntu18.04安装Redis

别说谁变了你拦得住时间么 提交于 2020-02-23 11:22:43
1.下载 因为我本身就是Ubuntu18.04的操作系统,所以直接在浏览器中搜索Redis官网,下载压缩包进行安装 Redis官网可以访问到两个, 一个是英文(国外服务器):https://redis.io/ 一个是中文:http://www.redis.cn/ 无论哪个下载就行。 2.解压 将Redis的压缩包移动到你想要安装的目录然后解压 echo@echo:/opt$ sudo tar -zxvf redis-5.0.7.tar.gz 3.编译 进入解压完成的文件夹的src即源码目录,进行编译。 使用make命令编译,但有些操作系统中可能没有make命令因此需要安装make就像我这个 然后执行安装make 执行编译 echo@echo:/opt/redis-5.0.7/src$ sudo make 报错 该错误是由于没有安装gcc需要安装gcc echo@echo:/opt/redis-5.0.7/src$ sudo apt-get install gcc 然后执行编译,又报错 fatal error: jemalloc/jemalloc.h: 没有那个文件或目录 查某大佬的文章 分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。 而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc

【Linux学习】安装redis5.0.5

我的未来我决定 提交于 2020-02-22 12:59:09
1、make编译时报错 cd src && make all make[1]: Entering directory `/usr/local/redis-4.0.10/src' CC adlist.o In file included from adlist.c:34: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory zmalloc.h:55:2: error: #error "Newer version of jemalloc required" make[1]: *** [adlist.o] Error 1 make[1]: Leaving directory `/usr/local/redis-4.0.10/src' make: *** [all] Error 2 解决方法:输入命令# make MALLOC=libc 2、安装后发现外部无法连接虚拟机redis,一直报错,有以下几个原因 (1)、6379端口未开放 # vi /etc/sysconfig/iptables //编辑防火墙配置文件,开放端口 (按i开始编辑文本,:q! 不保存文件,强制退出vi命令,:w 保存文件,不退出vi命令,:wq 保存文件,退出vi命令) -A INPUT -p tcp -m tcp -

linux下tengine安装

被刻印的时光 ゝ 提交于 2020-02-16 00:52:13
1.什么是tengine? 说到tengine,首先还是得说下nginx了,大家对于nginx并不陌生,对于基本的需求都能满足,如果是涉及高级性能,那么就必须使用 商用版nginx plus 了,一谈到商用,大家就特别敏感,有没有开源免费的呢,有的,所以tengine诞生了。 Tengine( http://tengine.taobao.org/index_cn.html )是由 淘宝网发起的Web服务器项目 。它在Nginx的基础上,针对大访问量网站的需求,添加了很多 高级功能和特性。主要特性有 : 继承Nginx-1.6.2的所有特性,兼容Nginx的配置; 动态模块加载(DSO)支持。加入一个模块不再需要重新编译整个Tengine; 支持SO_REUSEPORT选项,建连性能提升为官方nginx的三倍; 支持SPDY v3协议,自动检测同一端口的SPDY请求和HTTP请求; 流式上传到HTTP后端服务器或FastCGI服务器,大量减少机器的I/O压力; 更加强大的负载均衡能力,包括一致性hash模块、会话保持模块,还可以对后端的服务器进行主动健康检查,根据服务器状态自动上线下线,以及动态解析upstream中出现的域名; 输入过滤器机制支持。通过使用这种机制Web应用防火墙的编写更为方便; 支持设置proxy、memcached、fastcgi、scgi

Redis集群安装及配置步骤

。_饼干妹妹 提交于 2020-02-15 10:43:14
运行环境:CentOS 7(版本号:1503) Redis版本:3.0.5 参考文档:① http://www.redis.cn/topics/cluster-tutorial.html ② http://www.linuxidc.com/Linux/2015-08/121845.htm 注意:redis集群需要至少6个节点,也就是六台服务器。如果服务器数量不足可在每台服务器上建立多个节点,如2台服务器,每台服务器上建立3个节点 一、 为所有服务器安装Redis 1.使用ssh工具连接服务器,下载和解包。 cd /usr/local/ wget http://download.redis.io/releases/redis-3.0.5.tar.gz tar -zxvf redis-3.0.5.tar.gz 2.重命名文件夹 mv redis-3.0.5 redis 3.编译安装 cd redis make && make install 在这里可能会碰到一个错误导致编译不过(如下) make[1]: Entering directory `/redis/src' CC adlist.o In file included from adlist.c:34: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or

redis内存消耗详解

[亡魂溺海] 提交于 2020-02-14 22:43:06
Redis所有的数据都存在内存中,相对于廉价的硬盘,内存资源还是比较昂贵的,因此如何高效利用redis内存变得非常重要。 内存消耗分析 管理内存的原理和方法 内存优化技巧 一、内存消耗 理解redis内存,首先要掌握redis内存消耗在哪些方面。有些内存消耗是必不可少的,而有些可以通过参数调整和合理使用来规避内存浪费。 1.1 内存使用统计 首先需要了解redis自身使用内存的统计数据,可通过执行info memory命令来获取内存相关指标 used_memory redis分配器分配的内存总量,也就是内部存储的所有数据内存占用量 used_memory_human 以可读的格式返回used_memory used_memory_rss 从操作系统的角度显示redis进程占用的物理内存总量 used_memory_peak 内存使用的最大值,表示used_memory的峰值 used_memory_peak_human 以可读的格式返回used_memory_peak used_memory_lua Lua引擎所消耗的内存大小 mem_fragmentation_ratio used_memory_rss/used_memory比值。表示内存碎片率 mem_allocator redis 所使用的内存分配器,默认为jemalloc 需要重点关注的指标有:used_memory

Netty4 中的内存管理

馋奶兔 提交于 2020-01-30 15:29:21
在Netty4中引入了新的内存管理机制极大地提升其性能,本文将对该内在管理机制进行剖析。 这里 有篇文章 讲述了在推特(Twitter)内部 使用Netty的状况以及Netty4所带来的性能收益。 在分析Netty4的 PooledByteBufAllocator 之前,我们最好先认识一下 jemalloc 。 Netty在4.0之前的版本已经尝试过通过优化内存管理的方式来提高性能(如果我没有记错的话),但4.0中的改进则特别 显著。在这个版本中,其内存管理实现主要是参考了 jemalloc 。 jemalloc jemalloc 是由Jason Evans在FreeBSD项目中引入的,其主旨是为了提升在并发环境下内存的分配效率。说白了就是替代 malloc 。malloc之所以没有照顾到并发环境,那是由于在那个时代并发还只在理论,未曾普及。而现在则是多核的天下,连 手机都动则2、4核,甚至于8核了。与jemalloc齐名的还有Google的 tcmalloc ,其 实现与jemalloc多少也有点相似,这里不做介绍。 jemalloc的理念 我们以买火车票为例,来简单地说明一下jemalloc与malloc的区别。原来的malloc,相当于只有一个售票窗口的售票大厅, 而jemalloc则在同一个售票大厅里面适量地增加的窗口。当然,火车票的总量(即内存大小)是不变的

Understanding Jeprofile output

倖福魔咒の 提交于 2020-01-30 11:23:57
问题 I was able to generate the Jeprofile output as follows based on the descriptions present here jemalloc post Please find the jemalloc output and the graph. > Using local file /bin/java. Using local file jeprof.57473.0.f.heap. > Total: 79372091 B 78084060 98.4% 98.4% 78084060 98.4% > je_prof_backtrace 1288031 1.6% 100.0% 1474342 1.9% > Java_java_util_zip_ZipFile_getZipMessage > 0 0.0% 100.0% 6889972 8.7% 0x00007f3d5ebac3e6 > 0 0.0% 100.0% 270421 0.3% 0x00007f3d5ebb8a79 > 0 0.0% 100.0% 727762 0

Ruby 2.6.5 with jemalloc

余生长醉 提交于 2020-01-22 02:30:43
问题 I've built and installed rub 2.6.5 from source with jemalloc. However when I check to see if its there I'm not seeing an entry. Is there something else I should have been doing? ubuntu:~$ uname -a Linux ip-10-0-3-198 4.15.0-1032-aws #34-Ubuntu SMP Thu Jan 17 15:18:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux ubuntu:~$ ./configure --enable-shared --with-jemalloc ubuntu:~$ make ubuntu:~$ make install Which results in: ubuntu:~$ ruby -r rbconfig -e "puts RbConfig::CONFIG['LIBS']" -lm Tracking

【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

喜欢而已 提交于 2020-01-11 17:35:41
在安装redis进行编译时候。出错 解决办法: 使用以下命令 make MALLOC=libc 原因分析: 在README 有这个一段话。 Allocator ——— Selecting a non-default memory allocator when building Redis is done by setting the `MALLOC` environment variable. Redis is compiled and linked against libc malloc by default, with the exception of jemalloc being the default on Linux systems. This default was picked because jemalloc has proven to have fewer fragmentation problems than libc malloc. To force compiling against libc malloc, use: % make MALLOC=libc To compile against jemalloc on Mac OS X systems, use: % make MALLOC=jemalloc 说关于分配器allocator,