mirror of
https://github.com/fluencelabs/redis
synced 2025-06-15 02:01:21 +00:00
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:
@ -482,6 +482,7 @@ werr:
|
||||
|
||||
int rdbSaveBackground(char *filename) {
|
||||
pid_t childpid;
|
||||
long long start;
|
||||
|
||||
if (server.bgsavechildpid != -1 ||
|
||||
server.bgsavethread != (pthread_t) -1) return REDIS_ERR;
|
||||
@ -493,6 +494,7 @@ int rdbSaveBackground(char *filename) {
|
||||
return dsRdbSaveBackground(filename);
|
||||
}
|
||||
|
||||
start = ustime();
|
||||
if ((childpid = fork()) == 0) {
|
||||
int retval;
|
||||
|
||||
@ -503,6 +505,7 @@ int rdbSaveBackground(char *filename) {
|
||||
_exit((retval == REDIS_OK) ? 0 : 1);
|
||||
} else {
|
||||
/* Parent */
|
||||
server.stat_fork_time = ustime()-start;
|
||||
if (childpid == -1) {
|
||||
redisLog(REDIS_WARNING,"Can't save in background: fork: %s",
|
||||
strerror(errno));
|
||||
|
Reference in New Issue
Block a user