System Optimization

  • Last update:December 18, 2023

  • Web Application Server Configuration

    JVM Parameter

    JVM parameter configuration is necessary to ensure the stable operation of the system.

    Parameter Interpretation    

    Parameter

    Description 

    Suggestions

    -Xms/-Xmx

    Used to limit the size of the heap memory.

    -Xms: Set initial heap size

    -Xmx: Set maximum heap size

    If the value of -Xmx is smaller than 32 GB, -Xms = -Xmx is recommended to avoid performance loss caused by the JVM repeatedly applying for memory from the operating system.

    But if the value of -Xmx is larger than 32 GB, set the -Xms value below 32 G to avoid applying too much memory at once but not using it, causing GC to reclaim memory pressure.

    Larger memory is not always better, as it can also lead to longer GC times. Reasonable values are recommended.

    The value of -Xmx should not be set in the range 32 to 48, as JVM performance will be poor in this range.

    -XX:MaxDirectMemorySize

    Used to limit the size of the direct memory.

    FineBI engine will use the direct memory during the calculation process.

    The direct memory must be reclaimed by GC, but if the Full GC is not triggered, it may lead to a part of the direct memory not being reclaimed, and eventually the system memory is exhausted, resulting in problems such as OOM kill.

    As long as other memory parameters are configured adequately and at least 4 G to 8 G of memory are reserved for the system, the remaining memory can be allocated to the direct memory.

    -XX:ReservedCodeCacheSize

    Used to set the memory that is used to compile the code dynamically. If this memory is insufficient, it will cause a decrease in computational performance.

    If the system usage is large, 2 G is recommended, not less than 1 G.

    -Dfineio.read_mem_limit

    -Dfineio.write_mem_limit

    -Dfineio.cache_mem_limit

    FineBI parameters, which limit the size of the direct memory used to read and write Log files.

    Recommended value

    -Djava.awt.headless


    Fixed value: true

    -XX:PerBytecodeRecompilationCutoff

    -XX:PerMethodRecompilationCutoff

    Used to fix JDK bugs. If they are not configured, the data update may gradually slow down.

    Fixed value: -1

    -XX:+HeapDumpOnOutOfMemoryError

    -XX:HeapDumpPath

    Used to set the dump file that automatically outputs if a memory outage occurs, helping to locate the cause of the problem.

    It is recommended to configure the Path directory to a disk partition that has sufficient disk space and is different from the Tomcat project to avoid generating too large dump files that will cause insufficient disk space.

    Configuration Method

    Configurable files including startup.sh, catalina.sh, and setclasspath.sh, among which the catalina.sh file is recommended.

    For example:

    export JAVA_OPTS='-Xms4g -Xmx4g -XX:MaxDirectMemorySize=2g -XX:ReservedCodeCacheSize=1g -Dfineio.read_mem_limit=2 -Dfineio.write_mem_limit=1 -Dfineio.cache_mem_limit=1 -Djava.awt.headless=true -XX:PerBytecodeRecompilationCutoff=-1 -XX:PerMethodRecompilationCutoff=-1  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/bi'

     

    iconNote:
    The write requires a single-line insert and no newline characters.


    If you need to insert multiple lines, you need to write them separately.

    For example:

    export JAVA_OPTS='-Xms4g -Xmx4g -XX:MaxDirectMemorySize=2g -XX:ReservedCodeCacheSize=1g -Dfineio.read_mem_limit=2 -Dfineio.write_mem_limit=1 -Dfineio.cache_mem_limit=1'
    export JAVA_OPTS='$JAVA_OPTS -Djava.awt.headless=true -XX:PerBytecodeRecompilationCutoff=-1 -XX:PerMethodRecompilationCutoff=-1  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/bi'

    After the configuration is complete, restart Tomcat and check the parameters in catalina.log.

    Server System Optimization

    Maximum Number of Open Files

    The number of files extracted by FineBI will be very large. When updating data or high concurrent access calculation, the number of files loaded will be very large, which is easy to trigger the limit of the number of files opened by the Linux operating system.

    So you have to increase the maximum number of open files.

    GBLIC Parameter

    This parameter is used to avoid a JDK bug which could cause a GBLIC memory leak.

    Swap

    Swapping space is a physical memory page placed at the top of a disk partition or a special disk file that is used to expand a system’s RAM as the physical memory fills up. Inactive memory pages are often dumped into the swap area when no RAM is available, using this method of expanding RAM resources. 

    However, swap space is much lower in transfer speeds and access time compared to RAM, due to the spinning speed of standard hard disks.

    Reserving a small partition for swapping will significantly increase access time and speed transfer compared to conventional HDD on newer machines with fast SSD hard drives, but the speed is still lower than RAM. 

    So if your server has sufficient RAM, you can consider disabling the swap field.

    To permanently disable Linux swap space, open the /etc/fstab file, search for a swap line, and add a # sign in front of the line to comment on the entire line, as shown in the screenshot below.

    Network Configuration

    1. Open ports of the server firewall.

    Besides the HTTP port that has been opened before, the WebSocket port also needs to be opened. Skip this step if you have already finished it. See Using and Configuring Linux Firewall and Modifying FineBI Project Port Number.

    2. Map the internal and external network iexternal access is needed. Note that both ports need to be mapped.

    3. Refer to the relevant help document for access through a proxy server.

    External FineDB Database Configuration

    附件列表


    主题: 源文档下架
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy