Cluster_RW

This sample demonstrates how to tune read-write workload on a per-thread basis. For each thread the following parameters are specified to tune performance (see thr_p in main.c):

node_id: on which node the thread will run

write_percent: the ratio of write/read operations

table_mask: an integer bit mask indicating which of the 8 tables (classes) to write/read (with a values 0x1, 0x2,..,0x40, 0x80 to indicate classes T1, T2,..,T7,T8 etc. See schema.mco for table definitions.)

trans_len: number of operations to perform in each transaction

priority: the transaction priority

navigation: the method of navigation to use:

SEARCH: performs _find() to access objects

SEQ_ASC: performs _cursor_next() with min_key, max_key and key_step

SEQ_DESC: performs _cursor_prev() with min_key, max_key and key_step

After completion the application prints out the number and rate of operations per thread, per node, and total.

How to Run

In a console window run:

 
    cluster_rw 2 0
     

Then in a second console window run:

 
    cluster_rw 2 1
 

But it is more instructive to run one instance in your development environment debugger, stepping through the code.

Related Topics Link IconRelated Topics