On Sat, 2010-11-13 at 13:17 +0100, Ralf Hildebrandt wrote:
> * Timo Sirainen <t...@iki.fi>:
> 
> > There's a lot more of IPC going on now. Each process at startup connects
> > to config process to read configuration (vs. reading it from environment
> > variables). State tracking is done in anvil process (vs. master process
> > internally). Logging is via pipes to log process instead of sockets to
> > master process (this should improve performance). Maybe other things I
> > can't think of now.
> 
> Is "dstat --ipc" a suitable to measure/see what's going on?

That looks like it's about sysv IPC, which Dovecot doesn't use. Maybe
some other options would show something useful, I don't know.

Anyway, getting the rusage stats for v1.2 and comparing them to v2.0
might show something useful. Could you patch your v1.2 with the attached
patch and again get one day's stats through logparse.pl? (Need to change
Debug -> Info in its regexp)
diff -r cda53154e222 src/imap/main.c
--- a/src/imap/main.c	Mon Nov 08 19:43:41 2010 +0000
+++ b/src/imap/main.c	Wed Nov 17 17:16:49 2010 +0000
@@ -22,6 +22,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <syslog.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include "time-util.h"
 
 #define IS_STANDALONE() \
         (getenv("IMAPLOGINTAG") == NULL)
@@ -44,6 +47,7 @@
 enum client_workarounds client_workarounds = 0;
 const char *logout_format;
 const char *imap_id_send, *imap_id_log;
+static struct timeval startup_timeval;
 
 static struct io *log_io = NULL;
 static struct module *modules = NULL;
@@ -311,6 +315,7 @@
 		return 1;
 	}
 
+	gettimeofday(&startup_timeval, NULL);
 	/* NOTE: we start rooted, so keep the code minimal until
 	   restrict_access_by_env() is called */
 	lib_init();
@@ -327,6 +332,23 @@
 		io_loop_run(ioloop);
 	main_deinit();
 
+	struct rusage ru;
+	if (getrusage(RUSAGE_SELF, &ru) < 0)
+		i_error("getrusage() failed: %m");
+	else {
+		int diff = timeval_diff_msecs(&ioloop_timeval, &startup_timeval);
+
+		i_info("rusage: real=%d.%d user=%lu.%lu sys=%lu.%lu reclaims=%lu "
+			"faults=%lu swaps=%lu bin=%lu bout=%lu signals=%lu "
+			"volcs=%lu involcs=%lu",
+			diff/1000, diff%1000,
+			(long)ru.ru_utime.tv_sec, (long)ru.ru_utime.tv_usec,
+			(long)ru.ru_stime.tv_sec, (long)ru.ru_stime.tv_usec,
+			ru.ru_minflt, ru.ru_majflt, ru.ru_nswap,
+			ru.ru_inblock, ru.ru_oublock, ru.ru_nsignals,
+			ru.ru_nvcsw, ru.ru_nivcsw);
+	}
+
 	io_loop_destroy(&ioloop);
 	lib_deinit();
 

Reply via email to