2.3. DarwinAs we saw in Chapter 1, Darwin was released as a fork of a developer release of the Rhapsody operating system, which was an immediate precursor to Mac OS X. An important component of Darwin is the Mac OS X kernel environment, which, together with the Darwin user environment, makes Darwin a stand-alone operating system. Until Apple announced the transition of Mac OS X to the x86 platform in mid-2005, Mac OS X had been a strictly PowerPC-only operating system. In contrast, Darwin has always been supported on both the PowerPC and the x86 platforms. 2.3.1. Darwin PackagesDarwin can be best understood as a collection of open source technologies that have been integrated by Apple to form a fundamental part of Mac OS X. It contains source code both from Apple and from third parties, including the Open Source and Free Software communities. Apple makes Darwin available as a set of packages, where each package is an archive containing source code of some component of Mac OS X. Darwin packages range from trivial ones such as Liby to gigantic ones such as GCC and X11. The exact number of packages in Darwin varies from release to release. For example, Darwin 8.6 (PowerPC)which corresponds to Mac OS X 10.4.6contains about 350 packages. Sources for Darwin components that originated at Apple are usually provided under the Apple Public Source License (APSL), which is a free software license.[6] The rest of the packages are provided under their respective licenses, such as the GNU General Public License (GPL), the BSD License, the Carnegie Mellon University License, and so on.
2.3.2. The Benefits of DarwinDarwin represents a substantial amount of software that Apple has leveraged from a variety of sources: NEXTSTEP and OPENSTEP, Mach, various BSD flavors (largely FreeBSD), the GNU software suite, the XFree86 project, and so on. More importantly, Apple has integrated such "external" software rather well, making important modifications to optimize and adapt it to Mac OS X. Even though you can configure and control most of this software as you normally would, say, on a traditional Unix system, Mac OS X provides simplified and mostly consistent user interfaces that usually work well by hiding the underlying complexity. Such efficiency in adopting technology from diverse sources, and integrating it to create a synergistic effect, is one of the great strengths of Mac OS X. 2.3.3. Darwin and Mac OS XIt is important to note that Darwin is not Mac OS X. It can be thought of as a subset of Mac OS Xessentially the low-level foundation upon which Mac OS X is built. Darwin does not include many proprietary components that are integral parts of Mac OS X, such as the Aqua look-and-feel, Carbon, Cocoa, OpenGL, Quartz, and QuickTime. Consequently, it also does not support key Apple software such as the iLife suite, iChat AV, Safari, and the Xcode development environment. Although Darwin lacks the visual technologies of Mac OS X, it is possible to run Darwin with the X Window System providing the graphical user interface. |
Monday, November 9, 2009
Section 2.3. Darwin
Summary
< Free Open Study > |
SummaryThe Software Engineering Institute's Capability Maturity Model (CMM) has listed software quality assurance (SQA) as a key process area since the institute's inception. Getting a SQAP (software quality assurance plan) is what this chapter presented. This is one of the basic but often overlooked processes all software development practitioners need to follow for successful software development projects. Software quality assurance involves the reviewing of all delivered software products and the activities within the life cycle that produced them. Auditing can be performed to ensure that the products and processes conform to the internal organization policies and procedures for software development as well as industry standards. The CMM lists four goals that must be achieved to satisfy this key process area:
This chapter has presented the mechanism for meeting those CMM goals in a efficient and cost-effective fashion. In the IEEE Standard Glossary of Software Engineering Terminology, software quality assurance is defined as: (1) a planned and systematic pattern of all actions necessary to provide adequate confidence that an item or product conforms to established technical requirements, and (2) a set of activities designed to evaluate the process by which products are developed or manufactured. The references at the end of this chapter have complete in-depth information on quality lessons from quality experts, personnel requirements, training plans, organizations for project quality, and calculating the cost of product and project quality. All of these are important quality issues of which professional software project managers should be aware. The focus of this book is on tools that practitioners can use. Therefore, this chapter discussed how to build an adequate SQAP, what checklists to employ, and where to find the information. Please see the references for the theoretical treatments of software quality assurance. When is it practical to build a SQAP? The authors of this book have found through experience that it is cost-effective to build a software quality assurance plan for any project that is estimated to take more than six person-months of effort to complete. |
< Free Open Study > |
11.6 Non-Uniform Memory Access Systems
| [ Team LiB ] |
11.6 Non-Uniform Memory Access SystemsNon-Uniform Memory Figure 11-5. Non-Uniform Memory Access (NUMA) configurationThis enables NUMA
Oracle has developed on multiple NUMA platforms to provide highly |
| [ Team LiB ] |
Will Solve Math Problems to Code
|
Example: Sorting Files with a Binary Search Tree
Example: Sorting Files with a Binary Search TreeA search tree is a common dynamic data structure requiring memory management. Search trees are a convenient way to maintain collections of records, and they have the additional advantage of allowing efficient sequential traversal. Program 5-1 implements a sort (sortBT, a limited version of the UNIX sort command) by creating a binary search tree using two heaps. The keys go into the node heap, which represents the search tree. Each node contains left and right pointers, a key, and a pointer to the data record in the data heap. The complete record, a line of text from the input file, goes into the data heap. Notice that the node heap consists of fixed-size blocks, whereas the data heap contains strings with different lengths. Finally, the sorted file is output by traversing the tree. This example arbitrarily uses the first 8 bytes of a string as the key rather than using the complete string. Two other sort implementations in this chapter (Program 5-4 and 5-5) sort keyed files, and Appendix C compares their performance. Figure 5-2 shows the sequence of operations for creating heaps and allocating blocks. The program code on the right is pseudocode in that only the essential function calls and arguments are shown. The virtual address space on the left shows the three heaps along with some allocated blocks in each. The figure differs slightly from the program in that the root of the tree is allocated in the process heap in the figure but not in Program 5-1. Note: Program 5-1 illustrates some techniques that simplify the program and would not be possible with the C library alone or with the process heap.
An implementation such as Program 5-1 is limited to smaller files when using Windows because the complete file and a copy of the keys must reside in virtual memory. The absolute upper limit of the file length is determined by the available virtual address space (3GB at most); the practical limit is less. With Win64, there is no such practical limit. Program 5-1 calls several tree management functions: FillTree, InsertTree, Scan, and KeyCompare. They are shown in Program 5-2. This program uses heap exceptions. An alternative would be to eliminate use of the HEAP_GENERATE_EXCEPTIONS flag and test directly for memory allocation errors. Program 5-1. sortBT: Sorting with a Binary Search Tree
Program 5-2 shows the functions that actually implement the search tree algorithms. FillTree, the first function, allocates memory in the two heaps. KeyCompare, the second function, is used in several other programs in this chapter. Notice that these functions are called by Program 5-1 and use the completion and exception handlers in that program. Thus, a memory allocation error would be handled by the main program, and the program would continue to process the next file. Program 5-2. FillTree and Other Tree Management Functions
Note: |
Start Troubleshooting at the Lowest Layer Possible
Start Troubleshooting at the Lowest Layer PossibleA majority of the time, performance issues are related to I/O. However, assuming that a given performance problem is I/O-based is grossly oversimplifying the problem. With any filesystem I/O, there are middle-layer tasks that require resources which may be the source of an I/O contention, such as the volume manager, the volume manager's striping, the filesystem, a multipath I/O driver, or something similar. When troubleshooting a performance problem, always try to simplify the problem by removing as many middle layers as possible. For example, if a particular filesystem is slow, focus your attention first on the disk block or character device performance before considering the volume manager and filesystem performance. Dissecting a volume with respect to physical device (aka LUN) or lvol into its simplest form is absolutely required when preparing to run any performance test or find a performance concern. In this section, we test the raw speed of a storage device by bypassing the filesystem and volume management layers. We bypass as many layers as possible by using a raw device, better known as a character device. A character device must be bound to a block device through the raw command. To describe "raw" with more detail would include the physical access to a block device bypassing the kernel's block buffer cache. Our first test performs a simple sequential read of a Logical Unit Number (LUN), which resides on a set of spindles, through a single path after we bind the block device to the character. We create a (LUN) character device because we want to test the speed of the disk, not the buffer cache. Note Today's large arrays define a data storage device in many ways. However, the best description is Logical Device (LDEV). When an LDEV is presented to a host, the device changes names and is referred to as a Logical Unit Number (LUN). The components used throughout this chapter for examples and scenarios include:
The tools for examining the hardware layout and adding and removing LUNs are discussed in Chapter 5, "Adding New Storage via SAN with Reference to PCMCIA and USB." Performance tools were fully discussed in Chapter 3, "Performance Tools," and are used in examples but not explained in detail in this chapter. As stated previously, this chapter's focus is strictly on performance through a system's I/O SCSI bus connected to SAN. Let's look at how to find and bind a block device to a character device using the raw command. Binding a Raw Device to a Block Device Using the raw CommandThe LUN, hereafter called disk, used throughout this example is /dev/sdj, also referred to as /dev/scsi/sdh6-0c0i0l2. Determine the capacity of the disk through the fdisk command: atlorca2:~ # fdisk -l Use lshw (an open source tool explained in more detail in Chapter 5) to show the device detail: atlorca2:~ # lshw Linux does not allow raw access to a storage device by default. To remedy this problem, bind the device's block device file to a /dev/raw/rawX character device file to enable I/O to bypass the host buffer cache and achieve a true measurement of device speed through the host's PCI bus (or other bus architecture). This binding can be done by using the raw command. Look at the block device for /dev/sdj: atlorca2:~ # ls -al /dev/sdj Take note of the permissions set on the device file brw-rw----. The b means block device, which has a major number 8, which refers to the particular driver in control. The minor number 144 represents the device's location in the scan plus the partition number. Refer to man pages on sd for more info. Continuing with our example, the next step is to bind the /dev/sdj to a raw character device, as depicted in the following: atlorca2:~ # raw /dev/raw/raw8 /dev/sdj Now, issue one of the following commands to view the binding parameters: atlorca2:~ # raw -qa or atlorca2:~ # raw -q /dev/raw/raw8 Raw Device PerformanceNow that we have bound a block device to a character device, we can measure a read by bypassing the block device, which in turn bypasses the host buffer cache. Recall that our primary objective is to measure performance from the storage device, not from our host cache.
Our next step requires that we measure a sequential read and calculate time required for the predetermined data allotment. Throughout this chapter, our goal is to determine what factors dictate proper performance of a given device. We focus on average service time, reads per second, writes per second, read sectors per second, average request size, average queue size, and average wait time to evaluate performance. In addition, we discuss the I/Os per second with regard to payload "block" size. For now, we start with a simple sequential read to get our baseline. Though a filesystem may reside on the device in question, as shown previously in the fdisk-l output, the filesystem cannot be mounted for the test run. If mounted, raw access is denied. Proceed with the following action as illustrated in the next section. Using the dd Command to Determine Sequential I/O SpeedThe dd command provides a simple way to measure sequential I/O performance. The following shows a sequential read of 1GB (1024MB). There are 1024 1MB (1024KB) reads: atlorca2:~ # time -p dd if=/dev/raw/raw8 of=/dev/null bs=1024k The megabytes per second can be calculated as follows: 1GB/6.77 sec = 151.25MBps For those who are unfamiliar with high-speed enterprise servers and disk storage arrays, 151MBps may seem extremely fast. However, higher speeds can be achieved with proper striping and tuning of the filesystem across multiple spindles. Though we discuss some of those tuning options later, we first need to reduce the previous test to its simplest form. Let us begin with calculating MBps, proceeding with the blocking factors on each I/O frame and discussing service time for each round trip for a given I/O. In the previous example, we saw 1024 I/Os, where each I/O is defined to have a boundary set to a block size of 1MB, thanks to the bs option on the dd command. Calculating MBps simply takes an arithmetic quotient of 1024MB/6.77 seconds, providing a speedy 151MB/sec. In our testing, cache on the array is clear, providing a nice 151MBps, which is not bad for a single LUN/LDEV on a single path. However, determining whether the bus was saturated and whether the service time for each I/O was within specifications are valid concerns. Each question requires more scrutiny. Note Different arrays require special tools to confirm that cache within the array is flushed so that a true spindle read is measured. For example, HP's largest storage arrays can have well over 100GB of cache on the controller in which a read/write may be responding, thereby appearing to provide higher average reads/writes than the spindle can truly provide. Minimum cache space should be configured when running performance measurements with respect to design layout. Using sar and iostat to Measure Disk PerformanceContinuing with the dd command, we repeat the test but focus only on the data yielded by the sar command to depict service time and other traits, as per the following. atlorca2:~ # sar -d 1 100 This sar output shows that the total number of transfers per second (TPS) holds around 300. rd_sec/s measures the number of read sectors per second, and each sector is 512 bytes. Divide the rd_sec/s by the tps, and you have the number of sectors in each transfer. In this case, the average is 1024 sectors at 512 bytes each. This puts the average SCSI block size at 512KB. This is a very important discovery; because the dd command requests a block size of 1MB, the SCSI driver blocks the request into 512 byte blocks, so two physical I/Os complete for every logical I/O requested. Different operating systems have this value hard coded at the SCSI driver at different block sizes, so be aware of this issue when troubleshooting. As always, more than one way exists to capture I/O stats. In this case, iostat may suit your needs. This example uses iostat rather than sar to evaluate the dd run. atlorca2:~ # iostat Calculating MBps from iostat can be achieved by calculating KB from blocks read per second (Blk_read/s) and multiplying them by the transactions per second (TPS). In the previous example, 311296 Blk_read/s / (303 tps) = 1027.3 blocks x 512 bytes/block = 526018 bytes / 1024 bytes/KB = 513KB avg. Before we explain the importance of the blocking size based on a given driver, let us demonstrate the same test results with a different block size. Again, we move 1GB of data through a raw character device using a much smaller block size. It is very important to understand that the exact same 1GB of data is being read by dd and written to /dev/null. Understanding the Importance of I/O Block Size When Testing PerformanceThe I/O block size can impact performance. By reducing the dd read block size from 1024k to 2k, the FCP payload of 2k and the SCSI disk (sd) driver can deliver about 1/16 of the performance. Additionally, the I/O rate increases dramatically as the block size of each request drops to that of the FCP limit. In the first example, the sd driver was blocking on 512k, which put the I/O rate around 300 per second. In the world of speed, 300 I/O per second is rather dismal; however, we must keep that number in perspective because we were moving large data files at over 100 MBps. Though the I/O rate was low, the MBps was enormous. Most applications use an 8K block size. In the following demonstration, we use a 2K block size to illustrate the impact of I/O payload (I/O size). atlorca2:~ # time -p dd if=/dev/raw/raw8 of=/dev/null bs=2k \ You can easily see that by simply changing the block size of a data stream from 1024k to 2k, the time it takes to move large amounts of data changes drastically. The time to transfer 1GB of data has increased 13 times from less than 7 seconds to almost 96 seconds, which should highlight the importance of block size to any bean counter. We can use sar to determine the average I/O size (payload). atlorca2:~ # sar -d 1 100| grep dev8-144 From the sar output, we can determine that 21868 rd_sec/s transpires, while we incur a tps of 5467. The quotient of 21868/5467 provides four sectors in a transaction, which equates to 2048 bytes, or 2K. This calculation shows that we are moving much smaller chunks of data but at an extremely high I/O rate of 5500 I/O per second. Circumstances do exist where I/O rates are the sole concern, as with the access rates of a company's Web site. However, changing perspective from something as simple as a Web transaction to backing up the entire corporate database puts sharp focus on the fact that block size matters. Remember, backup utilities use large block I/O, usually 64k. With the understanding that small block I/O impedes large data movements, note that filesystem fragmentation and sparse file fragmentation can cause an application's request to be broken into very small I/O. In other words, even though a dd if=/file system/file_name of=/tmp/out_file bs=128k is requesting a read with 128k block I/O, sparse file or filesystem fragmentation can force the read to be broken into much smaller block sizes. So, as we continue to dive into performance troubleshooting throughout this chapter, always stay focused on the type of measurement needed: I/O, payload, or block size. In addition to considering I/O, payload, and block size, time is an important factor. Importance of TimeContinuing with our example, we must focus on I/O round-trip time and bus saturation using the same performance test as earlier. In the next few examples, we use iostat to illustrate average wait time, service time, and percent of utilization of our test device. The following iostat display is from the previous sequential read test but with block size set to 4096k, or 4MBs, illustrating time usage and device saturation. atlorca2:~ # dd if=/dev/raw/raw8 of=/dev/null bs=4096k & In this iostat output, we see that the device utilization is pegged at 100%. When device utilization reaches 100%, device saturation has been achieved. This value indicates not only saturation but also the percentage of CPU time for which an I/O request was issued. In addition to eating up CPU cycles with pending I/O waits, notice that the round-trip time (service time) required for each I/O request increased. Service time, the time required for a request to be completed on any given device, holds around 3.2ms. Before we go into detail about all the items that must be completed within that 3.2ms, which are discussed later in this chapter, we need to recap the initial test parameters. Recall that the previous iostat data was collected while using the dd command with a block size of 4096k. Running the same test with block size set to 1024k yields identical block counts in iostat, as you can see in this example: atlorca2:~ # dd if=/dev/raw/raw8 of=/dev/null bs=1024k & Determining Block SizeAs we have illustrated earlier in this chapter, block size greatly impacts an application's overall performance. However, there are limits that must be understood concerning who has control over the I/O boundary. Every application has the capability to set its own I/O block request size, but the key is to understand the limits and locations. In Linux, excluding applications and filesystems, the sd driver blocks all I/O on the largest block depending on medium (such as SCSI LVD or FCP). An I/O operation on the SCSI bus with any typical SCSI RAID controller (not passing any other port drivers, such as Qlogic, or Emulex FCP HBA) holds around 128KB. However, in our case, through FCP, the largest block size is set to 512KB, as shown in the previous example when doing a raw sequential read access through dd. However, it goes without saying that other factors have influence, as shown later in this chapter when additional middle layer drivers are installed for I/O manipulation. To determine the maximum blocking factor, or max I/O size, of a request at the SD/FCP layer through a raw sequential read access, we must focus on the following items captured by the previous dd request in iostat examples. The following example explains how to calculate block size. Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn As the output shows, the number of blocks read per second is 311296.00, and the number of transactions per second is 303.00.
Note =~ means approximation. Recall that a sector has 512 bytes.
Now convert the value to KB.
Another way to calculate the block size of an I/O request is to simply look at the avgrq-sz data from iostat. This field depicts the average number of sectors requested in a given I/O request, which in turn only needs to be multiplied by 512 bytes to yield the block I/O request size in bytes. Now that we have demonstrated how to calculate the in-route block size on any given I/O request, we need to return to our previous discussion about round-trip time and follow up with queue length. Importance of a QueueService time only includes the amount of time required for a device to complete the request given to it. It is important to keep an eye on svctm so that any latency with respect to the end device can be noted quickly and separated from the average wait time. The average wait time (await) is not only the amount of time required to service the I/O at the device but also the amount of wait time spent in the dispatch queue and the roundtrip time. It is important to keep track of both times because the difference between the two can help identify problems with the local host. To wrap things up with I/O time and queues, we need to touch on queue length.. If you are familiar with C programming, you may find it useful to look at how these values are calculated. The following depicts the calculation for average queue length and wait time found in iostat source code. nr_ios = sdev.rd_ios + sdev.wr_ios; Though it is nice to understand the calculations behind every value provided in performance tools, the most important thing to recall is that a large number of outstanding I/O requests on any given bus is not desirable when faced with performance concerns. In the following iostat example, we use an I/O request size of 2K, which results in low service time and queue length but high disk utilization. atlorca2:~ # dd if=/dev/raw/raw8 of=/dev/null bs=2k & Notice how the %util remains high, while the request size falls to 4 sectors/(I/O), which equals our 2048-byte block size. In addition, the average queue size remains small, and wait time is negligible along with service time. Recall that wait time includes roundtrip time, as discussed previously. Now that we have low values for avgrq-sz, avgqu-sz, await, and svctm, we must decide whether we have a performance problem. In this example, the answer is both yes and no. Yes, the device is at its peak performance for a single thread data query, and no, the results for the fields typically focused on to find performance concerns are not high. Multiple Threads (Processes) of I/O to a DiskNow that we have covered the basics, let us address a multiple read request to a device. In the following example, we proceed with the same block size, 2K, as discussed previously; however, we spawn a total of six read threads to the given device to illustrate how service time, queue length, and wait time differ. Let's run six dd commands at the same time. atlorca2:~ # dd if=/dev/raw/raw8 of=/dev/null bs=2k & Note that the previous code can be performed in a simple for loop: for I in 1 2 3 4 5 6 Let's use iostat again to look at the dd performance. atlorca2:~ # iostat -t -d -x 1 100 The queue length (avgqu-sz) is 4.97, while the max block request size holds constant. The service time for the device to act on the request remains at 0.20ms. Furthermore, the average wait time has increased to 0.98ms due to the device's response to multiple simultaneous I/O requests requiring a longer round-trip time. It is useful to keep the following example handy when working with a large multithreaded performance problem because the device may be strained, and striping at a volume manager level across multiple devices would help relieve this type of strain. Using a Striped lvol to Reduce Disk I/O StrainTo illustrate the reduction of strain, let us create a VG and 4000MB lvol striped across two disks with a 16k stripe size. atlorca2:/home/greg/sysstat-5.0.6 # pvcreate /dev/sdi We again use sequential 2k reads with dd to measure the performance of the disks. atlorca2:/home/greg/sysstat-5.0.6 # raw /dev/raw/raw9 /dev/vg00/lvol1 \ Note that the previous command can be performed in a simple for loop, as previously illustrated. Again we use iostat to measure disk throughput. atlorca2:/home/greg # iostat -x 1 1000 Notice that the average wait time per I/O and the service time have increased slightly in this example. However, the average queue has been cut almost in half, as well as the physical I/O demand on the device sdj. The result is similar to a seesaw effect: As one attribute drops, another rises. In the previous scenario, the LUN (sdj) is physically composed of multiple physical mechanisms in the array called (array group), which remains a hidden attribute to the OS. By using the LVM strategy, we reduce some of the contingency for one LUN or array group to handle the entire load needed by the device (lvol). With the previous demonstration, you can see the advantages of striping, as well as its weaknesses. It seems true here that, for every action, there is an equal and opposite reaction. Striped lvol Versus Single Disk PerformanceIn the following example, we compare a striped raw lvol to a raw single disk. Our objective is to watch the wait time remain almost constant, while the queue size is cut almost in half when using a lvol stripe instead of a single disk. First let's look at performance using the lvol. In this example, we start six dd commands that perform sequential reads with block size set to 512k. The dd commands run at the same time and read a raw device bound to the lvol (as illustrated previously) with a 16k stripe size. Remember, iostat shows two disk devices for our lvol test because the lvol is striped across two disks. At 512KB, iostat yields values as follows: Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s \ Notice that the I/O queue length when reading lvol1 is much shorter than the following identical dd sequential read test on a raw disk sdj as shown next. Though the identical blocking size of 512k is used, the service time decreases. Here are the results of the test with a raw disk. Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s \ The raw device, sdj in the test using lvol1, reflects that the read requests per second (r/s) remain constant (152 on disk device sdi and 153 on disk device sdj), yielding a net result of 305 read requests per second. The lvol test also shows an improvement in the average wait time; however, we hurt the service time. The service time for the lvol test is about 6.5ms, whereas it is 3.2ms for the raw disk. Upon closer inspection, we notice that the service time is higher due to the I/O issued to the device. In the lvol example, we have in fact submitted 512KB every other time (because we are striping and blocking our I/O both on 512k) so that each total I/O submitted to the device is in a smaller queue, thereby reducing the wait time to be serviced. However, in the single device example, the queue wait time is high because we are waiting on the device to finish on the given I/O request, so with no overhead, the return is faster for the service. This example illustrates the seesaw effect discussed previously, in which a device (single LUN or lvol) is slammed, in which case the end user would need to address the application's need to perform such heavy I/O with a single device. In the previous example, tweaking the device or lvol buys no performance gain; it just moves the time wait status to another field. Note With a wider stripe, some performance would be gained in the previous sequential I/O example, but it is unrealistic in the real world. In addition to adding more disks for a wider stripe, you could add more paths to the storage for multipath I/O. However, multipath I/O comes with its own list of constraints. Multipath I/OMany administrators have heard about load balance drivers, which allow disk access through multiple paths. However, very few multipath I/O drivers provide load balance behavior to I/Os across multiple HBA paths as found in enterprise UNIX environments. For example, device drivers such as MD, Autopath, Secure Path (spmgr), and Qlogic's secure path are dedicated primarily to providing an alternate path for a given disk. Though HP's Secpath does offer a true load balance policy for EVA HSG storage on Linux, all the other drivers mentioned only offer failover at this time. The one true load balancing driver for Linux (HP's Secure Path) provides a round robin (RR) load balance scheduling policy for storage devices on EVA and HSG arrays. Unfortunately, just because a driver that provides load balancing, such as the HP Secure Path driver, exists does not mean support is available for your system. Support for array types is limited. Review your vendor's storage requirements and device driver's hardware support list before making any decisions about which driver to purchase. Keeping in mind that restrictions always exist, let's review a typical RR policy and its advantages and disadvantages. Though we want to discuss load balancing, the vast majority of Linux enterprise environments today use static (also known as "manual") load balancing or preferred path. With this in mind, we keep the discussion of RR to a minimum. In the next example, we proceed with a new host and new array that will allow the RR scheduling policy. The following example illustrates RR through Secure Path on Linux connected through Qlogic HBAs to an EVA storage array. Due to configuration layout, we use a different host for this example. [root@linny5 swsp]# uname -a Our host has two HBAs, /proc/scsi/qla2300/0 and /proc/scsi/qla2300/1, with Secure Path version 3.0cFullUpdate-4.0.SP, shown next. [root@linny5 /]# cat /proc/scsi/qla2300/0 Continuing with our raw device testing, we must bind the block device to the character device. [root@linny5 swsp]# raw /dev/raw/raw8 /dev/spdev/spd Use the Secure Path command spmgr to display the product's configuration. [root@linny5 swsp]# spmgr display To reduce space needed for this example, a large part of the spmgr display has been truncated, and we focus only on device spd, as per the following: TGT/LUN Device WWLUN_ID #_Paths Notice that two HBAs and two controllers are displayed. In this case, the EVA storage controller P66C5E1AAQ20AL has been set to preferred active on this particular LUN, in which both of the fabric N_ports enable connection to the fabric. In this configuration, each N_Port connects to different fabrics, A and B, which are seen by Qlogic 0 and 1. In addition, each HBA also sees the alternate controller in case a failure occurs on the selected preferred controller. We should also to mention that not all arrays are Active/Active on all paths for any LUN at any given time. In this case, the EVA storage array is an Active/Active array because both N_Ports on any given controller have the capability to service an I/O. However, any one LUN can only access a single N_Port at any moment, while another LUN can access the alternate port or alternate controller. Now that we have a background in EVA storage, we need to discuss how the worldwide name (WWN) of a given target device can be found. In the following illustration, we simply read the content of the device instance for the filter driver swsp. [root@linny5 swsp]# cat /proc/scsi/swsp/2 Next, we initiate load balancing and start our raw device test, which is identical to the test performed earlier in this chapter. [root@linny5 swsp]# spmgr set -b on 50001FE150031280 While this simple test runs, we collect iostat-x-d1 100 measurements, and we collect a few time captures. Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s \ Notice that the blocking factor for a given I/O has changed to 64 sectors per I/O, which equals 32k block size from the swsp module. To get a good comparison between a sequential read test with RR enabled and one with RR disabled, we must disable load balance and rerun the same test. We disable load balancing in the following example. [root@linny5 swsp]# spmgr set -b off 50001FE150031280 Iostat reports that the block size remains constant and that the average wait time for a given I/O round trip is slightly higher. This makes sense now that all I/O is on a single path. Because more I/O is loaded on a single path, average wait time increases, as do service times. Now that we have drawn a quick comparison between spmgr being enabled and disabled on a sequential read, we need to recap the advantages seen thus far. In the previous example, no performance gain was seen by enabling load balancing with regard to spmgr. As we can see, no obvious performance increase was seen when RR was enabled through the host measurements. However, though the host's overall benefit from enabling load balancing was insignificant, the SAN load was cut in half. Keep in mind that a simple modification can impact the entire environment, even outside the host. Something as minor as having a static load balance with a volume manager strip across multiple paths or having a filter driver automate the loading of paths can have a large impact on the overall scheme. Finally, with respect to load balance drivers, it is important to watch for the max block size for any given transfer. As seen in the previous iostat examples, the Secure Path product reduces the block size to 32k, and if LVM were to be added on top of that, the block would go to 16K. This small block transfer is great for running small, block-heavy I/O traffic, but for large data pulls, it can become a bottleneck. |
How the Cisco Story Benefits You
< Day Day Up > |
How the Cisco Story Benefits YouLearning from those who have already climbed the mountain makes the journey much easier for those who are still scaling the wall. Integrating our own products and technologies throughout our organization underscores our commitment to the Cisco technology and enables us to help our customers with solutions that provide maximum benefit. Whether it is migrating our entire organization to an e-business strategy, implementing wireless LAN into all corporate facilities, piloting our SN5420 storage router, or installing our IP contact center solution into Cisco locations around the world, we have mandated that we will always be our own first and best customer. In October 2000, an enterprise-wide deployment of IP Telephony began at the San Jose campus. Within the next 12 months, 55 buildings and nearly 20,000 users spread out over a 2-mile radius were converted. This was the largest deployment of LAN infrastructure and IP Telephony in industry history. The program charter was to implement our own AVVID technology solution 12 to 18 months ahead of our external customers to develop business models that would demonstrate return on investment (ROI), complete technology proof of concept, and processes for support and deployment of IP Telephony. Cisco IP Telephony offers an immediate ROI by reducing total cost of network ownership through one converged network. Savings are even further realized through reduced equipment and infrastructure cost, increased productivity, and much easier network management. The financial impact of the internal Cisco initiative encompasses significant annual savings in competitor-leased equipment and PBX maintenance cost, to name just a few. However, to extract the maximum benefit from an enterprise-wide IP Telephony initiative, careful and comprehensive planning before the actual implementation are critical. Whether it involves 200 phones or 20,000 phones, planning, communication, teamwork, and knowing where the "gotchas" are hiding will divert problems before they occur, reducing unnecessary costs and headaches that can hinder a successful implementation. The voices in this book come from an experienced team of project managers, engineers, operations personnel, and support teams who completed the conversion of the Cisco San Jose, California campus to IP Telephony. This book focuses not on the technology, but on the planning and business processes associated with a large IP Telephony implementation. Our hope is that by sharing our experience, we can help our customers plan and realize the value of a converged, IP-enabled network. �Manny Rivelo, senior vice president of worldwide field process and operations, |
< Day Day Up > |