Friday, January 8, 2010

Improving Performance with Persistent JobStores










Improving Performance with Persistent JobStores


Performance is one topic that receives the most attention when there's the least amount of time to do anything about it. As experienced developers, we know that it should be a consideration from the onset of the project.


When using Quartz with persistent JobStores, the biggest area of concern has to be the interaction with the relational database. Database I/O (just like file I/O) is usually not very fast. You can improve performance by doing things such as tuning the SQL, adding indexes, and manipulating tables and columns. Because performance concerns were already taken into account in the writing of Quartz, you don't want to dive right into doing these things to Quartz without having an actual performance problem, trying to solve it through a configuration setting, and trying everything possible not to manipulate source code. The good news is that Quartz is open source and you have complete insight into what it's doing and how it's doing it. If you don't like how it queries the database, it's your prerogative to fix it. Before you take this route, however, be sure to check with the users and developers on the Quartz forum to see if others have had the problem and explore the recommended suggestions.


One very easy (and very effective) way to improve performance is to make sure the tables have indexes created on all the appropriate columns. Some of the database-creation scripts that ship with Quartz already have the commands for creating indexes. If yours does not, you can simply refer to those defined at the bottom of tables_oracle.sql and translate any syntax changes that are necessary for your RDBMs.


Whatever you do, if you make changes that improve performance, be sure to offer them back to the community and the Quartz project.












No comments: