TIBCO JasperReports® Server Performance Tips

Disclaimer

These tips are not applicable to every scenario and are not the official stated position of TIBCO Jaspersoft - proceed with care.

Virtualizer Settings

By default we use the File virtualizer, com.jaspersoft.jasperserver.api.engine.common.service.impl.FileVirtualizerFactory, when you expect a lot of concurrency we recommend the Shared virtualizer, com.jaspersoft.jasperserver.api.engine.common.service.impl.SharedVirtualizerStoreFactory.

For report execution the File Virtualizer will limit the number of pages stored in the RAM to the default value defined in WEB-INF/applicationContext.xml. By default this is 300.

The Shared Virtualizer limits the number of pages stored in RAM regardless of the number of concurrent reports executed. This means that if you define a limit of 1000, the maximum number of pages in the RAM memory of the server at all time will be 1000. Any additional page will be stored in the swap file (on the disk).

By default the maximum number of pages is set to 5000.

Using the Share Virtualizer is more robust than the FileVirtualizer in a concurrent report generation scenario.

You can see the Virtualizer Beans in the v6.0 WEB-INF/applicationContext.xml

The performance will be greater if you avoid swapping so I recommend that you set the maxSize of the shared Virtualizer as high as possible depending on your RAM allocation (see next chapter: Memory.


Memory

Heap Size

We typically recommend a minimum of 8GB for any production environment. They are many use cases where you will need to increase this amount and sometimes significantly. In a high concurrency environment or when you need to produce large reports for example you will need to give much memory than that. 

We recommend that you test how concurrency impacts your memory. There are many tool that can be used for it, we like JMeter. See the Wiki Article: Performance Testing with JMeter

Additionally we recommend that you equalize the XMS (initial memory allocation) and the XMX (maximum memory allocation) in a production environment to avoid the JVM to pause during memory re-allocation.

This also means that you should run only JasperReports Server on your instance of Tomcat so there is no need to share the memory.

Additional information to change memory settings can be found in the JasperReports Server Install Guide, Chapter 6, JVM Options, License Setup, Manual Database Creation.

Permgen

We typically recommend allocating 384m. You will need more if you use Ad Hoc or Dashboard designer a lot.

For the same reason as Heap, we recommend that you equalize initial and maximum memory


Diagnostics & Monitoring System

Jaspersoft exposes some diagnostics and monitoring options through JMX which can be used from any monitoring system - see the tech talk about the subject . The diagnostic system must be enabled first, this is documented in Chapter 9 of the JasperReports Server Admin Guide. Once enabled it is recommended to monitor some beans like:

  • RunningReportsCount (jobs ran via UI)

  • RunningAsyncReportsActiveTaskCount (jobs ran via API)

  • RunningJobsCount (scheduled jobs)

  • LoggedInUsersCount (number of users currently logged in)

  • JvmHeapMemory

  • JvmNonHeapMemory

Additionally CPU and total memory should be monitored. This will help establish normal and safe thresholds and should alert to how many users you should allow per box


Server Governors

It is also recommended to stop run away reports from bringing down the server by establishing some limits with “report governors”. These are system wide (or per report if you want to override the system setting). They are set in the file <tomcat>/webapps/jasperserver-pro/WEB-INF/classes/jasperreports.properties

and include the following governors:

  • net.sf.jasperreports.governor.max.pages.enabled=true

  • net.sf.jasperreports.governor.max.pages=2000

A flag indicating whether the governor that checks if a report exceeds a specified limit of pages is turned on. With this property enabled, the JR engine will stop the report execution if the number of pages becomes greater than a custom given value.

If the governor that checks if a report exceeds a specified limit of pages is turned on, this property will indicate the maximum number of pages allowed to be ran, in order to prevent a memory overflow error. If the number of pages in the report becomes greater than this value, the report execution will be stopped.

  • net.sf.jasperreports.governor.timeout.enabled=true

  • net.sf.jasperreports.governor.timeout=60000 //in milliseconds (60 seconds)

A flag indicating whether the governor that checks if a report exceeds a specified limit of pages is turned on. With this property enabled, the JR engine will stop the report execution if the number of pages becomes greater than a custom given value.

If the governor that checks if the elapsed time during report execution exceeds a specified amount of time is turned on, this property will indicate the maximum allowed amount of time, in order to prevent a memory overflow error. If this value becomes exceeded, the report execution will be stopped.

Feedback
randomness