Successfully!

Error!

Extracted Data Cache

  • Last update:  2023-04-26
  • Overview

    Version

    Report Server Version

    11.0

    Application Scenario

    In terms of report execution speed, data extraction performance is a significant factor.

    If you do not have a high requirement on real-time update performance and can accept half-hour update frequency, using caching is a solution that can reduce the pressure on server and database and improve report execution speed.

    Functions

    FineReport 11.0 provides the Extracted Data Cache function, which caches the results of dataset queries. When performing the same query again, the data can be re-queried without connecting to the database.

     You can use caching directly to reuse resource, reducing the time to extract data and thus improving the loading speed of the report. At the same time, extracting and updating cached data regularly will improve data accuracy.

    Note: This function only works for datasets of the Database Query type.

    Product Features

    Advantages Comparing with Shared DataSets

    Extracted Data Cache

    Shared Dataset

    Supports accurate recommendation for cache-applicable templates, and you can enable caching in batches with one click.

    Enables each dataset separately and will not recommend appropriate template.

    Supports custom configuration of resources, and limit maximum resource usage to cut off the impact on the operation of other system.

    Only supports setting the number of caches, and the usage of memory and disk is uncontrollable, which may affect normal operation.

    Supports real-time monitoring of cache resource usage and access status.

    /

    Supports displaying data update time on the toolbar   and manually obtaining the latest data.

    Supports admin to manually stop caching updates or immediately update the latest data.

    Does not support. If you want to stop updates or   immediately update the latest data, you can only wait for automatically   expire until timeout.

    Supports scheduled updates to ensure that the cache is always maintained, and new data   is obtained regularly.

    Does   not support. You can only achieve new data when you access after expiration.

    Works coordinately with the filling function of the report itself, and automatically invalidate the filling-related cache after filling.

    Does   not support. Cached data remains unchanged after filling, which may cause   data inconsistency issues.

    Limits automatic caching or updates for Less frequently used or resource-intensive caches, which will be restarted when they are active again.

    Only   supports three simple strategies, including recently used, least used, and first-in, first-out.


    Product Framework

    The plugin adopts modular design with a good hierarchical structure and decoupling. It is equipped with flexible circuit breaker and current limiter for scheduling, so it will not cause any pressure on the database.

    This section mainly introduces the main modules and features:

    Modules

    Features

    Storage Container

    The default maximum memory usage occupies one fourth of the JVM heap, and it will automatically terminate caching when exceeded.

    The individual cached data cannot exceed 500,000 (rows * columns, can be modified through configuration).

    Scheduler

    /

    With cached data, the scheduler will execute scheduling for update, invalidation or termination according to the strategy created for each cache.

    Maximum Idle Time

    If there is no access within 72 hours when a cache is created, the scheduler will terminate it and kick it off.

    If cache is set to update at intervals, it will only automatically be updated after at least one hit.

    Cache Update 

    The scheduler provides two default update settings:

    1) Update at fixed intervals: If you set it to 30 minutes, the cache will be automatically updated every 30 minutes from the start of storage.

    2) Update according to the CRON expression: the CRON expression is a more flexible way to specify the update time, and it will also update automatically when arriving the set time.

    When the cache is updating, the scheduler will request the database to obtain a result set based on the SQL statements corresponding to the current cache record, and replace the current cache data. This process will not block normal data extraction operations.

    Cache Number limit

    The overall number of caches cannot increase indefinitely, and the cache of a sin-gle template is the same.

    The scheduler provides two kick-off rules for checking:

    1) The cache of a single template cannot exceed 1,000 (can be modified through configuration), and will be kicked off after exceeding.

    2) The total cache quantity cannot exceed 10,000 (can be modified through configuration), and will be kicked off after exceeding.

    Updating High Load

    With a scheduling thread pool, the scheduler can schedule updated, invalidated, and terminated caches:

    1) The number of threads in the updating thread pool is 15 (modifiable through configuration), with a maximum of 15 threads accessing the database simultaneously in JDBC mode.

    2) Monitor the creation and completion throughput while updating, as well as the ratio between them, to prevent exacerbating the situation when caching is drawn due to slow response from the database or server.

    3) Report calculation and data extraction logic will still be normal after clearing and terminating all caches, and they will be executed as usual.

    Cache Configuration Items

    When the cached data exceeds the limit, the circuit breaker and current limiter will terminate the caching, which may result in situations such as it is unable to cache and slow template loading.

    You can adjust cache limits by modifying relevant configuration Items for cached data in the fine_conf_entity table according to your needs. As is shown below:

    Note:

    1. For the method of modifying the configuration item in the fine_conf_entity table, see Fill in and modify fine_conf_entity.

    2. If the following configuration items do not exist in the fine_conf_entity table, you can add a record on the reporting page by entering the parameters and corresponding values.

    Configuration Items
    MeaningModification Rules

    ESDEngineConfig.dataModelMaxSize

    Maximum data size (rows * columns) allowed for cached dataset

    The parameter value needs to be a long integer.

    The default value is 500,000.

    ESDEngineConfig.maxSingleTemplateCacheEntries

    The maximum amount of cache allowed for a single template.

    The parameter value is a positive integer.

    The default value is 1,000.

    ESDEngineConfig.maxCacheEntries

    The maximum amount of cache allowed for generation.

    The parameter value is a positive integer.

    The default value is 10,000.

    ESDEngineConfig.schedulePoolSize

    Thread pool size for cache update or retrieving executed by the scheduler.

    The parameter value is a   positive integer.

    The default value is 15.

    Procedures

    Enter the platform as an admin, and click Manage > Extracted Data Cache. The interface is shown as follows:

    Cache Template Management

    1. Cache Template Recommendation

    You can use the Cache Template Management function to check which templates are suitable for enabling caching.

    After clicking Analyze, the system will recommend templates that may be suitable for caching based on historical operational data. As is shown below:

    2. Cache Template Management

    You can add or delete caching-enabled templates here.

    Cache Configuration

    In the cache configuration page, you can set the cache for the server as shown below:

    Introductions to different cache settings are shown in the table below:

    SettingsExplanation

    Enable Cache

    You can enabling the function to cache the results of dataset queries for templates with caching settings.

    Display Cache Prompts

    Set whether to display cache prompts in the toolbar of template preview (not displayed if there is no toolbar), including manual update data button and cache generation time. And click the update data button can manually update the cache used in preview. You can use it to immediately update data when you feel that it is inaccurate, as shown in the figure below:

    Templat Cache Reminder

    After enabling this function, you can find template suitable for enabling cache in following ways:

    1) Platform Message

    2) When you first enter Extracted Data Cache on the Decision-making Patform on the same day, a tooltip at the top of the page prompts: Enable caching for 15 templates in the system will significantly improve performance. Please go to the Cache Template Management to view and enable them.

    At the same time, the Cache Template Management page prompts: Accurately recommend a few sheets, click to view.

    Parameter Predict

    After enabling this function, it will predict the parameters of the predictive template and cache them in advance to optimize loading performance.

    Cache Memory Limit

    Limit the maximum memory space occupied by cache on the server.

    Cache Update Rules

    Execute by fixed interval:

    Updates according to the  set frequency, and supports for enabling Cache rules are automatically optimized. After enabling it, the cache update interval will be dynamically adjusted within a reasonable range to avoid a large number of caches being updated simultaneously.

    Expression Settings:

    You can enter a CRON expression (For example, 0 0 12 * * ? represents twelve noon every day.)

    Always Re-read

    Refers to whether the content of the cpt or frm file is cached in memory.

    For all templates, when not enabled, the template file will be cached; after enabling, the templates will be reread every time.

    Note: Caching is mainly used to improve data extraction performance, and a large number of cache data will cause server resource constraint. Therefore, the maximum cached data is currently limited to 500,000 (rows * columns).

    Running Monitor

    If you want to know the usage status of caching or want to manually handle some abnormal caching, you can enter the Manage > Extracted Data Cache > Running Monitor.

    For details, see Cache Running Monitor.

    Server Dataset Cache Settings

    The cache setting of the server dataset follows the setting of server by default.

    If you need to set individual cache settings for the server dataset, click Server>Server Dataset in the menu bar, and select the target dataset.

    Click Enable Cache on the right side, and you can cache the dataset of this server with individual setting.

    Click Strategy Configuration to customize cache strategy configuration. As is shown below:

    Individual Caching Setting for the Dataset

    In the system, data update time of some templates may be different from others, so using unified settings for caching is not suitable. At this time, you can set caching individually for the corresponding datasets.

    Dataset editing panel will display the new cache setting, replacing the original shared dataset.

    1. When using server settings, the system will adopt default cache strategy. You can see the corresponding cache policy and whether the cache is enabled by default, but it cannot be modified. As is shown below:

    2. Individual setting for a dataset allows separate configuration on whether to use cache and policy configuration. As is shown below:

    After clicking Strategy Configuration, you can customize the cache strategy configuration. As is shown below:

    3) For a template with multiple datasets, it takes time to modify cache settings one by one. You can quickly enable or close caching by clicking the button in the dataset toolbar. As is shown below:

    Click  button to modify the dataset of the current template to individual settings in batches and enable caching.

    Click  button to modify the dataset of the current template to individual settings in batches and disable caching.

    Examples

    Dashboard or cockpit scenarios often requires analysis of multiple indicators simultaneously, and templates of them may contain many SQL statements. Even if the time consumption of each SQL statement is not high, the cumulative time consumption on SQL statements for dozens or even more indicators will take you a long time to load the entire page.

    If these SQL statements are complex, the preview time of the overall dashboard/cockpit will be longer. These types of pages are often used by leaders and the management, and have stricter performance requirements.

    Parallel data extraction is an optimization method, but due to factors such as the order of extraction, thread limit, etc., only a part of the extraction performance can be optimized. Enable this function for templates of the dashboard or cockpit can directly cache all data in the template, ensuring the loading speed of the large screen or cockpit. As is shown below:

    examples.gif

    Notes

    1) You cannot enable this function with plugin-type database.

    2) You cannot configure the cache strategy for datasets in the menu bar Template> Template Dataset.

    Even if relevant options can be set, after clicking Confirm, the system will not retain your settings while restore the original ones.

    Attachment List


    Theme: Decision-making Platform
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback