C Client Setting number of threads


#1

Suppose I want to add about 80 threads and 60% of those threads perform write operation and 40% of them perform read operation. How can this be achieved. I know how it’s done via benchmark, for example, benchmarks -h 127.0.0.1 -p 3000 -n test -k 50000 -o S:50 -w RU,60 -z 80. I want to do exactly same via C Client. Can you give be pointers on this.


#2

The source code for the C client benchmarks is available. Just use a random number generator to decide between reads and writes.


#3

Ok thank you. Can you please elaborate more as I am bit lost. And I also came across the as_thread_pool.h in apidocs. It has datafield thread_size. What does that do? Is it same as creating threads similar to benchmark command or it serves different purpose.


#4

as_thread_pool is a thread pool with the number of running threads defined as thread_size. This thread pool is used by the client to run batch/scan/query commands to server nodes concurrently.