Display Hidden Folders Enable or Disable the Option

By shankar

Few times , we won't get the Show Hidden Files and Folders option at Folders --> View Option.There is Fix for through registry edit. Need to copy the contents and paste into notepad then Save it as Your_filename.reg. Double-click the file , and Option will be enabled.

Note: Sometimes, need restart.

***********************************************************************************
Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden]
"Text"="@shell32.dll,-30499"
"Type"="group"
"Bitmap"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,53,00,\
48,00,45,00,4c,00,4c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,34,00,00,\
00
"HelpID"="shell.hlp#51131"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN]
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
"Text"="@shell32.dll,-30501"
"Type"="radio"
"CheckedValue"=dword:00000002
"ValueName"="Hidden"
"DefaultValue"=dword:00000002
"HKeyRoot"=dword:80000001
"HelpID"="shell.hlp#51104"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL]
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
"Text"="@shell32.dll,-30500"
"Type"="radio"
"CheckedValue"=dword:00000001
"ValueName"="Hidden"
"DefaultValue"=dword:00000002
"HKeyRoot"=dword:80000001
"HelpID"="shell.hlp#51105"

***********************************************************************************

Video Tutorials: Basic Hardware & Windows in Tamil and Malayalam

By Parthiban Ponnusamy

Another One, I am really happy to share these Video Tutorials for Basic Hardware, Windows XP, Windows 2003 in Tamil and Malayalam languages, which i found on web today. 

It's really nice to see these kind of Technical Video Tutorials in Indian Regional languages such as Tamil, Malayalam, Telugu, Hindi, etc..  The explanation and teaching skill is really good these tutorials. Hope this helps to peoples who starting their career as Windows or Desktop Support.

I really wish these kind of Video Tutorials should come in all the Indian Regional languages. That will help lot and lot of Peoples of India to understand technology better.

Really appreciate and Thank Bitnetz.com Team for their Video Tutorials.

Link? Here you go: 


Happy Learning..!

Linux Video Tutorials in Tamil

By Parthiban Ponnusamy

When I was searching for something yesterday, fortunately, I found something interesting. That is nothing but Linux video tutorials in Tamil. Good to see the Linux Video Tutorials in Tamil language. (Even I had a thought to create these kind of video tutorials and really not started the work for that still. Hope will do something in soon :)


Here you go:


Check out the Linux Video Tutorials in Tamil



I am really happy to share this here..!


I really appreciate and Thank Mr. BalaTutor, who created these tutorials. Great Job Bala..! 


I hope it will be really helpful for the people who want to learn Linux and it can help Tamil Guys to understand Linux better.

Linux OS Image Backup & Restore Guide (Using PING Tool)

By Parthiban Ponnusamy

Using PING for backup and Restore Linux OS Images

PING (Ping is not Ghost) is a live Linux ISO, created to take image backups of HDD/partitions, either locally or over the network. It can be burnt on a CD and booted, or integrated into a PXE / RIS environment.


Its a good idea to take an image backup of all the servers. so that, if something goes wrong, we can restore easily.


Look at the Quick HOWTO Guide for Backup and Restore Linux Images using PING Tool


Download PING from here

Hope this Article will help System Admins. Using PING you can take image backup of Linux and Windows Operating Systems.

Find WWN and WWPN in Linux

By Parthiban Ponnusamy

How to find WWN and WWPN in Linux?

First let us check, how many HBAs are available on the sever?

mytestsrv1# ls /sys/class/fc_host/
host0  host1

Or you can try the following method as well,

#lspci 
....
....

....
07:0a.0 Fibre Channel: Emulex Corporation Helios LightPulse Fibre Channel Host Adapter (rev 01)
08:0b.0 Fibre Channel: Emulex Corporation Helios LightPulse Fibre Channel Host Adapter (rev 01)

We have Two HBA here from the above example (host0 and host1).

To get the WWNN (World Wide Node Number) in Linux:

mytestsrv1#  cat /sys/class/fc_host/host0/node_name
0x20000000c9538d83

mytestsrv1# cat /sys/class/fc_host/host1/node_name
0x20000000c9538dac

To get the WWPN (World Wide Port Number) in Linux:

mytestsrv1#  cat /sys/class/fc_host/host0/port_name0x10000000c9538d83mytestsrv1#  cat /sys/class/fc_host/host1/port_name0x10000000c9538dac

If you have more HBAs, replace "host0 or host1" with "hostN ". In most cases, System admins need to provide the WWPN to storage admins for the storage allocation.

Upgrade iLO firmware from Linux shell

By Parthiban Ponnusamy


You can upgrade the iLO firmware from the Linux shell itself.
1. Download the right firmware version from HP site and upload it to the server which you want to upgrade.

2. Now login to the server and simply run the file which you downloaded from hp site.

mytestsrv1:/var/tmp # ./CP014890.scexe
FLASH_iLO2 v1.12 for Linux (Aug 31 2009)
Copyright 2009 Hewlett-Packard Development Company, L.P.
Firmware image: ilo2_206.bin
Current iLO 2 firmware version  2.01; Serial number ILOXXXXXXX
Component XML file: CP014890.xml
CP014890.xml reports firmware version 2.06
This operation will update the firmware on the
iLO 2 in this server with version 2.06.
Continue (y/N)?y
Current firmware is 2.01 (Aug 04 2010 11:16:29)
Firmware image is 0x300000 bytes
Committing to flash part...
******** DO NOT INTERRUPT! ********
Flashing completed!
Attempting to reset device.
Succeeded.
Waiting for iLO 2 to reboot...
iLO 2 reboot completed. 

That's all. you are done. iLO firmware has been upgraded to newer version.


Video Tutorial: Understand Oracle RAC

By Parthiban Ponnusamy


Interview Questions and Answers - Linux Administrator - 2

By Parthiban Ponnusamy

What command can you use to review boot messages?
The dmesg command can be used to display the system messages during boot time.

What are the fields in the /etc/passwd file. Explain them?
There are 7 fields in /etc/passwd:

username:x:UID:GID:comment:home directory:shell

1)Username.
2)Password. Dummy value x denotes that its using shadow passwords
3)UID.
4)Primary group ID.
5)Comment /description.
6)Home directory path.
7)Shell assigned to the user.

Whats the journaling data contains in ext3? 

A journaled file system records information in a log area on a disk.   It logs the "metadata" i.e ownership, date stamp information etc..Once the log is updated the system then writes the actual data to the appropriate areas of the filesystem and marks an entry in the log to say the data is committed.

After a crash the filesystem can very quickly be brought back on-line using the journal logs 
using fsck there is considerably less chance of data loss or corruption.

How do u extend the LV in Linux?

First check whether is there free space available in the VG where the LV resides.

# vgdisplay or 
# vgs

Now, extend the LV using below command: "L" option to specify the size to be increased.

# lvextend -L +5G /dev/vg00/lv01

Finally, extend the File system space:

# resize2fs /dev/vg00/lv01
That's all..!  Look at the other posts as well for interview questions. I am posting 4-5 questions in every post whenever i get time.




Features Comparison: Ext3 vs Ext4

By Parthiban Ponnusamy

.
Here is the quick facts and comparison of Ext3 and Ext4 File systems:  Hope this helps..!


Features
Ext3
Ext4
Stands For
Ext3 stands for third extended file system.
Ext4 stands for fourth extended file system.
Introduced
It was introduced in 2001.
It was introduced in 2008.
Kernel Support
Supports from Linux Kernel 2.4.15
Supports from Linux Kernel 2.6.19
Maximum individual file size supported
Maximum individual file size can be from 16 GB to 2 TB
Maximum individual file size can be from 16 GB to 16 TB
Maximum file system size supported
Overall ext3 file system size can be from 2 TB to 32 TB
Overall maximum ext4 file system size is 1 EB (exabyte).
1 EB = 1024 PB (petabyte).
1 PB = 1024 TB (terabyte).
Maximum sub directories
Directory can contain a maximum of  32,000 subdirectories
Directory can contain a maximum of 64,000 subdirectories
Other Features
The main benefit of ext3 is that it allows journaling. 

Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.


There are three types of journaling available in ext3 file system.

Journal – Metadata and content are saved in the journal.

Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.

Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.
In ext4, it supports journaling and also has the option of turning the journaling feature “off”.

Several other new features are introduced in ext4: multi block allocation, delayed allocation, Journal checksum, fast fsck and etc.

All you need to know is that these new features have improved the performance and reliability of the file system when compared to ext3.

Supports huge individual file size and overall file system size.

You convert ext2 to ext3 without having any data loss
You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).


Managing Emulex HBA with hbacmd

By Parthiban Ponnusamy

The Emulex hbacmd utility can be used to print lot of configuration and performance attributes and can be used to manage the HBA operations. 

To view performance metrics of HBA:

To view all available performance metrics, the hbacmd utility can be invoked with the “portstat” option and the WWPN to view:
 
# hbacmd PortStat 10:00:00:00:c9:49:28:47

Port Statistics for10:00:00:00:c9:49:28:47

Secs Since Last Reset : 21573
Exchange Count: 1308267
Responder Exchange Count: 363
TX Seq Count : 1315705
RX Seq Count : 6357365
TX Frame Count : 1336810
RX Frame Count : 161483066
TX Word Count : 31567104
RX Word Count : 3316320000
TX KB Count :123309
RX KB Count : 12954375
LIP Count : -1
NOS Count : 0
Error Frame Count : 0
Dumped Frame Count : -1
Link Failure Count : 1
Loss of Sync Count : 0
Loss of Signal Count : 0
Prim Seq Prot Err Count : 0
Invalid TX Word Count : 8
Invalid RX Frame CRC Cnt: 0


Resetting Emulex HBAs
 
On some situations, it may be necessary to reset an Emulex HBA to re-establish connectivity to fabric services.  To reset an adaptor with hbacmd, the WWPN is passed as an parameter:
# /usr/sbin/hbanyware/hbacmd Reset 10:00:00:00:c9:49:2c:b4
Reset HBA 10:00:00:00:c9:49:2c:b4

List all available HBAs:

To view all of the Emulex HBAs installed in a server, hbacmd can be invoked with the “listhbas” option:
# hbacmd listhbas

Manageable HBA List

Port WWN   : 10:00:00:00:c9:49:28:42
Node WWN   : 20:00:00:00:c9:49:28:42
Fabric Name: 10:00:00:60:69:80:2d:ee
Flags      : 8000f980
Host Name  : server01
Mfg        : Emulex Corporation

Port WWN   : 10:00:00:00:c9:49:28:47
Node WWN   : 20:00:00:00:c9:49:28:47
Fabric Name: 10:00:00:60:69:80:0e:fc
Flags      : 8000f980
Host Name  : fraudmgmt01
Mfg        : Emulex Corporation

Get HBA and Port Attributes:

To list firmware versions, serial numbers, WWN and a variety of model specific information, the hbacmd can be invoked with the “hbaattrib” option and the WWN to probe:
# hbacmd HBAAttrib 10:00:00:00:c9:49:28:47

HBA Attributes for 10:00:00:00:c9:49:28:47

Host Name      : server01
Manufacturer   : Emulex Corporation
Serial Number  : MS51403247
Model          : LP9802
Model Desc     : Emulex LightPulse LP9802 2 Gigabit PCI Fibre Channel Adapter
Node WWN       : 20 00 00 00 c9 49 28 47
Node Symname   : Emulex LP9802 FV1.91A1 DV6.02f
HW Version     : 2003806d
Opt ROM Version: 1.50a4
FW Version     : 1.91A1 (H2D1.91A1)
Vender Spec ID : 80F9
Number of Ports: 1
Driver Name    : lpfc
Device ID      : F980
HBA Type       : LP9802
Operational FW : SLI-2 Overlay
SLI1 FW        : SLI-1 Overlay 1.91a1
SLI2 FW        : SLI-2 Overlay 1.91a1
IEEE Address   : 00 00 c9 49 28 47
Boot BIOS      : Fcode Firmware1.50a4
Driver Version : 6.02f; HBAAPI(I) v2.0.e, 11-07-03

To view host Port information (e.g., port speed, device paths) and fabric parameters (e.g., fabric ID (S_ID), number of ports zoned along with this port), hbacmd can be invoked with the “portattrib” option:
# hbacmd PortAttrib 10:00:00:00:c9:49:28:47

Port Attributes for 10:00:00:00:c9:49:28:47

Node WWN            : 20 00 00 00 c9 49 28 47
Port WWN            : 10 00 00 00 c9 49 28 47
Port Symname        :
Port FCID           : 6D0900
Port Type           : Fabric
Port State          : Operational
Port Service Type   : 6
Port Supported FC4  : 00 00 01 20 00 00 00 01
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00
Port Active FC4     : 00 00 01 20 00 00 00 01
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00
Port Supported Speed: 2 GBit/sec.
Port Speed          : 2 GBit/sec.
Max Frame Size      : 2048
OS Device Name      : /devices/pci@84,2000/lpfc@1
Num Discovered Ports: 3
Fabric Name         : 10 00 00 60 69 80 0e fc

Emulex is providing lot of CLI and GUI management utilites to manage HBA's. Hope this helps..!

Getting Information about Hard disk : Linux HOWTO

By Parthiban Ponnusamy


Getting Information about the Hard drive in Linux:

# hdparm /dev/sda


/dev/sda:
multcount    = 16 (on)
IO_support   =  0 (default 16-bit)
unmaskirq    =  0 (off)
using_dma    =  1 (on)
keepsettings =  0 (off)
readonly     =  0 (off)
readahead    = 256 (on)
geometry     = 16383/255/63, sectors = 234375000, start = 0

Add the -i option for more information:

# hdparm -i /dev/sda

/dev/sda:

Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52
BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=yes: disabled (255) WriteCache=enabled
Drive conforms to: SATA T13 1410D revision 3a:  2 3 4 5 6

How fast is your drive? 


# hdparm -tT /dev/hda

/dev/sda:
Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec
Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec 


Need to find your device? 


# mount
or
# cat /proc/partitions
or
# dmesg | egrep '^sd'

sda: IC35L120AVV207-1, SATA DISK drive
sdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive
sda: max request size: 1024KiB
sda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)

Finally, if you want to turn on DMA: 


# hdparm -d1 /dev/sda

setting using_dma to 1 (on)
using_dma    =  1 (on)

See other users SSH sessions in Linux

By Parthiban Ponnusamy

Are wondering what your users are doing in their SSH sessions? Do you want to see, whats happening there?

Try the following:
# cat /dev/vcs1
This will show you what happenening on the first console. If someone is typing, you’ll be able to get an output of their keystrokes.

Note: You should have "root" access for this.

Replace /dev/vcs1 with /dev/vcs2 or /dev/vcs3 and so on for other consoles.

Enjoy..!


Limit SSH Access for Users

By Parthiban Ponnusamy

How do you limit the access to the SSH for different users in Linux server?

We can use “Match” in the OpenSSH configuration file. Add the Match directive in your sshd_config followed by a criteria which you want to block (User, Group, Address or Host).

The following example limits TCP and X11 port forwarding for the user "testuser":

AllowTcpForwarding no

X11Forwarding no

Match User jack

AllowTcpForwarding yes

X11Forwarding yes

Hope this helps..!

Understanding TOP command ouput in Linux

By Parthiban Ponnusamy


How do I determine CPU and Memory utilization, based on running processes in Linux using TOP?
Top command provides a real-time look at what is happening with your system. Top produces so much output that a new user may get over whelmed with all that’s presented and what it means.
Let’s take a look at TOP one line at a time.

The first line in top:
top - 22:09:08 up 14 min,  1 user,  load average: 0.21, 0.23, 0.30
“22:09:08″ is the current time; “up 14 min” shows how long the system has been up for; “1 user” how many users are logged in; “load average: 0.21, 0.23, 0.30″ the load average of the system (1minute, 5 minutes, 15 minutes).
Load average is an extensive topic and to understand its inner workings can be daunting. The simplest of definitions states that load average is the cpu utilization over a period of time. A load average of 1 means your cpu is being fully utilized and processes are not having to wait to use a CPU. A load average above 1 indicates that processes need to wait and your system will be less responsive. If your load average is consistently above 3 and your system is running slow you may want to upgrade to more CPU’s or a faster CPU.
The second line in top:
Tasks:  82 total,   1 running,  81 sleeping,   0 stopped,   0 zombie
Shows the number of processes and their current state.
The third line in top:
Cpu(s):  9.5%us, 31.2%sy,  0.0%ni, 27.0%id,  7.6%wa,  1.0%hi, 23.7%si,  0.0%st
Shows CPU utilization details. “9.5%us” user processes are using 9.5%; “31.2%sy” system processes are using 31.2%; “27.0%id” percentage of available cpu; “7.6%wa” time CPU is waiting for IO.
When first analyzing the Cpu(s) line in top look at the %id to see how much cpu is available. If %id is low then focus on %us, %sy, and %wa to determine what is using the CPU.
The fourth and fifth lines in top:
Mem:    255592k total,   167568k used,    88024k free,    25068k buffers
Swap:   524280k total,        0k used,   524280k free,    85724k cached
Describes the memory usage. These numbers can be misleading. “255592k total” is total memory in the system; “167568K used” is the part of the RAM that currently contains information; “88024k free” is the part of RAM that contains no information; “25068K buffers and 85724k cached” is the buffered and cached data for IO.
So what is the actual amount of free RAM available for programs to use ?
The answer is: free + (buffers + cached)
88024k + (25068k + 85724k) = 198816k
How much RAM is being used by progams ?
The answer is: used – (buffers + cached)
167568k – (25068k + 85724k) = 56776k
The processes information:
Top will display the process using the most CPU usage in descending order. Lets describe each column that represents a process.
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
3166 apache    15   0 29444 6112 1524 S  6.6  2.4   0:00.79 httpd
PID – process ID of the process
USER – User who is running the process
PR – The priority of the process
NI – Nice value of the process (higher value indicates lower priority)
VIRT – The total amount of virtual memory used
RES – Resident task size
SHR – Amount of shared memory used
S – State of the task. Values are S (sleeping), D (uninterruptible sleep), R (running), Z(zombies), or (stopped or traced)
%CPU – Percentage of CPU used
%MEM – Percentage of Memory used
TIME+ – Total CPU time used
COMMAND – Command issued
Interacting with TOP
Now that we are able to understand the output from TOP lets learn how to change the way the output is displayed.
Just press the following key while running top and the output will be sorted in real time.

M – Sort by memory usage
P – Sort by CPU usage
T – Sort by cumulative time
z – Color display
k – Kill a process
q – quit
If we want to kill the process with PID 3161, then press “k” and a prompt will ask you for the PID number, and enter 3161.
Command Line Parameters with TOP
You can control what top displays by issuing parameters when you run top.
- d – Controls the delay between refreshes
- p – Specify the process by PID that you want to monitor
-n – Update the display this number of times and then exit
If we want to only monitor the http process with a PID of 3166
$ top -p 3166
If we want to change the delay between refreshes to 5 seconds
$ top -d 5

Extend SAN disk under Linux LVM

By Parthiban Ponnusamy

In Linux server, How to extend the SAN disk under LVM , after the LUN expanded from SAN? 

This article will explain you, how to do this. we are going to expand size of the SAN disk which is 20GB to 75GB under LVM. Basically, Linux detects the new size after a LUN scan, but LVM won't recognize expanded size of the disk. Let us see, how we are going to achieve this.

1. Scan for new LUNS. Refer Scan and Configure New LUNS for scanning LUNS in Linux

2. After scanning, check physical size of  the drive now.

# fdisk -l /dev/sdb
       
Disk /dev/sdb: 75.1 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Device Boot      Start         End      Blocks   Id  System

Now,  Linux recognized the new size as 75 GB.

3. Check the LVM

# pvs   
PV         VG      Fmt  Attr PSize  PFree
/dev/sda3  system  lvm2 a-   16.89G  2.92G
/dev/sdb   system2 lvm2 a-   20.00G 96.00M

 This command still reported 20GB for the LVM disk, Lets do a scan now:

# pvscan
# vgscan
# lvscan

# pvs   
PV         VG      Fmt  Attr PSize  PFree
/dev/sda3  system  lvm2 a-   16.89G  2.92G
/dev/sdb   system2 lvm2 a-   20.00G 96.00M

4. After the scan also, LVM still reports the disk as 20GB. So let us extend the size manually.
       

#  pvresize --setphysicalvolumesize 70G /dev/sdb
#  pvs

PV            VG      Fmt  Attr PSize  PFree
/dev/sda3  system  lvm2 a-   16.89G  2.92G
/dev/sdb   system2 lvm2 a-   70.00G 96.00M

Now LVM reports the new size of the disk.  Let us do a scan again, so that VG takes this new PV size into account.

# pvscan
# vgscan
# lvscan

5. Now, we can extend the logical volume size:

#  lvextend -L +50G /dev/system2/app
#  resize_reiserfs /dev/system2/app

# pvs
# vgs
VG      #PV #LV #SN Attr   VSize  VFree
system    1   5   0 wz--n- 16.89G  2.92G
system2   1   1   0 wz--n- 70.00G 96.00M

# lvs
LV   VG      Attr   LSize  Origin Snap%  Move Log Copy%
Opt  system  -wi-ao  2.00G
root system  -wi-ao  1.00G
tmp  system  -wi-ao  2.00G
usr  system  -wi-ao  2.97G
var  system  -wi-ao  6.00G
app  system2 -wi-a- 69.90G
       
6. Finally verify the space

# df -h  /app
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/system2-app
                           70G  5.5G   65G   8% /app
Thats all..! we are done..enjoy..

Troubeshooting Linux Server Performance issues

By Parthiban Ponnusamy

System Admins used to get the complaints that the servers are responding slow and low performance. One of the important reason for this is your server might be heavily loaded.Means overloaded.

How do you troubleshoot these server performance issues in Linux? 

There can be a number of reasons for high load on the server such as, 
  • Inadequate RAM/CPU
  • Slower Hard disk drives
  • Unoptimized software applications / Modules
 In this article, I am going to explain you  to identify what's the bottleneck and where do you need to focus on.


1) First, Lets check the server Load:

First let us look at the server load. You can probably execute the "uptime" command to find out what's the current load, but "top" command is better one. Top command helps you identify how many CPUs are being reported and You should be able to see something like cpu00, cpu01, etc. 

A load of ~1 for each CPU is reasonable. More 1 for each CPU indicates that processes are waiting on resources like CPU, Memory or IO. The higher value shows that more process are in queue for resources and indicates that your server is heavily loaded.  For example, you're fine if the load's 7.80  if you have 8 CPUs.

Another thing to consider while looking at the load via uptime or top, is to understand what it shows.

15:33:35 up 180 days, 5:17, 6 users, load average: 8.76, 6.77, 5.42

The first part (8.76) shows the load average in the last 5 mins, while the second (6.77) and third (5.42) shows averages of 10 and 15 mins respectively. It's probably a spike here, lets look further.

Are you OK about your server is load? sometimes servers are able to handle much more load than the load shown. The load averages aren't so accurate after all and cannot always be the ultimate deciding factor. Move ahead if your loads are something to worry over.

Note:  If have a P4 CPU having HT technology will be reported as 2 CPUs in Top, even if you know your server has one Physical CPU.  For example: on a 4HT Physical CPU server, the Top reports it as 8 CPU

2) Check for RAM Memory:

Note: Perform the checks multiple times, to reach a fine conclusion. 

# free -m

The output should look similar to this:

# free -m
total used free shared buffers cached
Mem: 1963 1912 50 0 28 906
-/+ buffers/cache: 978 985
Swap: 1027 157 869

Look at the output. Don't panic that almost all the RAM is used up. Have a look at the buffers/cache that says "985" MB of RAM is still free in buffers. As long as you have enough memory in the buffers, and your server is not using much swap, you're pretty fine on RAM. 

Whenever Server does not have enough Memory to keep all the Application processes and data, the server starts to use SWAP, which is part of your disk mapped as memory. But it is comparatively very slow and can further slower down your system. Keep in mind, higher SWAP usage, slow down your system.

At least 200MB available in buffers and not more than 200MB swap usage is Good.

If you find, RAM is the issue, look at Top output for which application process is using more memory. If your application is taking more memory then you should probably look into optimizations on your Application and its related scripts.

Alternatively, you can increase the RAM as well.

3)  Check if I/O (input/output) usage is excessive

If there are too many read/write requests on a single hard disk drive, it will become slow and you'll have to upgrade it to a faster drive (with more RPM and cache). The alternate option is splitting the load onto multiple drives by spreading the data by using RAID. To identify, if your I/O issues:

# top

Read the output under "iowait" section (In some cases %wa), for each CPU. In ideal situations, it should be near to 0%. If you see higher value here, sometimes  at time of a load spike, consider rechecking these values multiple times to reach a fine conclusion. Anything above 15% is bad. Next, you can check the speed of your hard disk drive to see if it's really lagging:

Try "df -h" command to check which is the drive that your data/Filesystem resides on.

# hdparm -Tt /dev/sda

The output:

/dev/sda:
Timing cached reads: 1484 MB in 2.01 seconds = 739.00 MB/sec
Timing buffered disk reads: 62 MB in 3.00 seconds = 20.66 MB/sec

It was awesome at the buffer-cache reads, most probably because of the disk's onboard cache, however, buffered disk reads is just at 20.66 MB / sec. Anything below 25MB is something you should worry about.


4) Check the CPU consumption:

# top

Check the top output to find out if you're using too much CPU power. You should be looking the value under idle besides each CPU entry. Anything below 45% is something you should really worry about. Look for %sy, %us, %id, %wa values as well as a next step. In the Top output you can determine which process is using higher CPU.

In the example, the problem was with the I/O usage and hard disk slow. we need to upgrade the disk to a faster drive or implement RAID kind of solution.

Troubleshooting process can never be complete in one article and No article can feed you everything which need to reach up to expert level. You need to keep learning. 

Hope this helps..! Happy Troubleshooting..!