Using Primary/Replica modes to conduct tests on multiple instances of DB #328
-
I read in HammerDB documentation that it is possible to run tests on multiple instances of separate standalone Databases using Primary Replica modes or connect pooling. I am able to create multiple instances of HammerDB and connect replicas to a primary instance. Here is my confusion, when i load driver script from primary it gets copied to all replicas. My database instances are all running on separate VMs with different IP addresses. In the loading script I can provide only 1 IP address (IP address of 1 DB instance). How can I provide a different IP address to each HammerDB replica instance so that I can run tests on all of my instances in parallel? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Connect pooling can be thought of as a way for one HammerDB instance to connect to multiple database instances at the same time. This is typically for clusters so for example if you have a standby replica you can direct write traffic to the primary and read to the standby. Primary and replica is when you want separate instances of HammerDB to connect to the same or different instances. You don't mention whether you are using the GUI or CLI? In the GUI the distribute button and distributescript in the CLI will send the primary script to all of the replicas. In the CLI there is also an additional command to send one command to a specific replica, this is what is used by the step workload feature - see the example here: |
Beta Was this translation helpful? Give feedback.
-
Here is an example:
I also have a file called mariarun.tcl as follows:
I've then started 2 hammerdb instances and connected the replica to the primary and loaded our customscripts Primary
Replica
I now run mariarun.tcl on the Primary. This runs the commands in the script on both the Primary and the Replica (or Replicas), they connect to the different instances at the same time and run their workload. You can then see the performance on each instance from the Primary and Replica output. Primary
Replica
The connectpool option also reports client-side transaction rates. This is because some clusters (such as Oracle RAC) will correctly report cross-cluster transaction rates whereas others will not. |
Beta Was this translation helpful? Give feedback.
Here is an example:
The system has 2 MariaDB instances running locally so I'm using sockets to connect so one is on /tmp/mariadb.sock and the other /tmp/mariadb2.sock.
I've used the GUI locally to configure and save 2 driver scripts with my options mdbprim.tcl and mdbrep.tcl, this is the difference between them:
I also have a file called mariarun.tcl as follows:
I've then started 2 hammerdb instances and connected the replica to the primary and loaded our cust…