EOS Low-Code Platform 8 EOS Low-Code Platform 8
产品简介
安装部署
应用开发
专题场景实战案例
低代码(Low-Code)开发参考手册
高开开发参考手册
流程开发参考手册
AFCenter 使用指南
Governor 使用指南
FAQ
  • 性能调优手册
  • BPS Server调优方式
  • 配置修改
  • AFCenter Server配置修改
  • 配置修改
  • 其他参数修改
  • 设置操作系统的open files大小

# 性能调优手册

# BPS Server调优方式

以下相关配置修改中涉及大小配置的,根据部署服务器的配置和实际情况做相应大小调整

  • # 配置修改

    1. 启动脚本修改

      在BPS Server启动脚本(%InstallPath%/bin/startServer.sh)中添加以下配置内容。

      ##配置堆内存、非堆内存大小和SUN JDK 的GC策略,具体根据实际情况调整,以下配置仅供参考
      export EOS_DAP_MEM_OPTS="-Xms512m -Xmx4096m -Xmn256m"
      export JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC"
      
    2. 修改序列号生成器的缓冲池大小

      BPS Server 为了不在每次递增序列号的时候都访问数据库,提高性能,序列号生成器从数据库中预定了一定范围的序列号(默认为20)。当每秒会向数据库中插入大量数据时,需要将序列号生成器的缓冲池大小改大。

      修改config/BPS-SERVER/config/sys-config.xml文件中PoolSize:

      <group name="PoolSize">
           <configValue key="PoolSize">10000</configValue>
      </group>
      
    3. 关闭统计监控

      Server的统计监控功能会影响性能,可选择性关闭统计监控功能。修改config/BPS-SERVER/config/user-config.xml文件中各group中key="Status"的值为false:

      <module name="Statistic">
              <!--logic flow execution statistics-->
              <group name="Bizflow">
                  <!--possible values :openore close, statistics is enabled only when is open-->
                  <configValue key="Status">close</configValue>
                  <!--the statistics data queue length,range (0,1000],default to 50-->
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <!--pageflow execution statistics-->
              <group name="Pageflow">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <!--sql execution statistics-->
              <group name="Sql">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <!--the service call statistics-->
              <group name="Service">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <!--the webService call statistics-->
              <group name="InvokeWebService">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <group name="SpringBean">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
              <group name="EOSService">
                  <!--open|close-->
                  <configValue key="Status">close</configValue>
                  <configValue key="Queue-Length">50</configValue>
              </group>
          </module>
      
    4. 修改日志配置

      修改/config/logback-spring.xml文件,关闭日志

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
          <springProfile name="PerfTest">
              <property name="EOS_DAP_TRACE_LOG_LEVEL" value="OFF" />
              <property name="EOS_TRACE_LOG_LEVEL" value="OFF" />
              <property name="EOS_ENGINE_LOG_LEVEL" value="OFF" />
              <property name="EOS_SYS_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_AUDIT_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_SYS_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_MESSAGE_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_REQUEST_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_SQL_LOG_LEVEL" value="OFF" />
              <property name="EOS_WF_MON_TX_LOG_LEVEL" value="OFF" />
          </springProfile>
          <springProfile name="Debug">
              <logger name="com.primeton.common.connection.impl.synchronization" level="DEBUG" />
          </springProfile>
      
          <property name="LOG_FOLDER" value="${LOG_FOLDER:-./logs}" />
          <include resource="com/primeton/bps/springboot/logging/logback/logback-spring.xml" />
      </configuration>
      
    5. 修改BPS引擎配置

      将BPS运行参数配置中的实例缓存最大节点数和代理缓存最大节点数改大。inst_cache_max_nodes、agent_cache_max_nodes以下为示例

      修改/config/BPS-SERVER/config/wfengine-config.xml文件:

          <module name="wfcluster">
              <group name="wfcache">
              	<!-- 引擎集群通知开关 -->
                  <configValue key="enable">false</configValue>
              	<!-- 流程实例缓存的实例数上限 -->
                  <configValue key="inst_cache_max_nodes">20000</configValue>
              	<!-- 代理关系缓存的实例数上限 -->
                  <configValue key="agent_cache_max_nodes">20000</configValue>
                   <configValue key="auto_delete_processinst">true</configValue>
              	<configValue key="always_persistent_processinst">false</configValue>
              	<configValue key="always_persistent_activityinst">false</configValue>
              </group>
          </module>
      
    6. 修改数据源参数

      根据场景的实际并发数,设置数据库的连接池最大连接数和最小连接数。例如,场景中使用的用户并发数为100,所以将数据库初始连接数和最小连接数设置为100,最大连接数设置为200。

      建议开启数据库的断开连接重试机制,重试次数依据实际情况进行设置。

      数据源参数的配置修改/config/BPS-SERVER/config /user-config.xml文件中C3p0-PoolSize、C3p0-MaxPoolSize、C3p0-MinPoolSize:

              <group name="default">
                  <configValue key="Database-Type">MySql</configValue>
                  <configValue key="Jdbc-Type"/>
                  <configValue key="C3p0-DriverClass">com.mysql.jdbc.Driver</configValue>
                  <configValue key="C3p0-Url">jdbc:mysql://127.0.0.1:3306/afcenter_bps_test?characterEncoding=utf-8&amp;serverTimezone=Asia/Shanghai&amp;useSSL=false</configValue>
                  <configValue key="C3p0-UserName">root</configValue>
                  <configValue key="C3p0-Password">root</configValue>
                  <configValue key="C3p0-PoolSize">100</configValue>
                  <configValue key="C3p0-MaxPoolSize">200</configValue>
                  <configValue key="C3p0-MinPoolSize">100</configValue>
                  <!-- //seconds, 0 means connections never expire -->
                  <configValue key="C3p0-MaxIdleTime">600</configValue>
                  <!-- //idle connections never tested -->
                  <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
                  <configValue key="C3p0-MaxStatements">0</configValue>
                  <configValue key="C3p0-NumHelperThreads">1</configValue>
                  <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
                  <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
                  <configValue key="Retry-Connect-Count">-1</configValue>
              </group>
      
    7. web容器的线程配置参数

      添加以下容器线程参数在/config /application.properties文件中:

      server.app-server.accept-count=1000
      server.app-server.max-threads=800
      server.app-server.min-spare-threads=100
      server.app-server.max-connections=1000
      

      添加关闭日志参数在/config /application.properties文件中:

      logging.level.root=ERROR
      

# AFCenter Server配置修改

  • # 配置修改

    1. 启动脚本修改

      在AFCenter Server启动脚本(%InstallPath%/bin/startServer.sh)中添加以下配置内容。

      ##配置堆内存、非堆内存大小和SUN JDK 的GC策略,具体根据实际情况调整,以下配置仅供参考
      export EOS_DAP_MEM_OPTS="-Xms4096m -Xmx4096m -Xmn256m"
      
    2. 启动脚本修改

      根据场景的实际并发数,设置数据库的连接池最大连接数和最小连接数。例如,场景中使用的用户并发数为100,所以将数据库初始连接数和最小连接数设置为100,最大连接数设置为200。

      建议开启数据库的断开连接重试机制,重试次数依据实际情况进行设置。

      数据源参数的配置修改/config/BPS-SERVER/config /user-config.xml文件中C3p0-PoolSize、C3p0-MaxPoolSize、C3p0-MinPoolSize:

              <group name="default">
                  <configValue key="Database-Type">MySql</configValue>
                  <configValue key="Jdbc-Type"/>
                  <configValue key="C3p0-DriverClass">com.mysql.jdbc.Driver</configValue>
                  <configValue key="C3p0-Url">jdbc:mysql://127.0.0.1:3306/afcenter_bps_test?characterEncoding=utf-8&amp;serverTimezone=Asia/Shanghai&amp;useSSL=false</configValue>
                  <configValue key="C3p0-UserName">root</configValue>
                  <configValue key="C3p0-Password">root</configValue>
                  <configValue key="C3p0-PoolSize">100</configValue>
                  <configValue key="C3p0-MaxPoolSize">200</configValue>
                  <configValue key="C3p0-MinPoolSize">100</configValue>
                  <!-- //seconds, 0 means connections never expire -->
                  <configValue key="C3p0-MaxIdleTime">600</configValue>
                  <!-- //idle connections never tested -->
                  <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
                  <configValue key="C3p0-MaxStatements">0</configValue>
                  <configValue key="C3p0-NumHelperThreads">1</configValue>
                  <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
                  <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
                  <configValue key="Retry-Connect-Count">-1</configValue>
              </group>
      
    3. 关闭日志监控

      添加关闭日志参数在/config /application.properties文件中:

      logging.level.root=ERROR
      

      在/config / logback-spring.xml文件中注释掉include:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
        <property name="LOG_FOLDER" value="${LOG_FOLDER:-./logs}" />
          <!--<include resource="com/primeton/bps/springboot/logging/logback/logback-spring.xml" />-->
      </configuration>
      
    4. web容器的线程配置参数

      添加以下容器线程参数在/config /application.properties文件中:

      server.app-server.accept-count=1000
      server.app-server.max-threads=800
      server.app-server.min-spare-threads=100
      server.app-server.max-connections=1000
      

# 其他参数修改

# 设置操作系统的open files大小

  1. 通过ulimit -a 命令能产看当前系统的open files大小。

  2. 执行vim /etc/security/limits.conf命令在文件中配置以下内容。

    root soft nofile 65536
    root hard nofile 65536
    
  3. 修改之后注销用户,然后重新登录,配置的open files就能生效。

上次更新: 2024/1/11上午11:49:16

← 产品补丁如何使用 IDE编译性能优化 →