djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Logging causes massive IO, even if disabled. #293

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set log level to WARNING or less
2. strace -p <redis pid>
3. Watch all the system calls to the log file

Just check the source here: 
http://github.com/antirez/redis/blob/master/src/redis.c#L186
The file pointer will be opened, even if no logging takes place. The log level 
should be checked *before* any files are opened or closed. Otherwise on each 
call to redisLog() at least two not requried system calls are issued. This 
lowers the performance of initial append only file loading on redis start 
dramatically.

Original issue reported on code.google.com by marcel.oelke on 22 Jul 2010 at 8:50

GoogleCodeExporter commented 8 years ago
Fixed, please can you verify?

The fix is both in master and 2.0.0 branch

Original comment by anti...@gmail.com on 23 Jul 2010 at 9:11