wilderness - 11:21 am on Aug 30, 2013 (gmt 0)
approx 40K IP ranges[
Is this 40k in ranges or 40k in file size?
If 40k in ranges than you have the IP tables complied incorrectly (at least in regards to IP ranges).
I have nearly every country outside of the US & Canada denied (as well as other ranges (and custom solutions) within those boundaries), and Data Centers within same boundaries and I don't have 40k in the lines of my htaccess and/or IP ranges.
The main worry is the upper limit of IP ranges for iptables before it starts impacting the server performance.
Your concern for server performance are primarily related to how and with what method the rest of your site (s) functions on (PHP, MySQL, Java, etc.)