In our recent blog post OFBiz Performance Tip: sync vs async, we shared details outlining how two different OFBiz instances could be used to successfully process heavy loads generated in our load testing sessions. In that blog we shared how the load generated by synchronous and asynchronous services can be split and processed by the two OFBiz instances. In this post, we take it a step further to discuss technical design for Apache OFBiz load testing with Apache JMeter.
Design 1 – Master-Slave Design
The diagram below features a JMeter master-slave setup design used for load testing Apache OFBiz. To increase the load on the targeted OFBiz server any number of slave nodes can be added to the master system. More detailed information from the JMeter folks can be found here. This configuration is recommended when you want to generate a heavy load on the targeted server and the slave nodes have less RAM and a low speed processor.
Design 2: Single Machine Single User and Single Machine Multiple User
In this setup, there are two main combinations that can be used:
- Single Machine Single User: If the machine configuration is average then we can add a single user to every single machine and perform load testing. Machines of this type can be connected in parallel for the desired amount of load.
- Single Machine Multiple User: If the machine configuration is high then we can create multiple user on that machine. The user name can be kept as user1 , user2, user3 … and so on. Each user will have a separate JMeter and jdk setup available for its use. For example, say we have 16GB RAM available with a high configuration machine and we want to setup two users on that machine. We can assign 6GB RAM to the JMeter setup of user1 and 6GB RAM to the JMeter setup of user2, and the remaining 3GB RAM will be used by the operating system.
The hardware configuration details for all the servers involved in design two are shown below:
1) OFBiz01 Server: This server will be responsible for managing all the synchronous jobs.
2) OFBiz02 Server: This server will be responsible for managing all the asynchronous jobs.
3) Apache Server: All the requests will come to this server, and they will be transferred to OFBiz01 server where ofbiz instance is running.
4) Database Server:
The following configuration changes need to be done in my.cnf file:
slow_query_log = 1 log_slow_queries = 1 long_query_time = 3 log_output = TABLE expire_logs_days = 2 innodb_buffer_pool_size = 10G innodb_lock_wait_timeout = 300 max_connections=1000 innodb_io_capacity=4000 innodb_read_io_threads=16 innodb_write_io_threads=16 innodb_additional_mem_pool_size=64M query_cache_type=OFF open_files_limit=4000 thread_cache_size=64 table_open_cache=700 back_log=1000 query_cache_limit=128M query_cache_size=256M connect_timeout=15 innodb_purge_threads=1 innodb_flush_method=O_DIRECT innodb_file_per_table = 1
5) Jmeter Server:
Running the scripts
Once we have the required hardware configuration, we run JMeter scripts with large number of threads spread equally across two or more different users on the same machine.
We have worked with both designs and found that Design 2 is the better option for the load testing on the Amazon cloud.
Thanks for your time!