-
Notifications
You must be signed in to change notification settings - Fork 32
Netperf
This test module provides you with an easy way to use the netperf utility with LNST. It is required that machines where this module will be run have this utility installed. The netperf utility is used to measure the network performance between two separate machines. This test therefore requires the use of at least two machines, and to use it properly you will need to run two commands.
The purpose of this test module is quite obvious - measuring the network performance.
This test module accepts these options:
role
|
mandatory | accepted values are: client or server. This option determines the role of the slave machine this test is being run on. |
duration
|
optional | in seconds, specifies how long will the test be running. By default it is set to 10 seconds for the client, and unlimited for the server. |
threshold
|
optional | in [kMGT]bits/sec or [kMGT]bytes/sec or trans/sec ( e.g. 1.2 Mbits/sec or 1.2 Mbytes/sec) determines the lowest network performance throughput needed or transactions per second for the test to succeed. The default value is 0 bits/sec. |
threshold_deviation
|
optional | in [kMGT]bits/sec or [kMGT]bytes/sec or trans/sec ( e.g. 1.2 Mbits/sec or 1.2 Mbytes/sec) represents the deviation of the threshold, this is so that we can compare results against baselines with intervals. |
max_deviation
|
optional | in absolute or relative (in percent) units relevant for the executed test (e.g. 10% or 1000 kbits/sec - using the same format as threshold). If the measured results have a deviation greater than defined by this option the result is automatically marked as FAILed even though comparison against the threshold would pass. |
netperf_opts
|
optional | gives you the ability to provide any additional arguments that should be passed to the netperf or netserver command. |
netperf_server
|
mandatory for role=client | expects an IP address or the hostname of the machine where a netserver command is running. |
bind
|
optional | represents the argument -L, of the netserver utility, that determines on which address will the server be listening for incoming connections. This option can only be used when role=server. |
port
|
optional | represents the argument -p, of the netserver or netperf utility, that determines on which port will the server be listening or client connecting to. |
testname
|
optional | represents the argument -t of the netperf utility. Determines what test will be executed. The default value is TCP_STREAM. Supported tests are: TCP_STREAM, TCP_RR, UDP_STREAM, UDP_RR, SCTP_STREAM, SCTP_STREAM_MANY, SCTP_RR |
testoptions
|
optional | that specifies any test options for the test, e.g. message size. Anything that is specified after '--' in netperf command. |
confidence
|
optional | represents the argument -I of the netperf utility. Tells Netperf to try and reach the specified confidence. |
cpu_util
|
optional | allowed values are: local, remote, both. Adds the arguments -c and -C to the client command. local adds -c, remote adds -C and both adds both -c and -C. This will make Netperf measure CPU Utilization of the involved systems during the performance test. |
num_parallell
|
optional | controlls how many instances of the client should be run in parallel. The default value is 1. This option automatically disables the use of confidence since it doesn't make sense and instead standard deviation is calculated manually. Also adds the argument "-s 1" to the client command to attempt some kind of simultaneous start of the clients. |
runs
|
optional | controlls how many consecutive client runs should the module run. When confidence is used it sets the -i argument. Otherwise it does the runs manually and calculates standard deviation on its own. |
msg_size
|
optional | accepts a single integer value, adds the -m %d argument to the netperf client. command. This controls message size used by *_STREAM tests. |
debug
|
optional | accepts a single integer value. This adds a number of -d arguments to the netperf command, enabling different levels of dbug messages. |
As was mentioned earlier, you will need two machines and run two Netperf tests at the same time in order to use this module correctly. To clarify see the following command sequence:
<task>
<run module="Netperf" host="testmachine2" bg_id="server">
<options>
<option name="role" value="server"/>
<option name="bind" value="{ip(testmachine2, testifc2)}"/>
</options>
</run>
<run module="Netperf" host="testmachine1">
<options>
<option name="role" value="client"/>
<option name="netperf_server" value="{ip(testmachine2, testifc2)}"/>
</options>
</run>
<kill host="testmachine2" bg_id="server"/>
</task>
The first command will run the netperf utility in the role of the server, we also need to specify that it should bind to our testing interface. Since we want to run two commands at a time this command must be run as a background command (attribute bg_id).
Next we run the second command this time on a different machine, in the role of the client, and we direct him to where our server is listening.
To simplify the example we are not using any optional arguments but adding them should be fairly easy.
And finally, since we created a background command we add a corresponding kill command to clean-up.
The command sequence, from the previous section, can be used in a full recipe considering you modify the ids to match your environment specification.
A successful run of these commands will give you results similar to these:
2014-08-20 13:53:13 (localhost) INFO: Executing command: [type(test), module(Netperf), host(testmachine2), bg_id(server)]
2014-08-20 13:53:13 (localhost) INFO: Result: PASS
2014-08-20 13:53:13 (localhost) INFO: Status message from slave: "Running in background."
2014-08-20 13:53:13 (localhost) INFO: Executing command: [type(test), module(Netperf), host(testmachine1)]
2014-08-20 13:53:23 (localhost) INFO: Result: PASS
2014-08-20 13:53:23 (localhost) INFO: Result data:
2014-08-20 13:53:23 (localhost) INFO: msg: Measured rate: 189.97 Mbits
2014-08-20 13:53:23 (localhost) INFO: Executing command: [type(kill), host(testmachine2), bg_id(server)]
2014-08-20 13:53:23 (localhost) INFO: Result: PASS
2014-08-20 13:53:23 (localhost) INFO: Status message from slave: "Command killed."
2014-08-20 13:53:47 (testmachine1) INFO: Restoring system configuration
2014-08-20 13:52:42 (testmachine2) INFO: Restoring system configuration
2014-08-20 13:53:47 (testmachine1) INFO: Killing all forked processes.
2014-08-20 13:53:47 (testmachine1) INFO: Deactivating connection on device ens20
2014-08-20 13:53:47 (testmachine1) INFO: Restoring system configuration
2014-08-20 13:52:42 (testmachine2) INFO: Killing all forked processes.
2014-08-20 13:52:42 (testmachine2) INFO: Deactivating connection on device ens9
2014-08-20 13:52:42 (testmachine2) INFO: Restoring system configuration
2014-08-20 13:53:25 (localhost) INFO: ============================ SUMMARY ============================
2014-08-20 13:53:25 (localhost) INFO: recipes/examples/quick_guides/netperf_wiki.xml PASS
2014-08-20 13:53:25 (localhost) INFO: task: 1
2014-08-20 13:53:25 (localhost) INFO: host testmachine2: test Netperf bg_id: server PASS
2014-08-20 13:53:25 (localhost) INFO: message: Running in background.
2014-08-20 13:53:25 (localhost) INFO: host testmachine1: test Netperf PASS
2014-08-20 13:53:25 (localhost) INFO: msg: Measured rate: 189.97 Mbits
2014-08-20 13:53:25 (localhost) INFO: host testmachine2: kill id: server PASS
2014-08-20 13:53:25 (localhost) INFO: message: Command killed.
2014-08-20 13:53:25 (localhost) INFO: =================================================================