Upgraded Postgres to 9.4 recently, want to check if my handy SQLs still works for pg9.4, Here is the one to get postgres database,table index sizes, actually it these SQLs still work since postgres 9.1, 9.2, and 9.3.
Sysfs Fibre Channel Tools(updated for RHEL6)
It's a FC tool set I've been using for years, very useful, just updated to reflect RHEL6 latest kernel.
Tested on kernel2.6.32-358.14, using Emulex and Qlogic cards. Should be good for other types of HBA too, just add vendor info to ls_fc_luns
Solid-state drives are much faster than HDD drives. While regular Disk drives may be slow, but they offer a very large storage capacity at a very low price per gigabyte.
To get the advantages of both, Some user do mix these two type of drives in system, SSD for application, while regular large HDD for backup, background running etc..
Is there a way to combine them together? Hybrid Drive is one of linux cache options.
There are several cache solutions on Linux that utilize faster SSD advantages to boost disk IOPS. Here are most popular ones
Here are some multipath command examples, before we get started, let's see how many options does multipath command has. We'll be just focusing on most useful options.
Using top command, you can easily find out how much CPU used by each job, However, a process/task I/O waiting is also conclued in CPU usage. So, in some case, CPU actually is not busy but you still see high load on system, some processes are just blocked by I/O, therefore CPU cost is high.
How to identify these processes?
Mdadm is the linux utility used to manage and monitor software RAID devices. It stands for MD(multiple devices) Adm(administration). Replaced the previous mdctl as default software RAID utility on Linux. I'll show you how to manage software array on linux with mdadm.
IBM Tape Diagnostics Tool(ITDT) offers multiple functional capabilities that simplify the task of maintaining IBM tape products, It is designed to be simple and easy to handle, provides a lots of functions that you can use to diagnostics tape drive. ITDT documentation can be found in the chapter "IBM Tape diagnostic Tool (ITDT)" of the IBM Tape Device Drivers Installation and User's Guide.
One of its function is to do drive firmware update, here is the example, using command line,it also has a GUI one.
In Fibre channel cluster environment, it is important to be very careful when kickstarting a storage node attached via fibre channel. You never want to accidentally install OS on a SAN disk.
How to prevent this hapening ? One way is to have a script check if the disk is a FC disk before preceding partition and installation.It will work.
If you have IBM DS/DCS storage systems, it's not unusual to see a message like below when you have SNMP trap defined.
This trap indicates an event where user-interaction is required immediately. ipv4 dcs3700 1010 Feb 15, 2016 3:45:55 AM Impending drive failure detected by drive Drive Enclosure 1, Drawer 2, Slot 6
You will see error message in event log, or guri. It is detected by IBM DS/DCS storage system background checking/monitoring the status of the disk drives. A Predictive Failure Analysis error is logged against the drive whenever a sufficient level of errors are detected and regarded as a concern yet the drive remains usable. Hense, the drive is likely to fail in the near future.
LTO 7 tape drives have been on the market and LTO7 tapes are also supported by Vendors like IBM, HP, Quantum, Sony, Fujifilm and Maxell. Etc.. With an uncompressed storage capacity of 6TB and a compressed capacity of up to 15TB, LTO 7 tapes will have more than double the capacity of LTO 6 tape.
Enterprise MLC, also called eMLS, it provides performance driven solution for applications requiring workloads with a mix of read/write operations, what about Enterprise value MLC SSD?
If you have experience with IBM DS serial storage systems(previously called FastT), then probably you familar with GUI based Storage Manager.
Do you know that you can also use Command line interface and the script commands for DS3000, DS4000™, and DS5000 Storage Manager software to configure, operate, and maintain a storage subsystem ?
Here I show some most useful command examples, for more detail, you can check the a reference book called 'Command Line Interface and Script Commands Programming Guide', describes all the commands.
Suppose you have your hardware installed and controller ips configured.
lspci is a utility on Linux for displaying information about PCI buses in the system and devices connected to them. Most of info it displays are from linux sysfs backend, some are from kernel.
By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by other programs.
Nowadays CPU hyperthreading is not a hot topic but rather common. Generally speaking, for most cases, you can get roughly 10-20% performance gain on HT enabled, however, on the other hand, probably you will notice that power consomption and tempature will increase too(if you are managing a large HPC site, it is important to know before you switch hyperthreading on).
Anyway, how do we quickly get Hyperthreading info on linux ?
Regardless of what filesystem you choose, there are some general Linux tuning operations that apply.
The first parameter you should tune on any Linu installation is device read ahead. When doing sequential reads that seem to be moving forward, this feature results in Linux asking for blocks from the disk ahead of the application requesting them.
Generally speaking, PostgreSQL makes locks less of an issue than in some other databases. However, high performance applications till need to be careful to miimize how often they take stronger locks. Here are some useful SQLs to show PostgreSQL9.4 lock information.
There are two popular command line tools to manage cluster configuration. One is pcs and the other is crmsh. In this serial documents, it's based on pcs.
Most HA document and example on the web are web application based, use GFS2 as share filesystem and DRDB for content replication. What about other applications? Do they all have to use GFS2 and DRDB? My answer is no.
Here are some SQLs you can use to query or check table and index access statistics from postgreSQL buffer, the SQLs all have been tested on pg9.1, pg9.2, pg9.4 and pg9.4
DIMM error is rare, but sometime still happens. It's easy to identify them if they are completely dead, however, if a DIMM has some corrected errors, how to identify it?
Here is an example show you how to identify defective DIMM on an AMD_x64 archtecture machine, syslog reorted kernel error from EDAC (Error Detection and Correction kernel module).
Here is a piece of typical error message from EDAC
The MegaRAID Command Tool (CT) is a command line interface (CLI) application for SAS. You can use this utility to configure, monitor, and maintain the MegaRAID SAS RAID controllers and the devices connected to them.
To be noted is that the Command Tool supports only the MegaRAID controllers that support SAS and SATA II. It does not support other types of MegaRAID controllers, suchas U320, SATA I, or IDE.
For more info about MegaRAID, read MegaRAID SAS Software User Guide
In this article, I'll only show you some of Megacli command examples, you can also check MegaCli command reference for more
iSCSI is an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances.
iSCSI is a client-server protocol. the server side is called 'target', while the client side is referred as the ' initiator'. Both target and initiator are uniquely identified by a string called the iSCSI Qualified Name(iQN).
For most of administrators, It's a bit hard to find proper command from the list of Brocade switch command, especially when you are doing diagnostics, you don't want to spend time on just searching proper commands. Here is a short command list for switch trouble shooting, hope it can save your time.
The ARC cache is similar to the buffer cache, but just dedecated to ZFS, so there is generally nothing to worry about it.
On ZOL 0.6.3(didn't check other version yet), it's set max to use half of memory on the host.
The difference between buffer cache memory and ARC cache one is that for regular application, the first one is immediately available to allocation while the ARC cache one is not. In general ZFS monitors the free RAM available and when too low, it releases RAM to other consumers.
According to you application, you may want to set ZFS ARC maximum.
Unlike many traditional database products, PostgreSQL does not assume or even prefer that the majority of the memory on the system be allocated for its use. Most reads and writes from the database are done using standard operating system calls that allows the operating system's cache to work in its usual fashion. Only few exceptions, for example WAL in some configuration.
In PostgreSQL, there are two layers, PostgreSQL shared buffers and OS Page cache. Lots of articles talked about how they work and how to tune them, here I'd rather to just share with you how to get information from both layers. Tune the sizes of them according to your system.
In the article CVS acceptable date formats, I showed how flexible to retrive CVS revision files by date. However, more often what you really want to do is retrive the project as it was at the time of a specific event, perhaps a public release, a known stable point in the software's development, etc..
Trying to remember the date when that event took place would be a tedious process. Presumably, the event, because it was important, was marked as such in the formal revision history. The method CVS offers for making such marks is known as tagging.
Bash tips: echo output with colour
Most of time you don't need echo output with color, but if you have monitoring script, you want to high light you output with colors.
This article will show you the mapping from physical HBA card to luns, I use SAN as example below, in general, it's also applys to any other devices whichever use sysfs, for example direct sas connect.
All Solid State Drives use NAND chips, however, SSDs from different Vendors are very different in performance and endurance, how does it happen?
Here are just some common methods Vendors use to avoid damaging flash cells and extend the life of the SSD drive. See SSD glossary if you see any term that you are not familar with.
- How to setup ssh tunnel ( ssh forwarding)
- CVS mostly used command examples
- How to keep idle ssh connection alive
- rexec configuration on linux
- Rlogin configuration on linux
- rsync server setup on RHEL
- Rsh configuration on linux
- How to setup ssh login without password
- How to make ssh server more securier
- Check HBA card and its driver's info on linux(RHEL6)
- CVS Acceptable Date Formats
- Linux sysfs Filesystem
- /proc filesystem on Linux
- CVS command reference
- Linux lsscsi - list SCSI devices (or hosts) and their attributes
- lspci useful examples
- How to create, check and delete IPC share memory, semaphare and message queue on linux
- Perl shareable memory
- Linux iptables brief concepts and configuration
- ACL on Linux -- POSIX Access control list on linux
- Perl shareable memory examples
- scsi_id examples on RHEL6
- MegaCli useful commands with examples
- Arcconf command examples ( Adaptec ARRAY Controller )
- udevadm command examples
- Check and list luns attached to HBA in RHEL6
- List of Brocade SAN switch CLI command
- LSI MegaRAID Patrol read and consistency check
- NTP client configuration on RHEL6/CENTOS6/SL6
- scsi_id examples on RHEL7