View Full Version : Error reporting slowing down script

01-08-2010, 12:46 PM

I have a script that i have running on my server that is doing some quite heavy mysql work. If i turn error logging on the script takes forever to run. Far too long to wait for any user. If however I disable error logging then the script runs quicker. Fast enough for the user to wait. It's strange because if i sit and look at the error log while the script runs no error are reported. There are no errors so why would error logging cause the script to run so slow when its not even writing anything to the log?

It's annoying because i therefore can't leave error logging on. I will have to turn it on whenever i need to debug and turn it back off after finished debugging. Not ideal. :(

01-09-2010, 04:15 AM
What is the nature of the "error logging" that you are doing? Are you opening up a lot of streams or resources to perform this logging?

01-11-2010, 12:15 PM
How can i find that out?
All i know is in php ini i have the following set

error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
error_log = /var/log/httpd/php_errors.log

The idea being all errors are logged in php_errors.log. I can see that errors are being logged from other sites fine. I'm not getting any however from the script and its still having a massive affect on performance.

How can i check if I am opening up a lot of streams or resources to perform this logging?

01-11-2010, 02:51 PM
For the time being i have just turned


And the site seems to perform ok for now, that way i can still test things on the server for other sites and can just comment out the code if i need to test for this site. Still would be nice to know why error logging is using up so much resource?