AVH First Defense Against Spam
[resolved] IP Cache Log speed (4 posts)

  1. chaoix
    Posted 3 years ago #

    The page load of a blog with any kind of traffic with the IP Cache log on is ridiculously slow.

    Personally on my site I had the cache log set to save for 1 day and had around 3,000 entries in the IP Cache and the first time a new visitor went to the site the load time was anywhere from 20-30 seconds.

    You should probably take a look at optimizing your database queries for this. A great solution would be to add an option to only cache spam IPs for those of us who don't use Stop Forum Spam's API, since the amount of spam IPs to keep track will be significantly lower than the ammount of ham IPs.


  2. petervanderdoes
    Plugin Author

    Posted 3 years ago #

    The cache log is indexed on IP, and searched on IP. The query is just that SELECT * from ipcachelog where IP=visitingip;

    If it's just a new visitor, it means the IP isn't in the cache log, and the visiting IP is checked with the 3rd party. It sounds like there is a problem contacting the 3rd parties.

  3. chaoix
    Posted 3 years ago #

    Think about the massive amount of overhead you are creating before page load. The way its written now, every single page load causes a full DB query of 3000 records or more depending on the blog's traffic.

    Might you consider using wordpress's session handling to add a hash or something for ham visitors that skips the IP check?

  4. petervanderdoes
    Plugin Author

    Posted 3 years ago #

    Uhm, massive overhead?

    My cache log is 2791 records.

    If the IP is in the cache, the first time the cache is checked it takes about 0.0004 seconds on my server. The second check takes 0.0001 seconds as MySQL caches the first query.

    The search for an IP not in the database also takes 0.0004 seconds.

    I doubt it's any slower than finding the ID of the post or page that needs to be displayed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • AVH First Defense Against Spam
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.