Blog O' Matty


Creating a Veritas Volume Manager volume from a plex

This article was posted by Matty on 2006-05-17 10:35:00 -0400 -0400

While cleaning up my Veritas VxVM notes this week, I came across one of my cheat sheets for creating volumes from plexes. This can be useful when you want to perform an offline backup of the data on an alternate server, or when you want to grab a spare copy of data prior to performing a major change. To create a new volume from a plex, you will first want to stash a copy of the vxprint output somewhere:

$ /usr/sbin/vxprint -hmQq > HOME/vxprint.restore

Once you make a backup, you will want to run the human consumable form of vxprint to see which devices are available:

$ /usr/sbin/vxprint -hft

Disk group: oradg

DG NAME NCONFIG NLOG MINORS GROUP-I
ST NAME STATE DM_CNT SPARE_CNT APPVOL_CNT
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
CO NAME CACHEVOL KSTATE STATE
VT NAME NVOLUME KSTATE STATE
V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO

dg oradg default default 10000 1127240283.19.winnie

dm c1t1d0 c1t1d0s2 auto 2048 35521408 -
dm c1t2d0 c1t2d0s2 auto 2048 35521408 -
dm c1t3d0 c1t3d0s2 auto 2048 35521408 -
dm c1t4d0 c1t4d0s2 auto 2048 35365968 -
dm c1t5d0 c1t5d0s2 auto 2048 35521408 -
dm c1t6d0 c1t6d0s2 auto 2048 35521408 -

v oravol01 - ENABLED ACTIVE 20971520 SELECT - fsgen
pl oravol01-01 oravol01 ENABLED ACTIVE 20971776 STRIPE 3/128 RW
sd c1t1d0-01 oravol01-01 c1t1d0 0 6990592 0/0 c1t1d0 ENA
sd c1t2d0-01 oravol01-01 c1t2d0 0 6990592 1/0 c1t2d0 ENA
sd c1t3d0-01 oravol01-01 c1t3d0 0 6990592 2/0 c1t3d0 ENA
pl oravol01-02 oravol01 ENABLED ACTIVE 20971776 STRIPE 3/128 RW
sd c1t4d0-01 oravol01-02 c1t4d0 0 6990592 0/0 c1t4d0 ENA
sd c1t5d0-01 oravol01-02 c1t5d0 0 6990592 1/0 c1t5d0 ENA
sd c1t6d0-01 oravol01-02 c1t6d0 0 6990592 2/0 c1t6d0 ENA

After you locate the plex you want to turn intoa volume, you will need to disassociate it from the volume with the vxplex utility:

$ vxplex dis oravol01-02

Once the plex has been disassociated, you can then turn it into a volume with the vxmake utility:

$ vxmake -U gen vol oravol02 plex=oravol01-02

After the volume is created, you can start it and mount it just like all of the other volumes on your server:

$ vxvol start oravol02

$ mount -F vxfs /dev/vx/dsk/oradg/oravol02 /mnt

$ ls -la /mnt

total 8388690
drwxr-xr-x 3 root root 8192 Oct 30 21:01 .
drwxr-xr-x 37 root root 1024 Oct 27 12:27 ..
drwxr-xr-x 2 root root 96 Oct 27 12:25 lost+found
-rw------T 1 root root 1073741824 Oct 30 20:59 oradata01.dbf
-rw------T 1 root root 1073741824 Oct 30 21:00 oradata02.dbf
-rw------T 1 root root 1073741824 Oct 30 21:01 oradata03.dbf
-rw------T 1 root root 1073741824 Oct 30 21:03 oradata04.dbf

This is a nifty feature, and now that Veritas Volume Manager and File System are free (thanks for the link CW!), you can test it out in your favorite lab!

Concert review Guns N' Roses

This article was posted by Matty on 2006-05-16 18:57:00 -0400 -0400

I ventured to New York City this past weekend to see Guns N’ Roses. If you haven’t been to New York, you are missing out! The city streets are full of life, everyone is racing through the city at a furious pace, and the sites (e.g., Empire State Building, Greenwich Village, Museum of Modern Art, Statue of Liberty, Wall Street, etc.) are like nothing I have experienced before. But the real fun occurred Sunday night, when we showed up at the Hammerstein ballroom to see Axl Rose take the stage for the second night of his four night stint at the Hammerstein ballroom.

Axl Rose took the stage at 11:02pm, and bellowed out an amazing version of “Welcome to the Jungle” to start the show. Axl and his band then proceeded to play a wide variety of hits including “Paradise City,” “November Rain,” “Patience,” “My Michelle,” “Mr. Brownstone,” “Nightrain,” and my personal favorite “Sweet Child O’ Mine.” I was definitely stoked that Axl showed up, since he has a past history of getting pissed and not showing up for concerts. The show was absolutely amazing, the folks we met in line were cool as s@!*, and the entire New York experience was incredible. If New York was cheaper, I would move there tomorrow!

Benchmarking Solaris and Linux systems with sysbench

This article was posted by Matty on 2006-05-11 01:13:00 -0400 -0400

With numerous companies and individuals moving to virtualized environments (e.g., VMWare, Solaris containers, Xen, etc), it is important to understand the costs associated with doing so. How do you measure the cost savings and overhead associated with a virtualization layer? Calculating cost savings is easy (especially if you have had a few accounting or finance courses), since it is relatively easy to figure out the costs associated with ongoing operations, data center space, and power and cooling. But measuring the impact from the virtualization layer itself is somewhat difficult, especially since virtualization companies don’t publish meaningful data to show the overhead associated with a given virtualization technology.

Since I think virtualization is the wave of the future, I decided to poke around google to find a set of tools that could help me measure the impact of a given virtualization technology. After a bit of searching, I came across a nifty piece of software called sysbench. sysbench can be used to measure system and application throughput, and includes tests to measure CPU throughput, memory bandwidth, mutexes, file I/O, scheduler performance, and OLTP transaction throughput. sysbench is a snap to setup*, and the documentation contains numerous examples to show the options available to each test. The first thing most folks are interest in is the speed of a given microprocessor. Sysbench comes with a “cpu” test to measure the CPU speed of a given server, and it can be accessed by passing the keyword “cpu” to sysbench’s “–test” option:

$ /opt/sysbench/bin/sysbench --test=cpu run

sysbench v0.4.6: multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark

Threads started!
Done.

Maximum prime number checked in CPU test: 10000


Test execution summary:
total time: 39.4249s
total number of events: 10000
total time taken by event execution: 39.4209
per-request statistics:
min: 0.0039s
avg: 0.0039s
max: 0.0041s
approx. 95 percentile: 0.0039s

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 39.4209/0.00

sysbench also has a super useful memory benchmark built-in, which is accessed by passing the “memory” keyword to the “–test” option:

$ /opt/sysbench/bin/sysbench --test=memory run


sysbench v0.4.6: multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing memory operations speed test
Memory block size: 1K

Memory transfer size: 102400M

Memory operations type: write
Memory scope type: global
Threads started!
Done.

Operations performed: 104857600 (697855.14 ops/sec)

102400.00 MB transferred (681.50 MB/sec)


Test execution summary:
total time: 150.2570s
total number of events: 104857600
total time taken by event execution: 114.9915
per-request statistics:
min: 0.0000s
avg: 0.0000s
max: 0.0033s
approx. 95 percentile: 0.0000s

Threads fairness:
events (avg/stddev): 104857600.0000/0.00
execution time (avg/stddev): 114.9915/0.00

sysbench also has a built-in test to benchmark the performance of the Operating System scheduler, and it is accessed by passing the “threads” keyword to the “–test” option:

$ /opt/sysbench/bin/sysbench --test=threads run

sysbench v0.4.6: multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing thread subsystem performance test
Thread yields per test: 1000 Locks used: 8
Threads started!
Done.


Test execution summary:
total time: 7.6939s
total number of events: 10000
total time taken by event execution: 7.6898
per-request statistics:
min: 0.0007s
avg: 0.0008s
max: 0.0034s
approx. 95 percentile: 0.0008s

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 7.6898/0.00

These tests are interesting, but the best thing about sysbenhc is it’s ability to simulate read intensive and read/write intensive OLTP workloads against any of the major databases. To issue a read-intensive workload against a MySQL database, the “oltp” test can be used (you need to run the ‘prepare’ command to setup the database prior to running the test):

$ /opt/sysbench/bin/sysbench --test=oltp --oltp-test-mode=simple --num-threads=16 --max-requests= 1000000 --oltp-table-size=10000000 --mysql-socket=/tmp/mysql.sock --mysql-user=loadtest --mysql-password=loadtest --mysql-db=loadtest run


Running the load test ...

sysbench v0.4.6: multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 16

Doing OLTP test.
Running simple OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 1000000
Threads started!
Done.

OLTP test statistics:
queries performed:
read: 1000000
write: 0
other: 0
total: 1000000
transactions: 1000000 (36216.40 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 1000000 (36216.40 per sec.)
other operations: 0 (0.00 per sec.)

Test execution summary:
total time: 27.6118s
total number of events: 1000000
total time taken by event execution: 402.0923
per-request statistics:
min: 0.0000s
avg: 0.0004s
max: 1.1231s
approx. 95 percentile: 0.0001s

Threads fairness:
events (avg/stddev): 62500.0000/4939.18
execution time (avg/stddev): 25.1308/0.77

There are tons of options to control each of the tests listed above, and I have found it super useful comparing the results from an Operating System running on raw hardware with that of an Operating System running in a virtualized environment.

The fileio test bombs out due to the use of random() in sb_rand(). If you are interested in using the fileio test, you can email me for a patch to address the issue (I sent the patch to the sysbench maintainers).

Measuring website latency

This article was posted by Matty on 2006-05-07 21:11:00 -0400 -0400

While reading a slew of information on web application monitoring, I came across echoping. This nifty little utility allows you to measure the time it takes to ping a server, perform an SMTP exchange with a mail server, or to request a URI from a web server. The following example uses the echoping “-h” (URI to fetch) option to measure the time it takes to request a URI from the prefetch.net web server:

$ echoping -v -4 -h /code/ssl-cert-check prefetch.net:80

This is echoping, version 5.2.0.

Trying to connect to internet address 66.148.84.65 80 to transmit 111 bytes...
Trying to send 256 bytes to internet address 66.148.84.65...
Connected...
TCP Latency: 0.025887 seconds
Sent (111 bytes)...
Application Latency: 0.032952 seconds
7075 bytes read from server.
Elapsed time: 0.092921 seconds

To measure the time it takes to complete an SMTP transaction with mail.prefetch.net, smokeping’s “-S” (perform SMTP exchange) option can be used:

$ echoping -v -4 -S mail.prefetch.net

This is echoping, version 5.2.0.

Trying to connect to internet address 206.222.17.179 25 to transmit 6 bytes...
Trying to send 256 bytes to internet address 206.222.17.179...
Connected...
TCP Latency: 0.051737 seconds
Sent (6 bytes)...
Application Latency: 0.052778 seconds
30 bytes read from server.
Elapsed time: 0.107167 seconds

echoping supports TLS and SSL, and the data generated by echoping can be graphed with cacti or smokeping.

Linux LVM silliness

This article was posted by Matty on 2006-05-03 21:50:00 -0400 -0400

While attempting to create a 2-way LVM mirror this weekend on my Fedora Core 5 workstation, I received the following error:

Not enough PVs with free space available for parallel allocation. Consider –alloc anywhere if desperate.

Since the two devices were initialized specifically for this purpose and contained no other data, I was confused by this error message. After scouring Google for answers, I found a post that indicated that I needed a log LV for this to work, and the log LV had to be on it’s own disk. I am not sure about most people, but who on earth orders a box with three disks? Ugh!