Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
redis
提交
f52ce3c2
R
redis
项目概览
别团等shy哥发育
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f52ce3c2
编写于
7月 29, 2014
作者:
J
jonathan pickett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added heapdir directive to allow for configuration of where QFork memory mapped file lives
上级
c6c93699
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
10 deletion
+54
-10
bin/release/redis-2.8.12.zip
bin/release/redis-2.8.12.zip
+0
-0
msvs/setups/documentation/redis.windows.conf
msvs/setups/documentation/redis.windows.conf
+14
-1
src/Win32_Interop/Win32_CommandLine.cpp
src/Win32_Interop/Win32_CommandLine.cpp
+1
-0
src/Win32_Interop/Win32_CommandLine.h
src/Win32_Interop/Win32_CommandLine.h
+1
-0
src/Win32_Interop/Win32_QFork.cpp
src/Win32_Interop/Win32_QFork.cpp
+35
-8
src/config.c
src/config.c
+3
-1
未找到文件。
bin/release/redis-2.8.12.zip
浏览文件 @
f52ce3c2
无法预览此类型文件
msvs/setups/documentation/redis.windows.conf
浏览文件 @
f52ce3c2
...
@@ -289,7 +289,9 @@ slave-priority 100
...
@@ -289,7 +289,9 @@ slave-priority 100
# be shared with a child process.
# be shared with a child process.
#
#
# *** There must be disk space available for this file in order for Redis
# *** There must be disk space available for this file in order for Redis
# to launch. ***
# to launch. *** The default configuration places this file in the local
# appdata directory. If you wish to move this file to another local disk,
# use the heapdir flag as described below.
#
#
# The maxheap flag controls the maximum size of this memory mapped file,
# 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
# as well as the total usable space for the Redis heap. Running Redis
...
@@ -314,6 +316,17 @@ slave-priority 100
...
@@ -314,6 +316,17 @@ slave-priority 100
#
#
# maxheap <bytes>
# maxheap <bytes>
# The heap memory mapped file must reside on a local path for heap sharing
# between processes to work. A UNC path will not suffice here. For maximum
# performance this should be located on the fastest local drive available.
# This value defaults to the local application data folder(e.g.,
# "%USERPROFILE%\AppData\Local"). Since this file can be very large, you
# may wish to place this on a drive other than the one the operating system
# is installed on.
#
# Note that you must specify a directory here, not a file name.
# heapdir <directory path(absolute or relative)>
# Don't use more memory than the specified amount of bytes.
# Don't use more memory than the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys
# When the memory limit is reached Redis will try to remove keys
# accordingly to the eviction policy selected (see maxmemmory-policy).
# accordingly to the eviction policy selected (see maxmemmory-policy).
...
...
src/Win32_Interop/Win32_CommandLine.cpp
浏览文件 @
f52ce3c2
...
@@ -353,6 +353,7 @@ static RedisParamterMapper g_redisArgMap =
...
@@ -353,6 +353,7 @@ static RedisParamterMapper g_redisArgMap =
// QFork flags
// QFork flags
{
cQFork
,
&
fp2
},
// qfork [QForkConrolMemoryMap handle] [parent process id]
{
cQFork
,
&
fp2
},
// qfork [QForkConrolMemoryMap handle] [parent process id]
{
cMaxHeap
,
&
fp1
},
// maxheap [number]
{
cMaxHeap
,
&
fp1
},
// maxheap [number]
{
cHeapDir
,
&
fp1
},
// heapdir [path]
// service commands
// service commands
{
cServiceName
,
&
fp1
},
// service-name [name]
{
cServiceName
,
&
fp1
},
// service-name [name]
...
...
src/Win32_Interop/Win32_CommandLine.h
浏览文件 @
f52ce3c2
...
@@ -51,6 +51,7 @@ const string cSyslogIdent= "syslog-ident";
...
@@ -51,6 +51,7 @@ const string cSyslogIdent= "syslog-ident";
const
string
cLogfile
=
"logfile"
;
const
string
cLogfile
=
"logfile"
;
const
string
cInclude
=
"include"
;
const
string
cInclude
=
"include"
;
const
string
cDir
=
"dir"
;
const
string
cDir
=
"dir"
;
const
string
cHeapDir
=
"heapdir"
;
const
string
cMaxHeap
=
"maxheap"
;
const
string
cMaxHeap
=
"maxheap"
;
const
string
cMaxMemory
=
"maxmemory"
;
const
string
cMaxMemory
=
"maxmemory"
;
...
...
src/Win32_Interop/Win32_QFork.cpp
浏览文件 @
f52ce3c2
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
#include <stdio.h>
#include <stdio.h>
#include <wchar.h>
#include <wchar.h>
#include <Psapi.h>
#include <Psapi.h>
#include <ShlObj.h>
#include <Shlwapi.h>
#define QFORK_MAIN_IMPL
#define QFORK_MAIN_IMPL
#include "Win32_QFork.h"
#include "Win32_QFork.h"
...
@@ -332,16 +334,41 @@ BOOL QForkSlaveInit(HANDLE QForkConrolMemoryMapHandle, DWORD ParentProcessID) {
...
@@ -332,16 +334,41 @@ BOOL QForkSlaveInit(HANDLE QForkConrolMemoryMapHandle, DWORD ParentProcessID) {
return
FALSE
;
return
FALSE
;
}
}
string
g_MMFDir
;
string
GetWorkingDirectory
()
{
string
GetWorkingDirectory
()
{
string
workingDir
=
".
\\
"
;
if
(
g_MMFDir
.
length
()
==
0
)
{
if
(
g_argMap
.
find
(
cDir
)
!=
g_argMap
.
end
())
{
char
defaultDir
[
_MAX_PATH
];
workingDir
=
g_argMap
[
cDir
][
0
][
0
];
HRESULT
hr
;
}
if
(
S_OK
!=
(
hr
=
SHGetFolderPathA
(
NULL
,
CSIDL_LOCAL_APPDATA
,
NULL
,
SHGFP_TYPE_CURRENT
,
defaultDir
)))
{
std
::
replace
(
workingDir
.
begin
(),
workingDir
.
end
(),
'/'
,
'\\'
);
throw
std
::
system_error
(
hr
,
system_category
(),
"SHGetFolderPathA failed"
);
if
(
workingDir
.
at
(
workingDir
.
length
()
-
1
)
!=
'\\'
)
{
}
workingDir
=
workingDir
.
append
(
"
\\
"
);
string
workingDir
=
defaultDir
;
if
(
g_argMap
.
find
(
cHeapDir
)
!=
g_argMap
.
end
())
{
workingDir
=
g_argMap
[
cHeapDir
][
0
][
0
];
std
::
replace
(
workingDir
.
begin
(),
workingDir
.
end
(),
'/'
,
'\\'
);
if
(
PathIsRelativeA
(
workingDir
.
c_str
()))
{
char
cwd
[
MAX_PATH
];
if
(
0
==
::
GetCurrentDirectoryA
(
MAX_PATH
,
cwd
))
{
throw
std
::
system_error
(
GetLastError
(),
system_category
(),
"GetCurrentDirectoryA failed"
);
}
char
fullPath
[
_MAX_PATH
];
if
(
NULL
==
PathCombineA
(
fullPath
,
cwd
,
workingDir
.
c_str
()))
{
throw
std
::
system_error
(
GetLastError
(),
system_category
(),
"PathCombineA failed"
);
}
workingDir
=
fullPath
;
}
}
if
(
workingDir
.
at
(
workingDir
.
length
()
-
1
)
!=
'\\'
)
{
workingDir
=
workingDir
.
append
(
"
\\
"
);
}
g_MMFDir
=
workingDir
;
}
}
return
workingDir
;
return
g_MMFDir
;
}
}
BOOL
QForkMasterInit
(
__int64
maxheapBytes
)
{
BOOL
QForkMasterInit
(
__int64
maxheapBytes
)
{
...
...
src/config.c
浏览文件 @
f52ce3c2
...
@@ -522,7 +522,9 @@ void loadServerConfigFromString(char *config) {
...
@@ -522,7 +522,9 @@ void loadServerConfigFromString(char *config) {
#ifdef _WIN32
#ifdef _WIN32
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"maxheap"
))
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"maxheap"
))
{
// ignore. This is taken care of in the qfork code.
// ignore. This is taken care of in the qfork code.
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"service-name"
))
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"heapdir"
))
{
// ignore. This is taken care of in the qfork code.
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"service-name"
))
{
// ignore. This is taken care of in the win32_service code.
// ignore. This is taken care of in the win32_service code.
#endif
#endif
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录