I need to be able to write a batch script to do load testing on a server on the network. I need it to beh开发者_如何学Pythonave as multiple pcs polling the server. If I go into a little detail when I run the script it should ask me how many instances to create, server ip on the network, and the poll time. so e.g. if i enter 100 instances in the console and 2 mins poll time, it should create that many instances that all poll the server after every 2 mins. I have new idea how to write batch scripts and need some guidance into how to achieve it. Any help will be highly appreciated.
I'm only guessing this is a web server. in that case try:
Seige - a load testing and benchmark utility. You can feed it your apache logs and it will "replay" them to create load based on real traffic patterns.
or Apache Bench from the Apache web server project give a good indicator of pages / second for a URL.
JMeter is a very feature full benchmark suite in Java. We use this in EC2 to generate massive load for your web server projects.
You're going to have to provide more details, for starters, the platform (Linux, Windows ?)
Then, look for some batch tutorials on the net.
However, batch files are simply a matter of listing your commands one after the other.
Your input is normally referenced as $1, $2 in the bash shell(or %1, %2 in windows shell).
For example: myecho Hello World
echo $1
sleep 30
echo $
Then you need to figure out how to 'poll' the server and run those command in your shell.
精彩评论