Roller 0.9.7 performance tweak.
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.
Posted by Lance on June 04, 2003 at 04:07 PM EDT #