Print Story Slashdotted by favicon.ico
Scoop
By coryking (Wed Feb 15, 2006 at 07:12:45 AM EST) apache, scoop, photographica, your mom (all tags)
Looks like my.yahoo.com now uses your websites favicon.ico on their pages.  Every user who has added your feed to their my.yahoo.com page will see your cute little icon right next to your feed.

This is a problem... 

Inside: fix apache configuration day!

Update [2006-2-15 14:5:48 by coryking]: Fixed!



Well, the thing is, yahoo will directly link to your favicon and not cache a copy locally.  For the incorrectly configured apache server, this is a problem.

What happens is apache will hand the request for favicon over to mod_perl/scoop.  mod_perl/scoop will then create a new session* for every single %$&* person who looks at your favicon.

This means photographica has been slashdotted by favicon.  The site is SLOW as a dog, and it thinks there are thousands of people visiting the website.  There are probably a bagillion new sessions in the database too.

There is a workaround - you can somehow get apache to go "oh, this request is for favicon.ico, lets NOT hand it over to mod_perl and just use the built in request handler".  The thing is, I cant get the regex to work right.

Here is the config in apache, why doesn't this work?

<LocationMatch "^/(robots.txt|favicon.ico|backend.rdf|arsgraphica.rdf|read-comments.js|astrack.js|popup.js|toggle.js)">
SetHandler default-handler
</LocationMatch>

* Yes, new versions of scoop do not create sessions for unauthenticated users.  I had to rip that out because I need a session for the shopping cart.  Even still, the whole mod_perl mess must be invoked for every favicon.ico request and that isn't cool.

Update [2006-2-15 14:5:48 by coryking]: The solution:

<LocationMatch "robots\.txt|favicon\.ico|backend\.rdf|arsgraphica\.rdf|read-comments\.js|astrack\.js|popup\.js|toggle\.js">
SetHandler default-handler
</LocationMatch>

< Putting the fun in fundamental | BBC White season: 'Rivers of Blood' >
Slashdotted by favicon.ico | 13 comments (13 topical, 0 hidden) | Trackback
Your regex is b0rk3d by lb008d (4.00 / 2) #1 Wed Feb 15, 2006 at 08:44:53 AM EST
You want:

"/(robots.txt|favicon.ico|backend.rdf|arsgraphica.rdf|read-comments.js|astrack.js|popup.js|toggle.js)"

And I would escape the dot so it actually means "period" instead of "any character".

still no workie by coryking (2.00 / 0) #2 Wed Feb 15, 2006 at 08:57:05 AM EST
I'm starting to wonder if apache is doing something that routes the request to the mod_perl handler no matter what do.  I even tried the FilesMatch directive with no luck.


-------------
Dog food. Snack for some. Feast for others.

[ Parent ]
Crap. by lb008d (2.00 / 0) #3 Wed Feb 15, 2006 at 09:00:29 AM EST
I thought for sure that would be it - I'm pretty sure the ^ would have caused a failure though. Where is your LocationMatch statement in your conf file?

[ Parent ]
fixed by coryking (2.00 / 0) #4 Wed Feb 15, 2006 at 09:06:22 AM EST
it was the parathesis around the whole mess that was screwing it up.


-------------
Dog food. Snack for some. Feast for others.

[ Parent ]
one parenthesis can't be 'around' anything by tps12 (2.00 / 0) #7 Wed Feb 15, 2006 at 09:31:22 AM EST
ITYM: "it were the parentheses around the whole mess..." HTH.

[ Parent ]
LOL What? by lb008d (2.00 / 0) #9 Wed Feb 15, 2006 at 01:35:54 PM EST
What regex engine are they using?!?!?

[ Parent ]
dunno by coryking (2.00 / 0) #10 Wed Feb 15, 2006 at 03:21:15 PM EST
But taking them out in the apache config cleared the whole mess up.


-------------
Dog food. Snack for some. Feast for others.

[ Parent ]
Weird. by lb008d (2.00 / 0) #11 Wed Feb 15, 2006 at 04:26:50 PM EST
The ^ is gone too correct? Because if it works with that in the regex I'm even more confused.

[ Parent ]
Hm. by lb008d (2.00 / 0) #12 Wed Feb 15, 2006 at 04:34:34 PM EST
According to the example here those parens should have worked.

I'm going to have to try this myself. You're using 1.3 right?

[ Parent ]
indeed by coryking (2.00 / 0) #13 Thu Feb 16, 2006 at 06:19:09 AM EST
here is the final, working lines in the config file:

<LocationMatch "robots.txt|favicon.ico|backend.rdf|arsgraphica.rdf|read-comments.js|astrack.js|popup.js|toggle.js">
SetHandler default-handler
</LocationMatch>


-------------
Dog food. Snack for some. Feast for others.

[ Parent ]
for added humour by coryking (2.00 / 0) #5 Wed Feb 15, 2006 at 09:11:29 AM EST
Here is what happens when you create a new session for each favicon.ico served :-)

mysql> select count() From sessions;
+----------+
| count(
) |
+----------+
|  3315030 |
+----------+



-------------
Dog food. Snack for some. Feast for others.

lastly by coryking (2.00 / 0) #6 Wed Feb 15, 2006 at 09:20:08 AM EST
for those still watching...

Make sure you turn off keepalive.  Every one of those knuckleheads who loaded favicon.ico would hog a whole apache session for like 15 seconds after they requested the image.  Basically, what happened is apache forked and forked until it hit the "MaxConnections" and then wouldn't let anybody in.


-------------
Dog food. Snack for some. Feast for others.

I thought by bobdole (2.00 / 0) #8 Wed Feb 15, 2006 at 12:44:20 PM EST
Apache was supposed to cannibalize the idle sessions before telling people to fob of?
-- The revolution will not be televised.
[ Parent ]
Slashdotted by favicon.ico | 13 comments (13 topical, 0 hidden) | Trackback