Friday, June 12, 2009

Turn off IIS Logging while performance / load testing

I was recently running some performance / load tests when I got a warning from windows that the my test machine's hard drive was running out of space. I was caught off guard since the system capacity is around 148GB, there were less than 4GB of installed programs (including the OS) and now there was only 9.8MB remaining. I ran WinDirStat and found the C:\WINNT\system32\LogFiles\W3SVC1 file had grown dramatically, in fact I had a number of .log files that were 9GB in size. As it turns out IIS logging was enabled and all of the traffic the load generators were sending were being logged over a period of about 18 hours, hence 140GB of log files.

My warning is turn off IIS logging while performance testing. To disable it: Control Panel > Administrative tools > IIS > Web Sites > Right click on Default Web Site > Properties. On the bottom of the initial Web Site tab will be 'Enable logging'. When enabled click Properties > You should see at the bottom of the General tab the log file directory that has exploded in size. Mine was saving to C:\WINNT\system32\LogFiles\W3SVC1 and WS3VC2.

Close the window and uncheck 'Enable logging' to disable it. Restart IIS. Delete all of the log files in the directory since they only contain traffic data. It might be a good idea to defrag your disk if it was at capacity.

No comments: