My hosting provider says that the low performance of my website responses are due
by some notice errors in apache logs...

I knew about that errors but i never think that they may slow down the server performance ....

What do u think?

    kante,

    This could very well be a contributing factor, and it should be fixed, as it will help narrow down the issue.

    PHP can be configured for various log levels, for instance, if they/you (depending on what they let you do with PHP) log notices, that can slow down the performance as PHP has to open a log file, append the notice, and continue.

    Generally speaking however, good programming practices state you should fix those notices, especially since majority of them can be quite easily fixed.

    Fix undefined indexes (certainly most common notice that I've seen) - this is easy as defining a variable before use, which is good practice and required in many other languages, as well as checking if the variable has been initialized with isset().

    All that being said, unless you are getting a large amount of traffic I personally don't believe that this would make a large difference, however my sites are run either on my own VPS, or my work ones are on dedicated servers, so it's difficult to say, I've always blamed the shared hosting provider.

    I would fix up all of those notices, then you can accurately measure the performance of the site.

    You can do this by:

    Finding out your current IP address (there are many sites out there to confirm just that)

    Then add this to a common file:

    $ipAddress = '12.21.12.21'; // Insert your own IP address here
    if ($_SERVER['REMOTE_ADDR'] == $ipAddress) {
      error_reporting(E_ALL); // Display ALL errors including notices
      ini_set('display_errors',1);   // make sure they're displayed
    }
    

    This will ensure that only you (hopefully, unless its in an office) will see the errors & notices.

    Once everything has been fixed and performance is still poor, you can go back to your host.

    I hope this helps..

      Write a Reply...