[sheepdog] [PATCH] sheep: use tx/rx thread for data transfer

Liu Yuan namei.unix at gmail.com
Thu Jul 12 09:34:39 CEST 2012


On 07/11/2012 05:10 PM, yaohaiting.wujue at gmail.com wrote:
> tx/rx are in main thead now. Then the tx/rx can not be done at the same
> time. The tx/rx will also delay the epoll event.
> 
> I use one thread for tx and one thread for rx. This improve the
> performance.

I have run a simple test to test your patch and mine with vanilla code
and no benefit is shown:

yours	mine	vanilla
67s	68s	65s

$./script.sh 4
=========================================
#!/bin/bash

pkill -9 sheep
pkill -9 collie

rm store/* -rf
nr=`seq 1 $1`
echo $nr
for i in `seq 0 7`; do sheep/sheep -d /home/tailai.ly/sheepdog/store/$i
-z $i -p $((7000+$i));sleep 1;done
collie/collie cluster format  -c 3
sleep 3

time1=`date +%s`
for i in $nr;do
collie/collie vdi create test$i 100M
done
sleep 1
for i in $nr;do
	dd if=/dev/urandom | collie/collie vdi write test$i -p 7000 &
done

echo wait for write to finish
for ((;;)); do
        if [ "$(pgrep collie)" ]; then
                sleep 1
        else
                break
        fi
done
time2=`date +%s`
echo $(($time2 - $time1))



More information about the sheepdog mailing list