Performance Optimization Techniques in Joget
Below, the most effective and advanced techniques for overcoming performance challenges in your Joget applications are detailed. Each section of this document is designed to provide you with a deep and applicable understanding of how to identify and resolve inefficiencies that may be holding back the potential of your applications. Prepare to transform your approach with proven strategies that ensure smoothness and efficiency, maximizing user experience and system stability.
Identify bottlenecks using the performance analyzer
This section outlines how to effectively use the Performance Analyzer to pinpoint and address these critical performance bottlenecks in your application.
-
Identify Elements with High Resource Use:
- Focus Areas: User view pages and menus heavily reliant on SQL or BeanShell scripts are often culprits of poor performance.
- Tools: Use the Performance Analyzer to locate these elements by monitoring their resource consumption during runtime.
-
Analyze Slow SQL Queries:
- Database Tools: For databases like MySQL, utilize the Slow Query Log to find queries that significantly impact performance.
- Optimization Tips: Adjust queries based on insights from the analysis to reduce execution time and resource load.
-
Check Custom Plugins:
- Ensure that custom plugins do not cause excessive processing delays or inefficient database queries.
- Ensure that custom plugins do not cause excessive processing delays or inefficient database queries.
-
Resource Adequacy:
- Verify that your application has sufficient physical memory, storage space, CPU allocation and appropriate Java VM allocation to handle the current load.
- Look for signs of resource leakage that could degrade performance over time.
Identify bottlenecks using the Application Performance Management tool
It is recommended to leverage the Application Performance Management tool to narrow down and address web and app performance by creating alerts for errors, queries and slow traces.
-
- Focus Areas: Configure performance alerts for web request performance and application performance.
- Tools: Use the Application Performance Management to monitor the performance of systems and applications in real time.
Ensuring sufficient Java VM memory allocation
The Java Virtual Machine (JVM) is critical for performing applications running on Java platforms. Aside from adding additional dedicated memory, proper configuration of JVM heap memory is essential to balance efficiency and resource utilization based on the application's size, complexity, and operational demands.
Learn about the guidelines for JVM memory allocation.
-
Assess Default Settings:
- The default JVM settings are typically set low to accommodate simple applications or initial development stages on individual computers. These settings may not be suitable for production environments or more complex applications.
- The default JVM settings are typically set low to accommodate simple applications or initial development stages on individual computers. These settings may not be suitable for production environments or more complex applications.
-
Adjust Heap Size:
- Increase Heap Size: If your applications run out of memory, increase the JVM heap size to prevent
OutOfMemory
errors. This is essential for applications with high memory demands. - Decrease Heap Size: Conversely, setting the heap size too high can lead to inefficient memory use, such as excessive swapping if the allocated memory exceeds the physical RAM available, leading to performance degradation.
- Increase Heap Size: If your applications run out of memory, increase the JVM heap size to prevent
-
Monitoring and Adjustment:
- Tool Usage: Utilize monitoring tools like VisualVM to track real-time memory usage. These tools provide insights into memory consumption, garbage collection activities, and overall JVM performance.
- Iterative Tuning: Adjust the heap size based on monitoring data and application performance. This process may require trial and error to fine-tune settings that suit your specific environment and usage patterns.
-
Refer to Best Practices:
- See the Deployment Best Practices#Java virtual machine configuration section for detailed guidance and advanced configurations tailored to enhance JVM performance in various deployment scenarios.
Proper JVM configuration ensures that your applications run smoothly without interruption and optimizes resource utilization. Regular monitoring and adjustment of JVM settings are recommended to adapt to changing application needs and to prevent potential performance bottlenecks.
Optimize the database and application server
Optimizing the SQL queries and server configurations is crucial to ensure optimal application performance. Follow these steps to enhance efficiency:
-
Optimize SQL Queries:
- Use the EXPLAIN command in MySQL to analyze your queries' execution plans. This tool helps identify and rectify slow queries, which are often the primary bottlenecks in application performance.
- Access MySQL's optimization guidelines at MySQL Optimization.
-
Database Server Configuration:
- For applications with intensive database interaction, adjust your database and server settings according to the specific demands. Consult your database administrator for expert tuning based on your usage patterns.
- For detailed guidance, see Deployment Best Practices#Database indexing.
-
Application Server Tuning:
- If your application handles many concurrent requests, configure your application server to manage this load effectively. For instructions, see Deployment Best Practices#Apache Tomcat configuration.
- If your application handles many concurrent requests, configure your application server to manage this load effectively. For instructions, see Deployment Best Practices#Apache Tomcat configuration.
-
Update Your Database Server:
- Regularly upgrade your database server to the latest stable releases. New versions often include significant performance improvements.
-
Optimize Database Indexes:
- Adding indexes to the foreign key columns in the child tables enhances the performance of form grids involving parent and child database tables. This speeds up the retrieval of child form records.
Load testing and server sizing for Joget DX 8
When preparing to deploy Joget DX 8, accurately determining the necessary server specifications is essential due to various factors influencing performance and resource requirements. Here are the key considerations and a recommended approach to ensure your deployment is optimized for its intended use:
Key factors influencing server specifications
The server requirements for Joget DX 8 depend on several factors, which collectively determine the necessary infrastructure:
- Total number of users: This includes everyone accessing any platform applications.
- Maximum expected concurrent users: The peak number of users operating on the platform at the same time.
- Number of apps running on the platform: More applications can increase resource needs.
- The complexity of each app: Complex applications with extensive data processing require more resources.
- Amount of data generated in each app: Applications that generate or process large amounts of data may need more powerful servers.
- Network infrastructure: Your network's capabilities can affect application performance and responsiveness.
For example, a deployment scenario with few users but a high-usage, complex application might require more resources than many users who infrequently use simpler applications.
Server sizing strategy
Determining the exact server specifications based solely on user counts or application numbers can be misleading. A practical approach involves:
- Starting small: Begin with a single application server.
- Scaling up or clustering: You can enhance your setup by scaling vertically (upgrading existing hardware) or horizontally (adding more servers) based on actual performance and needs.
Load testing your application
To accurately gauge the server specifications for your specific scenario, it's advisable to conduct load testing within your environment. Here are the steps to initiate load testing:
- Choose a load testing tool: Utilize tools like Apache JMeter, which is well-documented for use with Joget on AWS in the Joget DX 8 Clustering and Performance Testing guide.
- Test under varied loads: Simulate different user loads, from typical daily use to peak loads, to understand how your infrastructure handles stress.
- Analyze performance data: Assess how the application performs under different scenarios to make informed decisions about scaling.
Introduction to clustering and load balancing
Once you have optimized your applications, the next step to handle increased traffic and ensure high availability is to scale your server capacity. This can be done in two ways:
- Vertical Scaling: This involves increasing the capacity of your existing server.
- Horizontal Scaling involves expanding your infrastructure to include multiple servers. This approach includes clustering and load balancing techniques, which manage higher loads and enhance the system's availability and reliability.
For detailed strategies on implementing these methods, see Deployment Best Practices#Clustering and Load Balancing.
App Design
- Do consider placing the "daily use" & "setup/administration" menus into two separate userviews to make the datalist compact and fast. Add a link in each userview to jump from userview1 to userview2 and vice versa.
- Remove or hide all menu counts where possible. Menu counts in other datalist in the same userview affect performance as it needs to perform a count in other datalist too to populate the menus.
- Use Sync LDAP User Directory Manager to improve performance retrieving user information in your app.
- Use UI Caching and Form options caching to store data in memory to reduce the need for database calls.
- In your development or staging servers, delete unneeded or unused old versions of the app (that are unpublished). Consider maintaining two copies of the app, the current published version, and one older version.
Additional resources
To delve deeper into performance optimization techniques and explore more resources, please refer to the following links that offer detailed information and complementary tools:
-
Tuning Tomcat Performance: Learn to optimize Tomcat to enhance the performance of your Joget applications.
-
Optimize MySQL Queries: Improve the performance of your databases with effective optimization techniques.
-
AJAX Select Box Plugin: Implement dynamic selection fields in your forms to improve interactivity without compromising performance.
-
Form Data Audit Trail and Process Data Collector: Evaluate the importance of these plugins and their impact on performance.
-
Git Configuration: Joget DX 7.0.6 and higher includes the option in the
JAVA_OPT
parameter to disable or turn off the Git. This reduces the processing overhead on Joget by adding-Dgit.disabled=true
to your Joget startup script. -
Joget Server Clustering: Consider implementing clustering for scalability and redundancy in large enterprise environments.