[asterisk-users] asterisk server stress test

Steve Edwards asterisk.org at sedwards.com
Wed Aug 19 12:07:32 CDT 2015


Please don't top post.

On Wed, 19 Aug 2015, James Cass wrote:

> Steve, would you be willing to share that "quick bash script"?

There's no magic in the script, but here it is, embarrassing myself:

         cp sample-call-file /tmp/
         chmod +x /tmp/sample-call-file
         for     I in $(seq 1 $1)
                 do
                 sudo -u asterisk\
                         cp /tmp/sample-call-file\
                         /var/spool/asterisk/outgoing/${RANDOM}
                 done
 	sleep 10

Here's what's wrong with this snippet:

1) I don't know why I chmod the 'template.' No idea whatsoever. Alcohol 
may have been involved.

2) I hate single character variable names. I love alcohol.

3) cp is ill advised. For a testing script, it was easy. For a production 
application, use mv.

In use, I would execute it specifying how many call files to create, like 
50. Then, take a look at top, iftop, and vmstat. Lather, rinse, repeat to 
get to your goal.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST



More information about the asterisk-users mailing list