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

@ -498,10 +498,12 @@ werr:
int rdbSaveBackground(char *filename) {
pid_t childpid;
long long start;
if (server.bgsavechildpid != -1) return REDIS_ERR;
if (server.vm_enabled) waitEmptyIOJobsQueue();
server.dirty_before_bgsave = server.dirty;
start = ustime();
if ((childpid = fork()) == 0) {
/* Child */
if (server.vm_enabled) vmReopenSwapFile();
@ -514,6 +516,7 @@ int rdbSaveBackground(char *filename) {
}
} else {
/* Parent */
server.stat_fork_time = ustime()-start;
if (childpid == -1) {
redisLog(REDIS_WARNING,"Can't save in background: fork: %s",
strerror(errno));