This is a list of tips and tricks that we're compiling that people have used successfully in their JasperReports® Server projects. Some entries in this list are links to other pages rather than having the entire text in-line. Eventually, these entries will wind up on their own page as well.
Please add any other bits that you've used as an in-line entry or as a link to a separate page.
Measure and Test
Domain Security
Ad Hoc
Tomcat
Move static content to a web server. Some customers have reported up to 20% improvement in response time.
Disable automatic deployment on production servers using Tomcat
Data Source Connections
Prefer JNDI datasources to JDBC datasources
One potential bottleneck is a datasource that doesn't offer a connection pool. This is why we recommend using JNDI, which allows you to configure an entire connection pool that resides within the container.
A JNDI data source calls the JNDI (Java Naming and Directory Interface) service of the application server to locate a database connection. The application server manages the connections to the database and shares them between all applications that it hosts. The configuration of the application server determines the number of connections that are shared. Note that the application server connects to the database using JDBC, meaning that JNDI data sources return results in the same format as JDBC data sources.
Documentation
In Tomcat, tuning the JNDI datasource involves modifying the values for the maxIdle and maxActive attributes. For more information, see How to Tune the number of connections in the server database pool, which gives examples of configuring a connection pool.
Database
Index columns in the database to speed up domain-based reports
Set the fetch size in the jasperreports.properties file to modify the number of rows to fetch
JasperReports Configuration Items
Memory Management with JasperReports and JasperReports Server
Modify the jasperreports.properties file to disable multi-line data processing
Auditing config
- Check and veriify that jprint size calculations are turned off. This incurs a major performance hit to both memory and cpu.
The file is located at /WEB-INF/js.config.properties.
#enable recording of print object memory size
audit.sizeof.enabled=false
File system issues
Although it doesn't happen very often, sometimes the filesystem on which JasperReports Server is running needs some tuning. Some common issues that may occur are:
File System Full
On Linux-based systems, you can check the filesystem size and its usage by using the command below, which gives you a report on the filesystem usage.
$ df -k
Swap Space
If there is no swap space defined for a system, or if there's not enough, then the system will often seem to using all its memory even if the CPU % usage is low. This is because it's unable to idle processes by using swap space (essentially writing their state to disk, for quick retrieval when another process needs it). Swap space gets defined as a fraction of available RAM; some people prefer 50% of RAM for large systems, others 200% of RAM. Remember that this is disk space and not additional RAM.
You can use this command on Linux to check the swap space:
$ free
Continue with Performance Topics:
Resources
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now