Ad Distribution Code Improved

After a 2-hour outage, came up with an idea to redistribute ad from two server, in which one is main server and other is the backup one, checking for the connection to the main server in 2 sec, then 2 sec for verifying the backup server is also online, if after 4 sec there is no server online, the ad distribution code will terminate by returning nothing.

This would help the main script work normally with failure in request for ads.

The precedent code, there was no function for 2 servers, and there was even no time-out for the script execution this led to the fatal error “Execution Time” and the main script could not work either.

2 hours for a new method :( but the server is still so unstable now.

3 Comments

3 Responses to “Ad Distribution Code Improved”

  1. CA RO 08/03/2008 at 21:51 #

    Oh, 1 and found out the runkit PHP extension conflicts with eAccelerator.

    What a bug :| now everything is on its way, server free.fr is a bit sucks, need to find a new one to serve ads better

  2. CA RO 08/03/2008 at 22:01 #

    Last update on this issue:

    Put the function to check server online out of the function serving ads, so for one inclusion, one test would be made, reduce enormously testing time. With this change, third server was added to assure the good execution of the ad-serving function. This third server is ads.link2caro.com

    Somehow, trying to use another server than ads.link2caro, to reduce the work weighing on my server’s shoulders.

  3. CA RO 09/03/2008 at 03:42 #

    Don’t get the same script works on some site and not on some others!!!
    Just add “global $host_test” in the main class, and everything is in order now :(

Leave a Reply