shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Stress test


From: Cleber J Santos
Subject: Re: [shell-script] Stress test
Date: Wed, 14 Jun 2006 15:27:46 -0300
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Será que isso ajuda?

fs-stress-olh.sh
#!/bin/bash
export PATH=
/bin/echo $$ > /dev/shm/bug42232-pid-$$
/bin/mkdir stress-root
cd stress-root

/bin/echo Setting up ...
for i in 0 1 2 3 4 5 6 7 8 9; do
for j in 0 1 2 3 4 5 6 7 8 9; do
for k in 0 1 2 3 4 5 6 7 8 9; do
/bin/echo -n "$i$j$k " >> onethousand
done
/bin/echo -n "$i$j " >> onehundret
done
/bin/echo -n "$i " >> ten
done
/bin/echo -n "0 1 2 3 4 5 6 7 8 9" > onethousand
for h in 0 1 ; do
for i in `/bin/cat onethousand`; do
/bin/mkdir $h$i
/bin/echo $h$i > ./$h$i/DIRNAME
for j in `/bin/cat onehundret`; do
/bin/mkdir $h$i/$j
/bin/echo $h$i/$j > ./$h$i/$j/DIRNAME
for k in `/bin/cat onehundret`; do
/bin/mkdir $h$i/$j/$k
/bin/echo $h$i/$j/$k > ./$h$i/$j/$k/DIRNAME
for l in `/bin/cat ten`; do
/bin/mkdir $h$i/$j/$k/$l
/bin/echo $h$i/$j/$k/$l > ./$h$i/$j/$k/$l/DIRNAME || /bin/kill -STOP `/bin/cat /dev/shm/bug42232-pid-*`
/bin/dd if=/dev/zero of=$h$i/$j/$k/$l/data bs=1024 count=1 &> /dev/zero
done
done
done
done
done

cd ..
/bin/rm -rf stress-root /dev/shm/bug42232-pid-$$


start_test.sh
#!/bin/bash
set -ex
cd /bug42232
test -x ~olh/bugs/42232/fs-stress-olh.sh
numcpus=`grep -Ec '^cpu[0-9]' /proc/stat`
for i in `seq 1 $numcpus`
do
(rm -rf $i ; mkdir -v $i; cd $i || exit 1 ; pwd ; nohup sh -c 'while date ; do ~olh/bugs/42232/fs-stress-olh.sh ; done' < /dev/null > logfile 2>&1 & )
done
sleep $numcpus
( tail --follow=name --retry --lines=42 ?/logfile & )



victorzanel wrote:

Alguem conhece algum shell script para realizar stress test em um servidor linux?






--
Cleber J Santos
---------------------
 _
°v°  address@hidden
/(_)\ 011 + 3120 - 4542
^ ^
O mundo ao seu redor só pode colaborar para que você se conheça melhor. Tudo
à sua volta é um reflexo daquilo que você acredita.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]