Banned IP query run several times?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
sweeperq
Commodore (COMO)
Commodore (COMO)
Posts: 497
Joined: Tue Jan 03, 2006 2:45 pm

Banned IP query run several times?

Post by sweeperq » Tue Nov 25, 2014 12:50 pm

I was just running a SQL Profiler to see what queries were being executed on the Category page. I was surprised to see the following executed 20+ times:

Code: Select all

SELECT COUNT(*) AS RangeCount FROM ac_BannedIPs WHERE StoreId = @storeId AND IPRangeStart <= @ipNumber AND IPRangeEnd >= @ipNumber
I can understand it running once or twice, but 20+ times? Any idea what is causing this and if there is any way to reduce the number of calls? Our banned IP list isn't huge, but it grows with every day when fraudulent international orders are placed.

Thankfully the code I was concerned about only issued 1 query ;)

sweeperq
Commodore (COMO)
Commodore (COMO)
Posts: 497
Joined: Tue Jan 03, 2006 2:45 pm

Re: Banned IP query run several times?

Post by sweeperq » Wed Jun 17, 2015 5:12 am

I was unable to figure this out. I tried searching for the query in the website code and in the CommerceBuilder source code, but it turned up nothing. So I'm guessing it is firing from within a CommerceBuilder class where the source code is not provided. Here is a screenshot that shows what I'm talking about:

Image

Any idea what is going on here or how I can get it to stop issuing multiple queries?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Banned IP query run several times?

Post by jmestep » Thu Jun 18, 2015 12:23 am

Are there multiple users active on the site at that time? It could be running the query for each one because it has to check to see if each user's ip is banned.
Able- banned ips might be something you could add into second level cache (like you do groups, currency)since it is checked so frequently but is usually a small piece of data.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Banned IP query run several times?

Post by Katie » Thu Jun 18, 2015 5:28 am

This issue was already discovered by one of our developers and it has been fixed for the next release. We will be caching this information for 30 minutes now.

However, there will be some drawbacks. For example, let's say after 5 minutes a webmaster finds out that there is a rouge bot and he updates the IP firewall. In this case, his updates won't be effective for the next 25 minutes since we don't have any way to expire the cached results. I know this is a rare case and there are other ways of banning IP's outside of AbleCommerce, so we decided that it was still an improvement.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Post Reply