1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed [performance] Performance degrades with *large* discouraged IP list

Discussion in 'Resolved Bug Reports' started by Mike Tougeron, Feb 12, 2012.

  1. Mike Tougeron

    Mike Tougeron Well-Known Member

    I tried loading a several thousand IP addresses (tor exit nodes, known anon proxies, etc) into the discouraged IP list and I saw a small, but at high load significant, decrease in page performance.

    Since a session is created for both anonymous and logged in users there should be a flag set into the session that an IP address has already been checked for being discouraged or not. Users who are not trying to exploit the system will most likely have cookies enabled, and therefor a stable session, and will then not have any performance hit to check for a discouraged IP.

    As a side note, it would be nice to have a code hook for XenForo_ControllerPublic_Abstract::_isDiscouraged() and XenForo_ControllerPublic_Abstract::_discourage() so that we can extend & add our own discouragement behavior without having to fork the core file. e.g., when a user is discouraged I want newrelic to ignore the transaction.

    Thanks, Mike
    Eagle, 0xym0r0n, Insy and 7 others like this.
  2. Mike Tougeron

    Mike Tougeron Well-Known Member

    BTW, this should also probably apply to the XenForo_ControllerPublic_Abstract::_assertIpNotBanned() method as well.
  3. pegasus

    pegasus Well-Known Member

    If that's what you're implying, I don't think a cookie should be set regarding the discouraged/banned checks, as those can be manipulated. The flags should be entirely internal in XenForo (e.g. database).
  4. Mike Tougeron

    Mike Tougeron Well-Known Member

    It's set to the session not its own cookie. The session information is stored in either memcached or the database depending on your configuration.
  5. Mike

    Mike XenForo Developer Staff Member

    I've now done the result caching in the session for discouragement and IP bans.
    Eagle, Slavik and lazy llama like this.
  6. Mike Tougeron

    Mike Tougeron Well-Known Member

    Great, thank you!

Share This Page