pseudo-memory leak

For the last few weeks I've been having some problems with House of Fusion. The memory for the JRun.exe has been going through the roof and I didn't know why. The code was tight, nothing had really changed on the site, so what was up? The answer was Yahoo.
In the last 3 weeks Yahoo has ramped up their indexing of sites. For a site as large as House of Fusion, this can take quite a bit of time. I've logged 2-4 yahoo bot hits per second at some times.
So how was yahoo the problem? Because of client variables. Not DB client variables and not even the dreaded registry client variables. Just simple cookie based client variables. It seems that when a client variable is set, a memory structure is also set for CF. Now each bot hit is assumed to be it's own session as it does not accept cookies. This mean each bot hit generates a memory structure of about 1k. Now this is not really a lot, but when you have a few 10's of thousands of hits from bots a day, it adds up.
I'm still waiting on word from Macromedia as to when a client memory structure times out, but this seems to be the issue.

So what's the solution? There are 4.
1. Increase your ram. If you can do this, then ramp up your memory as high as you can. This is not a perfect solution but it saves throwing time at the problem and gives you a 'buffer' against problems of this sort.
2. Set a robots.txt with a Crawl-delay setting. Mine is set to 1 second but you can set yours to something higher
3. set a different cfapplication for the most common bots. I use a simple regular expression to find key words that only exist in bots:
<CFIF REFindNoCase('Slurp|Googlebot|BecomeBot|msnbot|Mediapartners-Google|ZyBorg|RufusBot|EMonitor', cgi.http_user_agent)>
<CFAPPLICATION name="FusionA" clientmanagement="no" sessionmanagement="no" setclientcookies="no" setdomaincookies="no" clientstorage="Cookie">
<CFELSE>
<CFAPPLICATION name="FusionA" clientmanagement="yes" sessionmanagement="no" setclientcookies="yes" setdomaincookies="no" clientstorage="Cookie">
</CFIF>
This will make sure that a client structure is NOT created for one of these bots.
4. Use the same regex to clean out the client structure after the bot finishes the page. Use structclear(client) to remove the data in the onRequestEnd.cfm, the onRequestEnd method of the application.cfc or in the template itself.
Bottom line is that while bots are great for indexing your content, they can cause havoc on your system when a lot of memory is assigned to what is essentially a 'dead session'.

Comments
Bert Dawson's Gravatar Mike

With reference to solution 3, if you change the cfapplication attributes with each request isn't this going to cause problems? One minute the FusionA application uses client management, and the next it doesn't. Aren't these settings application wide? Won't it cause problems if a request starts off with the application set one way, and ends up with it set another?

Cheers
Bert
# Posted By Bert Dawson | 11/29/05 5:46 AM
Michael Dinowitz's Gravatar The only agent types to get the cfapplication without client vars turned on are bots so there's no real change in the session. A bot never has a real session from page to page.
When I make use of a client var, I always check that it exists first so there's no real problem.
# Posted By Michael Dinowitz | 11/29/05 2:00 PM
Alistair Davidson's Gravatar You could also change the application name if it's a bot:

<cfif (it's a bot)>
<cfapplication name="FusionA_ForBots" clientmanagement="no" (etc)>
<cfelse>
<cfapplication name="FusionA" clientmanagement="yes" (etc)>
</cfif>
# Posted By Alistair Davidson | 12/2/05 9:49 AM
Mik Muller's Gravatar Awesome. I've been experiencing the same thing -- Google hitting my server in excess of a million times a day, mixed in with Yahoo and a pinch of MSN and now Bing. Especially in the wee hours... sometimes up to 6 page requests in a second, often times for message pages showing 100+ messages. Ugh.
# Posted By Mik Muller | 8/8/11 10:43 AM
abercrombie and fitch sale's Gravatar abercrombie and fitch uk sale
# Posted By abercrombie and fitch sale | 9/9/11 2:02 AM
abercrombie and fitch outlet's Gravatar abercrombie and fitch outlet uk
# Posted By abercrombie and fitch outlet | 9/9/11 2:03 AM
burberry sale's Gravatar burberry uk sale
# Posted By burberry sale | 9/9/11 2:05 AM
Pandora uk's Gravatar pandora jewelry pandora sale uk thomas sabo barcklets shop buy cheap online oakley sunglasses charmspandora jewelry pandora sale uk thomas sabo barcklets shop buy cheap online oakley sunglasses charmspandora jewelry pandora sale uk thomas sabo barcklets shop buy cheap online oakley sunglasses charms
# Posted By Pandora uk | 9/22/11 3:43 AM
chloe's Gravatar asdlkfa sdjfad
# Posted By chloe | 9/26/11 2:29 AM
christian louboutin's Gravatar christian louboutin
# Posted By christian louboutin | 9/26/11 2:30 AM
ed hardy's Gravatar suibian liaoliao jiju
# Posted By ed hardy | 9/26/11 2:31 AM
ed hardy clothing's Gravatar ed hardy clothing
# Posted By ed hardy clothing | 9/26/11 2:33 AM
polo shirts's Gravatar qing ba wo mai zai zhe chun tian li
# Posted By polo shirts | 9/26/11 2:35 AM
louboutin uk's Gravatar louboutin uk
# Posted By louboutin uk | 9/26/11 2:38 AM
cheap north face's Gravatar Nice Information! I personally really appreciate your article. This is a great website. I

will make sure that I stop back again!.
# Posted By cheap north face | 10/6/11 9:57 AM
abercrombie and fitch uk outlet's Gravatar abercrombie and fitch uk outlet
# Posted By abercrombie and fitch uk outlet | 10/9/11 10:25 AM
tiffany jewellery uk's Gravatar tiffany jewellery uk
# Posted By tiffany jewellery uk | 10/9/11 10:25 AM
thomas sabo uk's Gravatar Because there are many styles of pandora jewellery readily available, there are many hundreds of options that is able to be modified to adjust to could be disposition and additionally temperament. They will possess drops that you can boost with the winter holiday.
# Posted By thomas sabo uk | 10/17/11 3:08 AM
Juicy Couture's Gravatar Couldn’t be composed any better. Reading through this article reminds me of my old room mate! He always kept talking about this. I will send this blog post to him. Very sure he will have a fantastic read. Cheers for discussing!
# Posted By Juicy Couture | 10/17/11 3:54 AM
pandora jewellery's Gravatar Low-priced hair straightners often have heating plates which are metallic, or often glass. Hair is often "positively charged"; which means flowing hair offers mostly "positive" ions. These ions result in the hair follicle to wide open absorbing excess moisture and everything else floating around in the air.
# Posted By pandora jewellery | 10/18/11 4:49 AM
Tim's Gravatar Thankyou
# Posted By Tim | 10/18/11 5:19 AM
abercrombie fitch uk's Gravatar A real lot of useful info here!These are all great comments here. Very cool article.
# Posted By abercrombie fitch uk | 11/18/11 1:11 AM
betty's Gravatar I completely agree with you. I really like this article. It contains a lot of useful information. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all. And of course nice review about the Veterans fight and their present prospect.
# Posted By betty | 12/7/11 1:02 AM
nike jordan shoes's Gravatar mpletely agree with you. I really like this article. It contains a lot of useful information. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all. And of course nice review about the Veterans fight and their present prospect.
# Posted By nike jordan shoes | 12/8/11 3:07 AM
hollister deutschland's Gravatar hollister deutschland
# Posted By hollister deutschland | 12/9/11 10:27 PM
abercrombie fitch uk's Gravatar A real lot of useful info here!These are all great comments here. Very cool article.
# Posted By abercrombie fitch uk | 12/13/11 8:41 PM
abercrombie and fitch's Gravatar This is a great content, I’m so glad that I’ve found this high quality blog!
# Posted By abercrombie and fitch | 12/26/11 2:42 AM
hollister online shop's Gravatar This is a great content, I’m so glad that I’ve found this high quality blog!
# Posted By hollister online shop | 12/26/11 2:52 AM
abercrombie and fitch's Gravatar A real lot of useful info here!These are all great comments here. Very cool article.
# Posted By abercrombie and fitch | 1/3/12 9:49 PM
abercrombie uk's Gravatar This is a great content, I’m so glad that I’ve found this high quality blog!
# Posted By abercrombie uk | 1/12/12 8:55 PM
breitling replica's Gravatar Find a buyer to buy something every time she clicks the "Add to my shopping list"and the program made
# Posted By breitling replica | 1/14/12 10:33 PM
abercrombie and fitch's Gravatar A real lot of useful info here!These are all great comments here. Very cool article.
# Posted By abercrombie and fitch | 1/29/12 10:38 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner
House of Fusion | ColdFusion Jobs @ House of Fusion | Fusion Authority