Best speed is on
threads_count=
physical_cores_count
Following code generates random 64-char hex string and then starts bg processes and kills them after "$2" seconds.
Code:
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
let "thr = $(lscpu | grep -E '^CPU\(s\)' | sed 's/CPU(s)://' | sed s/' '//g) / 2"
# if you want to get more parallel processes uncomment following (or set 'thr' value as much as you want)
# thr = $(lscpu | grep -E '^CPU\(s\)' | sed 's/CPU(s)://' | sed s/' '//g)
blfname=$1 #your_bloom_filter_filename
tosleep=$2 #time_to_sleep
while 2>1
do
hexval=$(openssl rand $[32] | xxd -p -c32 | grep -E -o '.{64}$')
for n in $(seq 1 $thr)
do
./brainflayer -a -v -I $hexval -b $blfname -n $n/$thr -o out$n -m 1tab.tab &
done
sleep $tosleep
kill $(pgrep brainflayer | echo $(tr '\n' ' '))
done
Hope this helps