Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts

    Angry Error reporting slowing down script

    Hi,

    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.
    You can not say you know how to do something, until you can teach it to someone else.

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,769
    Thanks
    19
    Thanked 155 Times in 146 Posts
    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?
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    How can i find that out?
    All i know is in php ini i have the following set

    Code:
    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?
    You can not say you know how to do something, until you can teach it to someone else.

  • #4
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    For the time being i have just turned

    PHP Code:
    error_reporting(0); 
    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?
    You can not say you know how to do something, until you can teach it to someone else.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •