In the previous article, I provided an introduction to nload, covering some background, installation, and basic usage. Here, I’ll build on that information and show some specific examples of using nload with various options.
Runtime Options
You can launch nload with a number of options, so let’s explore some of those now.
Previously, I discussed the effect of making changes to the “refresh interval” and “traffic averages” settings. The setting which you probably shouldn’t drop much lower than the default — for fear of losing accuracy — is the -t option, which affects the “refresh interval.” If you decide to do so, then you can move away from the default 50 milliseconds to using a quarter of a second (250 milliseconds) by launching nload with this option:
# nload -t 250
When it comes to “traffic averages,” we can adjust the period used in the calculations by using the -a option as follows. Note that this value is in fact in seconds and not milliseconds, and it defaults at five minutes (300s).
# nload -a 60
Consider another option now. Picture the scene: your Internet connection is via a gigabit network link but your ISP only allows you to use 100Mbit of that connection. Any network tool querying your network link will see a gigabit link speed as being available. Clearly, however, this is not of any use to you. The clever nload tool lets you configure the throughput ceiling, which you will monitor. As you continue to use the tool, do bear in mind that you’ve altered this setting just in case you see unusual spikes above that ceiling. Otherwise, it’s as simple as altering the setting like this:
# nload -i 100000
The “100000” value above is in kilobits-per-second (as scaling settings in nload generally are) and represents 100Mbit if my calculator is working properly. Note that the -i option is only for inbound (ingress) traffic, and the -o option is for outbound (egress) traffic.
On that note, should you wish to alter the default unit of measurement for traffic (as I almost always do when moving between different network capacities), then you can launch nload in a variety of differing ways. Here is an example of making nload use kilobits-per-second (kbps) units by using the -u option:
# nload -u k
In the case of nload and the above example, there’s actually no need to run that command, because that’s the default setting (“kbps” is a very good choice on all but very fast networks in my opinion).
Looking at Table 1, we can see the other available options for unit measurements.
Bits |
Bytes |
Throughput units of measurement |
h |
H |
Human readable formatted (otherwise known as auto mode) |
b |
B |
Bits per second or Bytes per second |
k |
K |
Kilobits per second or Kilobytes per second (the default is “k” or “kbps”) |
m |
M |
Megabits per second or Megabytes per second |
g |
G |
Gigabits per second or Gigabytes per second |
Table 1: Unit measurement traffic throughput options.
Let’s continue looking at another group of runtime options available to nload. Along the same vein as our unit measurements, in terms of network throughput, we can also change how the amount of data transferred is presented to you.
In Table 2, we can see the possible upper and lowercase options. Note that this time we use the uppercase -U option to effect transfer data measurements and that the Bytes and Bits columns are in a different order due to the default setting being for megabytes (or “M”). This is almost the same as Table 1, but there’s no per-second measurement as it relates to file sizes essentially.
Bytes |
Bits |
Data transfer units of measurement |
H |
h |
Human readable format (auto mode) |
B |
b |
Bytes of data or bits of data |
K |
k |
Kilobytes of data transferred or kilobits |
M |
m |
Megabytes of data or megabits of data |
G |
g |
Gigabytes of data transferred or gigabits |
Table 2: The available nload data transfer unit measurement options.
For clarity, here’s a quick example of altering the data transfer measurement:
# nload -U K
This option changes moves off the default megabytes to displaying data collection values in kilobytes.
Live Options
There are also a few commands which you can use while nload is running.
I mentioned having more than one device displayed on the console at once but you additionally have the ability to quickly move between devices. You can do this by simply pressing the Left and Right arrow keys (the cursor keys) on your keyboard. You won’t get lost because the number of windows available to you are paginated. How many pages can be accessed and which page you are currently on is dutifully displayed at the top of the window. Alternatively, you can achieve the same functionality by hitting the Enter key or the Tab key to cycle through the network interfaces visible to your machine.
As shown previously, the available options are displayed in a box at the top of the console. To toggle this Options Window on and off, you can simply hit the F2 key. To move around the Options Window, thankfully, there’s not much to learn; it’s very intuitive. Simply use the cursor keys on your keyboard to move around the box. Once you’re over the setting you want to adjust, simply use the plus and minus keys on your keyboard to increment and decrement the setting. Once you’re happy with your selections, just hit the F2 key again to hide the Options Window.
If you make a mistake and your display isn’t as you would like, then you can load up any saved settings (we’ll look at this in a moment) by using the F6 key. If you’ve hit the sweet spot with your config settings and want to overwrite your saved config file, then it’s as simple as hitting the F5 key.
I have to admit that I got the F5 and F6 keys the wrong way around at first (probably because I associate the F5 key with reloading a browser’s page). Just create a backup of your saved config to an unrelated filename if you’re worried that you’ll do this and lose configs.
If you wanted to quit nload, then you can either reach for the ever-present Ctrl+C key combination or additionally simply hit the lowercase “q” key.
Saved Config
There are two main files that nload uses for saving its config. The system-wide configuration file is called /etc/nload.conf. We can affect all users by editing options within this file, as opposed to an individual user’s settings. To change options for an individual, it’s as simple as creating and editing a file in your home directory such as:
# pico -w /home/chrisbinnie/.nload
Follow the options that we’ve discussed and any in the system-wide config file to populate this file.
Troubleshooting
Fear not if you get stuck. In addition to running this command below, there are of course other routes to receiving assistance:
# nload --help
There’s a useful mailing list available where you could ask questions, and archives of previous mailing list discussions are also available. The useful netiquette applies. Be courteous and respectful, and don’t expect every list member to immediately jump to your rescue if you haven’t made any efforts yourself.
Summary
Watching the mighty nload in action can be a bit mesmerizing at times. And, running it alongside other console windows nload is a real lifesaver. During periods of heightened stress, it launches almost instantly, and you can usually easily discern the required information.
I hope it goes without saying that I recommend trying nload a few times before an outage or other stressful interlude. Having your boss lean over your shoulder and witness your lack of understanding of your tool during a problem is not ideal, I’m sure you’ll agree.
When you are awakened at 4am and can glean the pertinent information from nload with no effort at all — you will be glad you tried it out beforehand.
Chris Binnie is a Technical Consultant with 20 years of Linux experience and a writer for Linux Magazine and Admin Magazine. His new book Linux Server Security: Hack and Defend teaches you how to launch sophisticated attacks, make your servers invisible and crack complex passwords.
Advance your career in system administration! Check out the Essentials of System Administration course from The Linux Foundation.