« Erik Hatcher on... | Main | Software success. »

Roller 0.9.7.5 progress.



I've been working on improving the performance of the Roller persistence tier. I've been doing this work in the old Roller 0.9.7 branch to make it easy for FreeRoller to deploy the improvements. Here are some details on the improvements.

Roller uses an O/R mapping framework persist objects in a relational database. Before the improvements, every call into the Roller persistence layer would open, use, and close a persistence session (either a Hibernate Session or a Castor Database). Roller often makes multiple persistence layer calls to process a web request and, so, Roller would often open, use, and close multiple persistence sessions per web request. A number of people pointed out that this is a bad thing.

To fix this problem, I changed Roller to ensure that each incoming web request gets it's very own persistence session and all persistence layer calls made on behalf of that request use that same persistence session. That means that there is, at most, one persistence session per incoming request. Persistence sessions don't hang around, each one lasts for the duration of one web request only.

These change improved Roller's performance, but not by much. Here are the JMeter test results. As always, comments, suggestions, and criticisms welcome. I think it is interesting that Resin performed better than Tomcat on the baseline test, but not the Roller test (a sign that I screwed something up?).

Update: FreeRoller is deploying these changes now. Even though the performance gains are minimal, I'm hoping the load and the number of MySQL threads will be reduced. I'll be playing with Hibernate caching and the new OSCache beta release tonight to see if they can offer any additional improvements.

Comments:

"Roller often makes multiple persistence layer calls to process a web request and, so, Roller would often open, use, and close multiple persistence sessions per web request." This seems odd. Generally I'd expect Roller to only need a single transaction per a request. And since Roller is such an extremely read-heavy application then it seems like you could gain a lot just by caching most everything. I also wonder if Struts/Reflection could be slowing it down. It was interesting to note from the recent TMC tests that Struts/Reflection can become a bottle neck under high loads.

Posted by Bo on August 04, 2003 at 06:11 AM EDT #

I added test results for the nascient 0.9.8 and for 0.9.7.4 to Roller0975Throughput running on Resin (I've documented the other Test Environment differences). I'm sure the Hibernate numbers can be improved. http://www.rollerweblogger.org/wiki/Wiki.jsp?page=Roller0975Throughput

Posted by Lance on August 05, 2003 at 05:38 PM EDT #

Bo, the parts in question don't use Struts, so that isn't the issue (though the "admin" interface does). It boiled down to our not paying attention to the persistence layers' transactions.

Posted by Lance on August 05, 2003 at 05:39 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« Erik Hatcher on... | Main | Software success. »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Roller, some may be related to this entry.