Comment Re:not cpu bound... disk bound (Score 2, Interesting) 225
One solution I have found for this is to write my own logging application. I write mainly web-based software and AGI stuff, and all my software makes use of the same logging application. Basically what happens is that when I want to write to the log (which is stored in a MySQL database so analysis and viewing the logs is enhanced), the software simply tells the OS to execute the logging utility which can be niced or deprioritised on the system. This way, the software doesn't have to worry about I/O to the log, it doesn't have to wait for MySQL and it can carry on without the hassles involved in rewritting bits of logging code for each project. I have found this works really well for me, and having all the logs for all my code in a central database makes it easy for me to write some nice little AJAX/PHP app to apply filters to the logs or to analyse the logs, whatever I want basically. However, I know this method is not practical for many situations.