linux poison RSS
linux poison Email
0

Advanced Bash Scripting Guide

The Advanced Bash Scripting Guide is both a reference and a tutorial on shell scripting. This comprehensive book (the equivalent of 974 print pages) covers almost every aspect of shell scripting. It contains 364 profusely commented illustrative examples, a number of tables, and a cross-linked index/glossary. Not just a shell scripting tutorial, this book also provides an introduction to basic programming techniques, such as sorting and recursion. It is well suited for either individual study or classroom use. It covers Bash, up to and including version 4.0.

Download  Advanced Bash Scripting Guide
  HTML
  Zip
  PDF
Read more
0

Setting IO Scheduler for Maximum Performance on OpenSuSe Linux

Virtually all applications running on Linux do some sort of IO. Even surfing the web produces a great number of small files that are written to disk. Without an IO scheduler, every time there is an IO request, there is an interrupt to the kernel and the IO operation is performed. Perhaps more importantly, over time the disparity in the performance of disk drives and the rest of the system has grown very rapidly meaning that IO has become more important to overall system performance. As you can imagine when the kernel has to address the interrupt so any kind of processing or interactive work is paused. Consequently the system may appear unresponsive, or it may appear that the system has slowed down, hence the correct selection of the IO scheduler here becomes very important depending upon the type of workload you are doing - Normal desktop or proxy server or Database server or Web Server etc..

There are currently four IO schedulers in the Linux kernel.

Anticipatory IO Scheduler (AS)
The anticipatory scheduler is the default scheduler in older 2.6 kernels – if you've not specified one, this is the one that will be loaded. It implements request merging, a one-way elevator, read and write request batching, and attempts some anticipatory reads by holding off a bit after a read batch if it thinks a user is going to ask for more data. It tries to optimize for physical disks by avoiding head movements if possible – one downside to this is that it probably give highly erratic performance on database or storage systems.

Deadline Scheduler
The deadline scheduler implements request merging, a one-way elevator, and imposes a deadline on all operations to prevent resource starvation. Because writes return instantly within Linux, with the actual data being held in cache, the deadline scheduler will also prefer readers – as long as the deadline for a write request hasn't passed. The kernel docs suggest this is the preferred scheduler for database systems, especially if you have TCQ aware disks, or any system with high disk performance.

Complete Fair Queuing Scheduler (CFQ)
The complete fair queuing scheduler implements both request merging and the elevator, and attempts to give all users (process) of a particular device the same number of IO requests over a particular time interval. This should make it more efficient for multiuser systems. As of the 2.6.18 kernel, this is the default scheduler in kernel.org releases.

What CFQ does, is to give all users (processes) of a particular device (storage) about the same number of IO requests over a particular time interval. This can help multi-user systems since all users will see about the same level of responsiveness. More over, CFQ achieves some of the good throughput characteristics of the anticipatory scheduler because it allows a process queue to have some idle time at the end of a synchronous IO request creating some anticipatory time waiting for some IO that might be close to the just finished request.

It should provide a fair working environment, suitable for desktop systems.

NOOP (No-Op)
The NOOP scheduler inserts all incoming I/O requests into a simple, unordered FIFO queue and implements request merging.

The scheduler assumes I/O performance optimization will be handled at some other layer of the I/O hierarchy; e.g., at the block device; by an intelligent HBA such as a Serial Attached SCSI (SAS) RAID controller or by an externally attached controller such as a storage subsystem accessed through a switched Storage Area Network)

NOOP scheduler is best used with solid state devices such as flash memory or in general with devices that do not depend on mechanical movement to access data (meaning typical "hard disk" drive technology consisting of seek time primarily, plus rotational latency). Such non-mechanical devices do not require re-ordering of multiple I/O requests, a technique that groups together I/O requests that are physically close together on the disk, thereby reducing average seek time and the variability of I/O service time."

Setting IO Scheduler on OpenSuSe System:
Go to Yast >> System >> Kernel Setting (open up Kernel Setting tab)
Here in the drop down you can select the type of  IO Scheduler you want for your system
For my Desktop system, I have selected CFQ


Read more
0

Stress Testing Linux System

In software testing, stress test refers to tests that put a greater emphasis on robustness, availability, and error handling under a heavy load, rather than on what would be considered correct behavior under normal circumstances. In particular, the goals of such tests may be to ensure the software doesn't crash in conditions of insufficient computational resources (such as memory or disk space), unusually high concurrency, or denial of service attacks.

stress is a simple tool that imposes a configurable amount of CPU, memory,I/O, and disk stress on POSIX-compliant operating systems. It is written in portable ANSI C, and uses the GNU Autotools to compile on most UNIX-like operating systems.

stress is not a benchmark. It is a tool used by system administrators to evaluate how well their systems will scale, by kernel programmers to evaluate perceived performance characteristics, and by systems programmers to expose the classes of bugs which only or more frequently manifest themselves when the system is under heavy load.

Installation:
OpenSuSe 11.1 user can use "1-click" installer to install stress - here

Sample stress execution:  A load average of four is imposed on the system by specifying two CPU-bound processes, one I/O-bound process, and one memory allocator process.

# stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 10s --verbose


Read more
3

Linus Answer to Windows 7

Not sure what Linus is trying to say here :)
Does is really means a "thumbs up for Windows 7"?



Source: http://www.linuxinsight.com/
Read more
2

What is the difference among VIRT, RES, and SHR in top output

VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column) This will virtually always be less than the VIRT size, since most programs depend on the C or other library.

SHR indicates how much of the VIRT size is actually sharable memory or libraries. In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.


Read more
Related Posts with Thumbnails