When FreeRoller was attacked the other day, the system slowed to a crawl. I assumed that the problems were my fault and I started to look for performance problems. I noticed that we are running the RequestFilter, which is responsible for parsing the URL and handling request parameters, for every incoming request. The RequestFilter also hits the database to determine if the requested page and user are valid. Since many requests are for simple files, such as GIFs, JPGs, and CSS, this is not wise. So, I changed the Roller web.xml. I replaced this, which causes every request to go through the RequestFilter:
<filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
With this, which only puts page, rss, comments, *.do, and *.jsp through the ringer:
<filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>/page/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>/rss/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>/comments/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>RequestFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping>
This seemed to have a significant effect on FreeRoller performance and on the MySQL load. I'm still looking at some Java code changes to optimize RequestFilter and RollerRequest, but the above change is easy to apply, so if you are running Roller 0.9.7 (or later), give it a try.
This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)
This is a personal weblog, I do not speak for my employer.

Buy now from Amazon.com
Or direct from Manning
| « December 2008 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | |||
| Today | ||||||
Allen Gilliland
Anil Gangolli
Dan Axon
Danese Cooper
Film Babble Blog
Geertjan's Weblog
Henri Yandell
James Robertson
Jim Grisanzio
Josh Staiger
Linda Skrocki
Pat Chanezon
Rama
Ruby Sinreich
Simon Phipps
Tim Bray
Will Snow
Janne Jalkanen
Joe Gregorio
Matt Raible
Mike Cannon Brookes
Rafe Colburn
Sam Ruby
Simon Brown
My other sites
Posted by Lance on June 04, 2003 at 01:07 PM EDT #