Managing the maximum Java heap size and Db2 bufferpool

Manage the maximum Java heap size and Db2® bufferpool size using the server_size.sh command.

Procedure

  1. To view the server size, run the server_size.sh command from the /opt/ibm/ccm/ directory.
    The output describes the number of CPUs, memory size, and free disk space in the server. Based on this output, a recommended server size is given, for example:
    Number of CPUs: 6
    Memory size: 16.00 GB
    Recommended server size: small
    Current server size: medium
  2. To change the server size and Db2 bufferpool, run the server_size.sh command again followed by the recommended size, for example, server_size.sh small.
    Note, this command stops and restarts the four Liberty servers. The maximum Java heap size is adjusted according to the values in the following table:
    Table 1. Maximum Java heap size setting
    Cloud APM server components Small Medium Large
    Server1 application server 1526 MB or 1536 MB 2048 MB 3072 MB
    APMUI service 1526 MB or 1536 MB 3072 MB 4096 MB
    Uviews (Liberty server instance) 1024 MB 1024 MB 1024 MB
    MIN (Liberty server instance) 512 MB if you have Cloud APM server V8.1.4.0 with no interim fix or interim fix 6 or earlier; 768 MB if you have Cloud APM server V8.1.4.0 with interim fix 6 or later 1536 MB 2048 MB
    OIDC 128 MB 128 MB 256 MB
    Kafka 256 MB 512 MB 512 MB
    Zookeeper 256 MB 256 MB 256 MB
    MongoDB Cache 1024 MB for all Cloud APM, Base Private install 2048 MB 4096 MB
    The buffer pool is adjusted according to the values in the following table:
    Table 2. Db2 Bufferpool
    Database Bufferpool Large Medium Small
    DATAMART IBMDEFAULTBP 300000 200000 100000
    WAREHOUS IBMDEFAULTBP 200000 100000 50000
    SCR32 TBSMSCR16KBP 100000 50000 30000
    SCR32 TBSMCFG16KBP 10000 5000 1000
    Example output is included here:
    /opt/ibm/ccm/server_size.sh small
    
    Setting heap size to 256 MB for service kafka.
    Setting heap size to 256 MB for service zookeeper.
    Setting heap size to 1024 MB for service apmui.
    Setting heap size to 512 MB for service min.
    Setting heap size to 128 MB for service oidc.
    Setting heap size to 1526 MB for service server1.
    Setting ENABLE_MY_COMPONENTS to true for service apmui.
    Setting cache size (GB) to 1 for service mongodb.
    Setting prefetch pause to 100000 for service min.
    Setting prefetch resume to 75000 for service min.
    Setting datamart_ibm_default_buf_pool value to 100.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = DATAMART
    
    DB20000I  The SQL command completed successfully.
    Setting scr_ibm_default_buf_pool value to 5000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The SQL command completed successfully.
    Setting scr_tbsm_cfg_16k_buf_pool value to 1000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The SQL command completed successfully.
    Setting scr_tbsm_4k_buf_pool value to 1000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The SQL command completed successfully.
    Setting scr_tbsm_scr_16k_buf_pool value to 30000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The SQL command completed successfully.
    Setting scr_tbsm_32k_buf_pool value to 1000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The SQL command completed successfully.
    Setting scr32_logsecond value to 25.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = SCR32
    
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    Setting warehous_ibm_default_buf_pool value to 50000.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = WAREHOUS
    
    DB20000I  The SQL command completed successfully.
    Setting warehous_logsecond value to 25.
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 10.5.6
     SQL authorization ID   = DB2APM
     Local database alias   = WAREHOUS
    
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    Stopping service apmui (PID 48442).
    Service apmui is stopped.
    Stopping service min (PID 47105).
    Service min is stopped.
    Stopping service server1 (PID 44961).
    Service server1 is stopped.
    Stopping service mongodb (PID 44260).
    Service mongodb is stopped.
    Starting service mongodb
    Service mongodb is started (PID 9000).
    Starting service server1
    ........................
    Service server1 is started (PID 9256).
    Starting service min
    ......
    Service min is started (PID 12376).
    Starting service apmui
    .........................................................
    Service apmui is started (PID 16226).
    
  3. If you are using a remote Db2 server for the Cloud APM server databases then you must update the buffer pool sizes and transaction logs on the Db2 server. Enter the following command as the external_db2_instance user for each database to adjust the buffer pool and transaction log.
    db2 connect to WAREHOUS
    db2 UPDATE DATABASE CONFIGURATION FOR WAREHOUS USING LOGSECOND  WAREHOUS_LOGSECOND
    db2 alter bufferpool IBMDEFAULTBP IMMEDIATE size WAREHOUS_PAGE_COUNT
    db2 disconnect WAREHOUS
    db2 connect to DATAMART
    db2 alter bufferpool IBMDEFAULTBP IMMEDIATE size DATAMART_PAGE_COUNT
    db2 disconnect DATAMART
    db2 connect to SCR32
    db2 UPDATE DATABASE CONFIGURATION FOR SCR32 USING LOGSECOND  SCR_LOGSECOND
    db2 alter bufferpool TBSMCFG16KBP IMMEDIATE size SCR_CFG_PAGE_COUNT
    db2 alter bufferpool TBSMSCR16KBP IMMEDIATE size SCR_PAGE_COUNT
    db2 disconnect SCR32
    where:
    WAREHOUS_LOGSECOND
    The number of secondary transaction logs: 25 for a small environment; 50 for a medium environment; or 100 for a large environment.
    WAREHOUS_PAGE_COUNT
    The buffer pool page count (8-KB page sizes): 50000 for a small environment; 100000 for a medium environment; or 200000 for a large environment.
    DATAMART_PAGE_COUNT
    The buffer pool page count (8-KB page sizes): 100000 for a small environment; 200000 for a medium environment; or 300000 for a large environment.
    SCR_LOGSECOND
    The number of secondary transaction logs: 25 for a small environment; 50 for a medium environment; or 100 for a large environment.
    SCR_CFG_PAGE_COUNT
    The buffer pool page count (16-KB page sizes): 1000 for a small environment; 5000 for a medium environment; or 10000 for a large environment.
    SCR_PAGE_COUNT
    The buffer pool page count (16-KB page sizes): 30000 for a small environment, 50000 for a medium environment, and 100000 for a large environment.
    Note: If you are not using the default database names, then replace the WAREHOUS, DATAMART, and SCR32 names with your custom database names.