UnixPedia : HPUX / LINUX / SOLARIS: August 2014

Saturday, August 16, 2014

HP-UX 11.x Operating Systems - Changing the POSIX Shell's ulimit -n (File Descriptor) Setting.



HP-UX 11.x Operating Systems - Changing the POSIX Shell's ulimit -n (File Descriptor) Setting.
Overview
HP-UX 11.x Operating Systems - Changing the POSIX Shell's ulimit -n (File Descriptor) Setting.
Procedures

HP-UX 11.x Operating Systems - Changing the POSIX Shell's ulimit -n (File Descriptor) Setting

Issue

This document provides information and examples on how to change the POSIX shell's ulimit -n parameter (the resource limit for the number of per-process file descriptors allowed in that shell's environment).

Solution

ulimit usage will be shell-specific. For use with the POSIX shell, refer to the sh-posix(1) manual page and search for ulimit .
To display the current value of the file descriptor setting in ulimit :
# ulimit -n 4096
To display the hard limit of the file descriptor setting:
# ulimit -Hn 4096
To change the soft limit of the file descriptor setting:
# ulimit -n 2048
To confirm the new value following the change:
# ulimit -n 2048
To change the hard limit of the file descriptor setting:
# ulimit -Hn 2048
To confirm the new value following the change:
# ulimit -Hn 2048
We were able to decrease the value of the file descriptor setting. But, if we attempt to increase it to greater than 4096 , then an error would be returned:
# ulimit -n 8192
sh: ulimit: The specified value exceeds the user's allowable limit.
This is because our hard limit is also not set to unlimited. Thus, will try to increase that to unlimited:

# ulimit -Ha n 8192
sh: ulimit: The specified value exceeds the user's allowable limit.
Again, we saw the error.
This is because soft limit of file descriptor setting depends upon the maxfiles kernel tunable, and the hard limit of the file descriptor setting depends upon the maxfiles_lim kernel tunable:

maxfiles < or = maxfiles_lim
softlimit < or = hard limit


# kctune -q maxfiles
Tunable   Value  Expression  
maxfiles   4096  Default

# kctune -q maxfiles _lim
Tunable       Value  Expression  Changes
maxfiles_lim   4096  Default     Immed
The maxfiles kernel tunable is presently 4096 and maxfiles_lim = 4096 . Thus, if we want to set the ulimit file descriptor setting to more than 4096 , we first need to increase the values of the maxfiles and maxfiles_lim kernel tunables:

# kctune maxfiles=8192
NOTE:    The configuration being loaded contains the following change(s)
         that cannot be applied immediately and which will be held for
         the next boot:
      -- The tunable maxfiles cannot be changed in a dynamic fashion.
       * The automatic 'backup' configuration has been updated.
       * The requested changes have been saved, and will take effect at
         next boot.
Tunable                Value  Expression  
maxfiles  (now)         2048  Default     
          (next boot)   8192  8192  

NOTE : changing the maxfiles tunable requires a restart of system.

# kctune maxfiles _lim=8192
WARNING: The automatic 'backup' configuration currently contains the
         configuration that was in use before the last reboot of this
         system.
     ==> Do you wish to update it to contain the current configuration
         before making the requested change? y
       * The automatic 'backup' configuration has been updated.
       * The requested changes have been applied to the currently
         running system.
Tunable                 Value  Expression  Changes
maxfiles_lim  (before)   4096  Default     Immed
              (now)      8192  8192        
Now, the nofiles descriptor value may be changed in ulimit after a restart of system.
Before setting the soft limit, we would need to increase the hard limit:
# ulimit -Hd 8192
Confirm the hard limit change:
# ulimit - Hn 8292
Now, we will be able to change the soft limit of the file descriptor setting with ulimit :
# ulimit -n 8192
Confirm the changes:
# ulimit - n 8192
NOTE: Changing the maxfiles and maxfiles_lim kernel parameters also confirms that the value of soft limit and the hard limit for the file descriptor setting in ulimit is defaulted to the new values of maxfiles and maxfiles_lim after a system restart.
If we need to set the specific value for all users, we can set this in /etc/profile .
If we want to do this for a particular user, then we can edit their .profile , adding a line that has the following format:
ulimit -n new_value
Keywords.
ulimit.

Tuesday, August 12, 2014

HPUX : Checking and adapting the speed of Disk of DS2120.



Checking and adapting the speed of Disk of DS2120.
Overview
Checking and adapting the speed of Disk of DS2120.
Procedures
1. As per the shared logs, no issues found with the DS2120. Also, reviewing the disk failure history, I could see that three of them failed due to bad media and the 4th with a hard failure. The medium errors are not related to any HBA or chassis hardware issues.

2. Checking the SCSI adapter settings, it is found that we are using U320 SCSI speed for mpt8 and mpt14. Please refer the advisory

---- ADAPTER INFORMATION -----------------------------------------------------

Device File                   : /dev/mpt8
Hardware Path                 : 1/0/0/2/0

---- BUS PARAMETERS ----------------------------------------------------------

Initiator SCSI ID             : 7
 SCSI Bus Rate                 : Ultra320   
 SCSI Bus Width                : Wide       

---- CHANNEL CAPABILITIES ----------------------------------------------------

Req/Ack Offset                : 127        
 Bus Mode                      : LVD        
 Quick Arbitration Selection   : Disabled   
 DT Clocking                   : Enabled    
 Packetized                    : Enabled    

---- TARGET PARAMETERS -------------------------------------------------------
Target   Description        Firmware  In Use     In Use
   Id                        Version   Rate       Width
------------------------------------------------------------------------------
    6     ST373455LC         HPC8      Ultra320   Wide     

.
.
.
.
---- ADAPTER INFORMATION -----------------------------------------------------

Device File                   : /dev/mpt14
Hardware Path                 : 1/0/6/1/0

---- BUS PARAMETERS ----------------------------------------------------------

Initiator SCSI ID             : 7
 SCSI Bus Rate                 : Ultra320   
 SCSI Bus Width                : Wide       

---- CHANNEL CAPABILITIES ----------------------------------------------------

Req/Ack Offset                : 127        
 Bus Mode                      : LVD        
 Quick Arbitration Selection   : Disabled   
 DT Clocking                   : Enabled     
 Packetized                    : Enabled    

---- TARGET PARAMETERS -------------------------------------------------------
Target   Description        Firmware  In Use     In Use
   Id                        Version   Rate       Width
------------------------------------------------------------------------------
    8     ST373454LC         HPC3      Ultra320   Wide     
   10     ST373455LC         HPC8      Ultra320   Wide     

This is unsupported for a DS2120 . Please correct this (set the speed to 160) as below:

#mptconfig –r ultra160 /dev/mpt8   >>> Setting speed to 160
Confirm with “y”
#mptconfig /dev/mpt8  >>> check the “Rate in use” for the devices

Repeat the same with /dev/mpt14
Keywords.
mptconfig