WordPress.org

Ready to get started?Download WordPress

Forums

Server load and unused display functions (1 post)

  1. cycad
    Member
    Posted 5 years ago #

    I just updated http://www.oldies.org.uk/ to WordPress 2.7

    With our previous 2.1 install we had had intermittent server load problems which occasionally resulted in too many Mysql connections errors. The site gets around 1200 visits a day, so it is fairly busy.

    Looking through the logfiles, I noticed that some problems seemed to be down to requests for displays of data that we don't actually link to or encourage human users to use.

    Specifically, we had large numbers of requests coming in for urls similar to /?paged=1
    and /?m=200601

    Sometimes we would get a batch of requests for all the available month archive addresses, or every post on the site displayed paged, within a minute or two. As the site has around 2500 public posts, this produced a considerable load, and as neither ?m= or ?paged= is linked to within the site, it was pretty clear this must be some annoying bot tearing up our server resources (there were no identifiable useragents, unfortunately, and the IPs kept shifting).

    When I moved the site to 2.7, a priority was eliminating this problem. I've not been able to find anything designed for the task, so to see if it helped, I have put this in on /index.php to stop these unwanted URLS from doing anything at all:

    /* Kill the archive list functionality */
    if (strpos($_SERVER['REQUEST_URI'],"?m="))
    {echo "Sorry, we no longer provide monthly archives.  Please navigate from our <a href='http://www.oldies.org.uk/'>home page</a>.";
    exit;
    }
    
    /* Kill the ability to show everything paged functionality */
    if (strpos($_SERVER['REQUEST_URI'],"?paged="))
    {echo "Sorry, we no longer provide the ability to view all records in this way.  Please navigate from our <a href='http://www.oldies.org.uk/'>home page</a>.";
    exit;
    }

    I suspect there may be a better way of doing that, anyone want to suggest one? Everything else is done properly via themes or plugins, but I couldnt' work out how to do this in that way.

    I also installed the WP Super Cache plugin, which I am hoping will also help: many thanks to the creators of that plugin.

    Hoping this may help someone else suffering similar server load issues too.

Topic Closed

This topic has been closed to new replies.

About this Topic