## Tuning Page Report Studio performance

JReport provides you with methods for adjusting Page Report Studio performance. You can limit the number of page reports open simultaneously in Page Report Studio by setting the Page Report Studio preferences on the JReport Administration page. Furthermore, you can modify a property file to control the Action Task Manager, which can improve Page Report Studio service performance.

### Limiting the number of simultaneously open reports

Whether or not an open page report interacts with the server, it holds many resources. As a result, opening many reports will decrease server performance. Thus, JReport allows the administrators to specify the maximum number of page reports that can be open at the same time in Page Report Studio so as to prevent large numbers of page reports from being open simultaneously and to improve the server performance.

To set the maximum number of page reports that can be open at the same time:

1. On the JReport Administration page, click Profile on the system toolbar and then select Customize Profile from the drop-down menu.
2. Click the Page Report Studio > Properties > Advanced tab.
3. Check the Maximum Number of Open Reports option and type the number to your requirement in the text box.
4. Click OK upon finishing.

If the number of open reports exceeds the limit, an error page will be displayed prompting you to close one before opening a new one.

Note: The Maximum Number of Open Reports option works together with the maximum number of concurrent reports allowed by your product license. Of these two values, whichever is smaller will be used as the real maximum number of open reports allowed. For example, if the value of the Maximum Number of Open Reports option is 10, and the number that the license allows is 20, 10 will be used as the maximum number of page reports that can be opened simultaneously.

### Action Task Manager

Some Page Report Studio operations require a large amount of memory and CPU processing power. The Action Task Manager improves Page Report Studio service performance by preventing a large number of actions from being run simultaneously.

The Action Task Manager coordinates Page Report Studio actions through two fixed-size tables:

- Concurrent Processing Table - This registers the requests that are currently being processed by the Page Report Studio service.
- Waiting Requests Queue - This registers the requests that are waiting for being processed by the Page Report Studio service.

Note: Only certain operations that consume considerable hardware resources need to be prevented from being run at the same time. You can define which kind of requests need to be queued before being processed.

When a new Page Report Studio request reaches the server, it will be processed according to the following flow:

1. The Page Report Studio service determines whether the requested operation is a restricted action. If it is, the Action Task Manager will take over the request. Otherwise, it will be processed directly, without being managed by the Action Task Manager.
2. If the Concurrent Processing Table is full, the restricted request will be assigned to the Waiting Requests Queue. If the queue is full, the Page Report Studio service will refuse the request and return a warning message.
3. After the request has been processed, it will be de-registered from the Concurrent Processing table. The Page Report Studio service will then automatically continue to process the requests in the Waiting Requests Queue.

By using the property file dhtml.properties provided in Page Report Studio, you can balance the server load by adjusting table sizes and specify which kind of requests are managed by the Action Task Manager.

#### dhtml.properties

The dhtml.properties file is located at `<install_root>\bin`. It allows you to control three major options for the Action Task Manager:

- Specifying the size of the Concurrent Processing Table

  Use `queue.actions.max.concurrent=[integer]` to set the maximum number of requests that can be processed simultaneously. The value of this property can be equal to or larger than 0. Use 0 (default) to disable the request queue feature.

- Specifying the size of the Waiting Requests Queue table

  Use `queue.actions.max.pending=[integer]` to set the maximum number of to-be-handled requests that the queue can contain. The value of this property can be equal to or larger than 0. 0 means no requests will be stored in the queue. A request will either be handled by the Page Report Studio service or be rejected when the maximum limit of the Concurrent Processing table has been reached.

- Specifying the actions that can be applied for the Page Report Studio Request Queue feature

  These are listed below:

  `queue.actions.init=false # Action: DHTML report initialization
  queue.actions.undo=true # Action: Undo
  queue.actions.redo=true # Action: Redo
  queue.actions.drill=true # Action: Drilling
  queue.actions.drillup=true # Action: Drilling up
  queue.actions.refresh=false # Action: Refreshing
  queue.actions.filter=true # Action: Filtering
  queue.actions.sort=true # Action: Sorting
  queue.actions.search=true # Action: Searching
  queue.actions.finishNewReport=true # Action: Finishing creating a new report`

  These properties will only work when the queue feature has been enabled by setting `queue.max.concurrent.actions>0`.

  True - The action will be handled by the Action Task Manager.
  False - The action will not be handled by the Action Task Manager, but be directly processed by the Page Report Studio service without being queued.