Redis服务器不能运行超过1024M的maxheap [英] Redis server can't run more than 1024M maxheap

查看:543
本文介绍了Redis服务器不能运行超过1024M的maxheap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows Server 2008上运行Redis 2.8.19. 我收到一条错误消息,说我的Redis堆没有足够的磁盘空间. (内存映射文件而不是fork().)

I am running Redis 2.8.19 on Windows Server 2008. I get an error saying that I have insufficient disc space for my Redis heap. (The memory mapping file instead of fork()).

即使cfg中具有"maxheap 1024M",即使我将"heapdir"设置为该目录上有约50GB的可用空间,我也只能运行Redis.

I can only get Redis running, if I have 'maxheap 1024M' in the cfg, even though I have ~50GB of free space on the directory I have set 'heapdir' to.

如果我尝试以更高的maxheap或没有maxheap的方式运行它,则会出现此错误(PowerShell):

If I try to run it with higher maxheap, or with no maxheap, I get this error (PowerShell):

PS C:\ Users \ admasgve> CD D:\ redis-2.8.19

PS C:\Users\admasgve> cd D:\redis-2.8.19

PS D:\ redis-2.8.19>.\ redis-server.exe

PS D:\redis-2.8.19> .\redis-server.exe

[7476] 2月25日09:32:38.419# Windows版本的Redis会分配一个较大的内存映射文件以进行共享 具有持久性操作中使用的分叉进程的堆.这个文件 将在当前工作目录或由以下目录指定的目录中创建 .conf文件中的"heapdir"指令. Windows报告存在 此文件没有足够的磁盘空间(Windows错误0x70).

[7476] 25 Feb 09:32:38.419 # The Windows version of Redis allocates a large memory mapped file for sharing the heap with the forked process used in persistence operations. This file will be created in the current working directory or the directory specified by the 'heapdir' directive in the .conf file. Windows is reporting that there is insufficient disk space available for this file (Windows error 0x70).

您可以通过以下方法减小Redis堆的大小来解决此问题: --maxheap标志,或通过将堆文件移动到具有足够空间的本地驱动器 空间. 请参阅二进制发行版随附的文档以了解更多信息 有关--maxheap和--heapdir标志的详细信息.

You may fix this problem by either reducing the size of the Redis heap with the --maxheap flag, or by moving the heap file to a local drive with sufficient space. Please see the documentation included with the binary distributions for more details on the --maxheap and --heapdir flags.

Redis无法继续.退出.

Redis can not continue. Exiting.

截屏: http://i.stack.imgur.com/Xae0f.jpg

  • D上的可用空间:49,4 GB
  • C上的可用空间:2,71 GB
  • 总RAM:16 GB
  • 可用RAM:〜9 GB

redis.windows.conf:

redis.windows.conf:

# Generated by CONFIG REWRITE
loglevel verbose
logfile "stdout"
save 900 1
save 300 10
save 60 10000
dir "D:\\redis-2.8.19"
maxmemory 1024M
# maxheap 2048M
heapdir "D:\\redis-2.8.19"

redis会使用'CONFIG REWRITE'cmd生成最后3行旁边的所有内容.我用maxmemory,maxheap和heapdir尝试了各种方法.

Everything beside the last 3 lines are generated by redis with the 'CONFIG REWRITE' cmd. I have tried various things, with maxmemory, maxheap and heapdir.

来自Redis文档:

maxmemory/maxheap-maxheap标志控制此内存映射文件的最大大小,以及Redis堆的总可用空间.在没有maxheap或maxmemory的情况下运行Redis将导致创建与物理内存大小相等的内存映射文件. Redis堆必须大于maxmemory指定的值

maxmemory / maxheap - the maxheap flag controls the maximum size of this memory mapped file, as well as the total usable space for the Redis heap. Running Redis without either maxheap or maxmemory will result in a memory mapped file being created that is equal to the size of physical memory; The Redis heap must be larger than the value specified by the maxmemory

以前有人遇到过这个问题吗?我该怎么办?

Have anybody encountered this problem before? What do I do wrong?

推荐答案

这是使用maxheap标志的方法,它比使用配置文件更方便:

This is how to use the maxheap flag, which is more convenient then using a config file:

redis-server --maxheap 2gb

这篇关于Redis服务器不能运行超过1024M的maxheap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆