Friday, April 30, 2010
Installation and usage of netperf
What ever iam providing here is a simple installation procedure and a small examples.
$wget ftp://ftp.netperf.org/netperf/netperf-2.4.5.tar.bz2
$./configuration
$make
$su
#make install
There is a latest version is availabel but i got some issues after installation and went back to this version insted of debugging. (Lack of time).
For simple test run
#netserver
This will run netperf server, this first time run at local machine.
Now run
#netperf
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost.localdomain (127.0.0.1) port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.01 3684.63
Now these are the statistics when server and client are running on same machine.
Lets try on remote machine(192.168.2.190).
[root@remote net]#netserver
Starting netserver at port 12865
Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC
Now server is ready and starting client at local machien is required.
[root@localhost net]# netperf -H 192.168.2.196
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.2.196 (192.168.2.196) port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.23 94.15
Oh!! throughput 94.15 ofcource expected value will be less compared to localhost.
There is lot of options available with this.
Saturday, March 6, 2010
Dead Donkey.. Nice one...
City boy, Raj, moved to the village and bought a donkey from an old farmer for Rs.1000. The farmer agreed to deliver the donkey the next day.
The next day the farmer drove up and said, "Sorry Raj-ji, but I have some bad news. The donkey died while I was bringing him here."
Raj replied: "Well then, just give me my money back."
The farmer said: "Can't do that either. I went and spent it already."
Raj said: "OK then, just unload the donkey."
The farmer asked: "What you are going to do with a dead donkey?!"
Raj: "I'm going to raffle him off." (Note: Raffle is like lottery - a group of people draw lots each paying the same amount for a ticket and there is a big prize for the people who win.)
Farmer: "You can't raffle off a dead donkey!"
Raj: "Sure I can. Watch me. I just won't tell anybody he's dead."
A month later the farmer met up with Raj and asked, "What happened with that dead donkey?"
Raj: "I raffled him off. I sold 500 tickets at Rs.10 each and made a profit of Rs.4990 with the donkey worth Rs.1000 as the prize."
Farmer: "Didn't anyone complain?"
Raj: "Just the guy who won. So I gave him back his Rs.10"
Wednesday, February 10, 2010
Install cpulimit
Install cpulimit
Type the following commands to install latest stable release:# cd /tmp
# wget 'http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz'
# tar -zxvf cpulimit-1.1.tar.gz
# cd cpulimit-1.1
# make
# cp cpulimit /usr/local/sbin/
# rm -rf cpulimit*
A note about Debian / Ubuntu Linux users
Type the following command to install cpulimit:$ sudo apt-get update
$ sudo apt-get install cpulimit
How do I use cpulimit?
To limit CPU usage of the process called firefox to 30%, enter:# cpulimit -e firefox -l 30
To limit CPU usage of the process to 30% by using its PID, enter:# cpulimit -p 1313 -l 30
To find out PID of the process use any of the following:# ps aux | less
# ps aux | grep firefox
# pgrep -u vivek php-cgi
# pgrep lighttpd
You can also use absolute path name of the executable, enter:# cpulimit -P /opt/firefox/firebox -l 30
Where,
- -p : Process PID.
- -e : Process name.
- -l : percentage of CPU allowed from 0 to 100.
- -P: absolute path name of the executable program file.