INFO now contains the time (in usecs) needed to fork() in order to persist. The info is available in the stats section of INFO.

This commit is contained in:
antirez
2011-05-29 15:17:29 +02:00
parent 32463852be
commit 27c8f84c66
5 changed files with 12 additions and 1 deletions

View File

@ -589,13 +589,15 @@ werr:
*/
int rewriteAppendOnlyFileBackground(void) {
pid_t childpid;
long long start;
if (server.bgrewritechildpid != -1) return REDIS_ERR;
if (server.vm_enabled) waitEmptyIOJobsQueue();
start = ustime();
if ((childpid = fork()) == 0) {
/* Child */
char tmpfile[256];
/* Child */
if (server.vm_enabled) vmReopenSwapFile();
if (server.ipfd > 0) close(server.ipfd);
if (server.sofd > 0) close(server.sofd);
@ -607,6 +609,7 @@ int rewriteAppendOnlyFileBackground(void) {
}
} else {
/* Parent */
server.stat_fork_time = ustime()-start;
if (childpid == -1) {
redisLog(REDIS_WARNING,
"Can't rewrite append only file in background: fork: %s",