Testing Disk in Linux using fio

I recently discovered a utility called fio that allows you to benchmark disk subsystem in Linux. Here are the results for this test.
What is fio?

fio is an I/O tool meant to be used both for benchmark and stress/hardware verification. It has support for 13 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more. It can work on block devices as well as files. fio accepts job descriptions in a simple-to-understand text format. Several example job files are included. fio displays all sorts of I/O performance information. Fio is in wide use in many places, for both benchmarking, QA, and verification purposes. It supports Linux, FreeBSD, NetBSD, OS X, OpenSolaris, AIX, HP-UX, and Windows.

Windows fio download:  http://www.bluestop.org/fio/
OS – Debian Linux “Wheezy” AMD64
RAM – 8GB
Virtualized – YES
VMware Tools – YES
Disk – 1 x 50GB Thin Provisioned
Test File – 10GB
Note:  Disk is on a LUN that is comprised of RAID5 using 6 disks @ 15kRPM – no throttling for disk/cpu is configured on VM.

 
Here are my fio test files:

[randrw]
rw=randread
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=randr-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=randread
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=randr-8k
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=randrw
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=randrw-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=randrw
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=randrw-8k
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=randwrite
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=randw-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=randrw
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=random-rw-direct
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=read
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqr-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=read
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqr-8k
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=rw
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqrw-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=rw
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqrw-8k
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=write
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqw-4k
bs=4k
runtime=30
write_iops_log
write_lat_log
write_bw_log
[randrw]
rw=write
size=10G
direct=1
directory=/tmp/
numjobs=1
group_reporting
name=seqw-8k
bs=8k
runtime=30
write_iops_log
write_lat_log
write_bw_log

I used fio_generate_plot to generate gnuplot graphs.

Cacti Cisco ASA Host Template

Came across a decent host template for Cisco ASA devices that works well with Cacti.
Grab the CISCO-FIREWALL-MIB if you don’t already have them.  Get either Version 1 or Version 2 directly from Cisco and also get CISCO-SMI Version 1 or Version 2:

Determine where your MIBs are stored on your linux system:

linuxhost:~# snmptranslate -Dinit_mib .1.3|grep MIBDIRS
init_mib: Seen MIBDIRS: Looking in [...snip...] for mib dirs ...

You can use wget to download the MIB file version you want and specify where to save it according to one of the paths in the MIBDIRS output…  I like putting them in /usr/share/snmp/mibs.  Make sure the directory exists, if it doesn’t, just issue the following command:

linuxhost:~# mkdir -p /usr/share/snmp/mibs

Now, download the each of the MIBs (CISCO-FIREWALL-MIB and CISCO-SMI).   Use the above links to get a direct link.  I’m getting Version 2 of each of the MIBs.

linuxhost:~# wget -d -O /usr/share/snmp/mibs/CISCO-FIREWALL-MIB "ftp://ftp.cisco.com/pub/mibs/v2/CISCO-FIREWALL-MIB.my"
linuxhost:~# wget -d -O /usr/share/snmp/mibs/CISCO-SMI "ftp://ftp.cisco.com/pub/mibs/v2/CISCO-SMI.my"

After it’s downloaded, run a test on the server and see if you can poll an ASA in your network.  I’ll test the ConnectionStat entry:

linuxhost:~# snmpwalk -m +CISCO-FIREWALL-MIB  -c public -v 2c 192.168.9.253 -OS ConnectionStat
CISCO-FIREWALL-MIB::cfwConnectionStatDescription.protoIp.currentInUse = STRING: number of connections currently in use by the entire firewall
CISCO-FIREWALL-MIB::cfwConnectionStatDescription.protoIp.high = STRING: highest number of connections in use at any one time since system startup
CISCO-FIREWALL-MIB::cfwConnectionStatCount.protoIp.currentInUse = Counter32: 0
CISCO-FIREWALL-MIB::cfwConnectionStatCount.protoIp.high = Counter32: 0
CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp.currentInUse = Gauge32: 113
CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp.high = Gauge32: 508

It works without errors!
Notice you must specify the CISCO-FIREWALL-MIB using the -m +CISCO-FIREWALL-MIB argument.
To make this load automatically, modify your snmp.conf file.  This is typically located in /etc/snmp/snmp.conf on Sys-V systems;  To figure out where snmp reads it’s configuration file from, issue the following:

linuxhost:~# net-snmp-config --snmpconfpath
/etc/snmp:/usr/share/snmp:/usr/lib/snmp:/root/.snmp:/var/lib/snmp

This shows it checks each of those paths, in order, until it finds the snmp.conf;  So, modify your snmp.conf file and add the following line: mibs +CISCO-FIREWALL-MIB

There may be an existing line mibs : — you can remove the colon and replace it with +CISCO-FIREWALL-MIB.
Next, run the snmpget command without the -m +CISCO-FIREWALL-MIB”and you should have success and no errors.
To get this setup in Cacti, log in to your cacti server as admin. In the console tab, navigate to the “Import Templates” menu item and click on it.

Download the Host Template zip file (from original site http://forums.cacti.net/download/file.php?id=7607 ).
Extract the files to your desktop or wherever.
In the Import Templates window, click “Browse…” and choose the cacti_host_template ZIP file to import.

You are now done.
You can create a new device and choose the Cisco ASA – Security Device from the host templates now.

Basic Samba Setup on Debian Squeeze

Notes on how I setup Samba on a test server to play around. This was a quick setup to give a basic outline of how to get this running. This may not be very secure, or secure at all, so please use caution!
Install
I don’t need extra stuff (like printing capability, etc.) so I will disable suggested/recommended packages.

vim.tiny /etc/apt/apt.conf.d/70debconf

Append following:

APT::Install-Recommends "0";
APT::Install-Suggest "0";

Save file.

apt-get update
apt-get install samba samba-common-bin

Configure
Generate samba password for existing Linux user:

smbpassword -a username

If no existing Linux user, create user then set samba password:

useradd -c username "John Doe"
smbpasswd -a username
mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
vim.tiny /etc/samba/smb.conf

Contents of smb.conf:

# Global config
[global]
       workgroup = techish.local
       netbios name = SPROCKET
       server string = File server
       map to guest = Bad User
       log file = /var/log/samba/log.%m
       max log size = 15
       socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
       preferred master = No
       local master = No
       dns proxy = No
       security = User
# Shares
[Tmp]
       path = /tmp
       read only = No
[homes]
       path = /home/%u
       writable = yes
       browseable = no

Start/Restart Samba

/etc/init.d/samba stop
/etc/init.d/samba start

Test
Browse to the IP address of that server 1.2.3.4 from your Windows machine and confirm everything works.