Commit 1786ab1a authored by Hardy Simpson's avatar Hardy Simpson

version: 1.0.7

parent 69610666
AC_PREREQ(2.59)
AC_INIT([zlog], [1.0.6], [HardySimpson1984@gmail.com])
AC_INIT([zlog], [1.0.7], [HardySimpson1984@gmail.com])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([libzlog/zlog.h])
AC_CONFIG_HEADER([config.h])
......
......@@ -1483,40 +1483,76 @@ fsync period
\begin_layout Standard
在每条规则写了一定次数的日志到文件后,zlog会调用fsync(3)来让操作系统马上把数据写到硬盘。次数是每条规则单独统计的,并且在zlog_reload()后
会被清0。必须指出的是,在日志文件名是动态生成或者被转档的情况下,zlog不能保证把所有文件都搞定,他只fsync()那个时候刚刚write()的文件描述符。这
提供了写日志速度和数据安全性之间的平衡。例子:
会被清0。必须指出的是,在日志文件名是动态生成或者被转档的情况下,zlog不能保证把所有文件都搞定,zlog只fsync()那个时候刚刚write()的文件描述
符。这提供了写日志速度和数据安全性之间的平衡。例子:
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 10 10000
$ time ./test_press_zlog 1 10 100000
\end_layout
\begin_layout LyX-Code
real 0m0.742s
real 0m1.806s
\end_layout
\begin_layout LyX-Code
user 0m0.770s
user 0m3.060s
\end_layout
\begin_layout LyX-Code
sys 0m0.640s
sys 0m0.270s
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 10 10000 #fsync period = 1K
\end_layout
\begin_layout LyX-Code
$ wc -l press.log
\end_layout
\begin_layout LyX-Code
1000000 press.log
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 1 10 100000 #fsync period = 1K
\end_layout
\begin_layout LyX-Code
real 0m41.995s
\end_layout
\begin_layout LyX-Code
user 0m7.920s
\end_layout
\begin_layout LyX-Code
sys 0m0.990s
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 1 10 100000 #fsync period = 10K
\end_layout
\begin_layout LyX-Code
real 0m4.190s
real 0m6.856s
\end_layout
\begin_layout LyX-Code
user 0m1.080s
user 0m4.360s
\end_layout
\begin_layout LyX-Code
sys 0m1.240s
sys 0m0.550s
\end_layout
\begin_layout Standard
......
......@@ -1616,35 +1616,71 @@ After a number of log times per rule(to file only), zlog will call fsync(3)
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 10 10000
$ time ./test_press_zlog 1 10 100000
\end_layout
\begin_layout LyX-Code
real 0m0.742s
real 0m1.806s
\end_layout
\begin_layout LyX-Code
user 0m0.770s
user 0m3.060s
\end_layout
\begin_layout LyX-Code
sys 0m0.640s
sys 0m0.270s
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 10 10000 #fsync period = 1K
\end_layout
\begin_layout LyX-Code
$ wc -l press.log
\end_layout
\begin_layout LyX-Code
1000000 press.log
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 1 10 100000 #fsync period = 1K
\end_layout
\begin_layout LyX-Code
real 0m41.995s
\end_layout
\begin_layout LyX-Code
user 0m7.920s
\end_layout
\begin_layout LyX-Code
sys 0m0.990s
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
$ time ./test_press_zlog 1 10 100000 #fsync period = 10K
\end_layout
\begin_layout LyX-Code
real 0m4.190s
real 0m6.856s
\end_layout
\begin_layout LyX-Code
user 0m1.080s
user 0m4.360s
\end_layout
\begin_layout LyX-Code
sys 0m1.240s
sys 0m0.550s
\end_layout
\begin_layout Standard
......
......@@ -12,6 +12,17 @@ real 0m0.123s
user 0m0.060s
sys 0m0.130s
-------------------------------------------------
v1.0.7
$ time ./test_press_zlog 1 10 100000
real 0m1.783s
user 0m3.000s
sys 0m0.300s
$ time ./test_press_zlog2 1 10 100000
real 0m1.621s
user 0m2.980s
sys 0m0.120s
-------------------------------------------------
v1.0.6
$ time ./test_press_zlog 1 10 100000
real 0m1.814s
......
[global]
default format = "%d(%F %T.%us) %-6V %p:%t:%F:%L %m%n"
default format = "%d(%F %T.%us) %-6V %p:%T:%F:%L %m%n"
[rules]
*.* "press.log"
[global]
default format = "%d(%F %T.%us) %-6V %p:%t:%F:%L %m%n"
default format = "%d(%F %T.%us) %-6V %p:%T:%F:%L %m%n"
[rules]
cat0.* "press.0.log"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment