Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
indent30px
stylecircle

 

...

 

The default Joget installation comes with minimal performance configuration as it aims to cater for installation on small machines, e.g., a local development PC.

For production deployment on a server, the Java Virtual Machine (JVM), application server, database and operating systems should be tuned for performance. Actual real world performance depends on many factors. These include the deployment architecture, server and network specifications, complexity of the processes/apps, actual usage patterns by different users, etc.

This document presents some of the best practices in terms of performance tuning and optimization to get the best out of your deployment.

Important Note: These recommendations help to serve as general tips and guidelines, but in actual practice it would depend on each deployment’s unique environment. There are also many resources available online to help tune performance for Java, application servers and databases.

Installation as a Service

For production deployments, you may want to install the web application server, e.g., Apache Tomcat, as a service. Please refer to the documentation on the relevant operating system to do so. A guide to install Tomcat as a Windows service is available at Installing Joget as a Windows Service.

Java VM Configuration

Java VM Tuning

An important configuration would be the JVM memory allocation. If this is too low, the system will run out of memory. However if the setting is too high, there might be quite a large overhead in garbage collection. To get an optimum setting might require a bit of trial and error sometimes, depending on the usage environment.

Here are the steps to get started.  You may want to start with a 1GB max heap setting and increase if the need arises.  

1. Stop Joget.

2. Open and edit Joget Installation Directory/joget-start.bat.

3. Modify

 

默认的Joget安装具有最小的性能配置,因为它旨在满足在小型机器(例如本地开发PC)上的安装。

对于服务器上的生产部署,应调整Java虚拟机(JVM),应用程序服务器,数据库和操作系统的性能。实际的真实世界的表现取决于许多因素。这些包括部署架构,服务器和网络规格,流程/应用程序的复杂性,不同用户的实际使用模式等。

本文档介绍了性能调优和优化方面的一些最佳实践,以充分利用您的部署。

重要提示:这些建议有助于作为一般性提示和指导,但在实际实践中,这取决于每个部署的独特环境。还有许多在线的资源可以帮助调整Java,应用程序服务器和数据库的性能。

安装即服务

对于生产部署,您可能需要将Web应用程序服务器(例如Apache Tomcat)作为服务来安装。请参阅相关操作系统上的文档。Joget安装为Windows服务时,可以找到将Tomcat  安装为Windows服务的指南

Java VM配置

Java VM调优

一个重要的配置将是JVM内存分配。如果这太低,系统将耗尽内存。但是,如果设置太高,垃圾收集可能会有相当大的开销。要获得最佳设置,有时可能需要一些试用和错误,具体取决于使用环境。

以下是开始的步骤。您可能希望从1GB的最大堆设置开始,并在需要时增加。  

1.停止Joget。

2.打开并编辑Joget安装目录/ joget-start.bat。

3.修改

 

Code Block
set JAVA
Code Block
set JAVA_OPTS=-XX:MaxPermSize=128m -Xmx512M -Dwflow.home=./wflow/ -javaagent:./wflow/aspectjweaver-1.8.5.jar

on line 13 to 

 

 
Code Block
set JAVA_OPTS=-XX:MaxPermSize=256m -Xmx1024M -Dwflow.home=./wflow/ -XX:+UseConcMarkSweepGC -javaagent:./wflow/aspectjweaver-1.8.5.jar

 

4. Save and start Joget.保存并启动Joget。

注意:NOTE:

Please take note should you encounter any of the following OutOfMemory errors:

...

There are many online resources for further tuning, e.g., http://www.oracle.com/technetwork/java/performance-138178.html.

Web Application Server Configuration

Apache Tomcat Configuration

For Apache Tomcat, try setting the maxThreads Connector thread pool settings based on the estimated request load. For example, to set the maximum number of threads to 1000, edit tomcat_directory/conf/server.xml. Locate the line

Code Block
    <Connector URIEncoding="UTF-8" port="8080" protocol="HTTP/1.1"   
                   connectionTimeout="20000"   
                   redirectPort="8443" />
    

and add a maxThreads="" such as

Code Block
    <Connector URIEncoding="UTF-8" port="8080" protocol="HTTP/1.1" maxThreads="1000" 
                   connectionTimeout="20000"   
                   redirectPort="8443" />
    

This would require a Tomcat restart to take effect.

There are many resources available online, e.g., http://www.itworld.com/networking/83035/tomcat-performance-tuning-tips.

Linux Configuration

Linux / Unix systems have a limit on the number of files that can be concurrently opened by a process. When the limit is reached, there will be an exception "Too many open files". The default for most distributions is 1024, which will not be enough for high traffic deployments. In Linux, increasing the ulimit 

...

works as a workaround but this is only valid for the session. For permanent configuration, please refer to documentation for the specific distribution, e.g., http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/.

Database Configuration

Database Indexing

Form data tables generated and managed by Joget are prefixed with app_fd. By default, primary keys and foreign keys are automatically generated for these tables where necessary.

However, in more complex apps, there would be more complex database queries that make use of these tables. As such, it is recommended for indexes to be added manually into table columns when required.

MySQL Configuration

When using InnoDB in MySQL, setting an appropriate InnoDB Buffer Pool is important for large-scale performance. Details can be found here: http://dev.mysql.com/doc/refman/5.0/en/innodb-buffer-pool.html.

...

It is possible to identify slow queries in MySQL by enabling the slow query log. This helps to identify areas for possible indexing and optimization.
http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html

Clustering and Load Balancing

For large scale and high-availability deployments, clustering and load balancing may need to be implemented using the Large Enterprise Edition. A high-level description is as follows:

...

The database and wflow files (configuration/uploaded files) would also have to be shared from a centralized server.

Logging and Troubleshooting

When running Apache Tomcat, logs are stored in the tomcat_directory/logs directory. In particular, the files joget.logcatalina.out, and localhost.yyyy-MM-dd.log capture information and errors that are generated.

...

The more information provided, the faster an issue can be identified and resolved.

Backup and Restore

Backup Data

To backup an installation:

  • Backup all configuration files and uploaded data files stored in 备份存储在joget_directory / wflow.
  • Backup the database. e.g., in MySQL you can use the mysqldump utility.

Restoring Data

To restore data to an installation:

  • wflow中的所有配置文件和上传的数据文件 
  • 备份数据库。例如在MySQL中,你可以使用  mysqldump  工具。

恢复数据

要将数据恢复到安装:

  • 恢复存储在Restore all configuration files and uploaded data files stored in joget_directory / wflow.Restore the database.wflow中的所有配置文件和上传的数据文件 
  • 还原数据库。