• 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

Mike Tougeron

Well-known member
#1
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
 

pegasus

Well-known member
#3
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).
 

Mike Tougeron

Well-known member
#4
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).
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.