Checking and Changing UNIX Kernel
Parameters
Check the following UNIX kernel parameters and modify them if necessary:
· Number of open files per process
On UNIX platforms, each process may only have a certain number of files open at once. If you create a large number of indexes and queues during routine operation, the TREX processes, in particular the queue server and index server, open a lot of files.
With many UNIX installations, the value for the maximum number of files that the processes are allowed to have open is too low. The parameter must have the following value:
Operating System |
Value |
AIX, HP-UX, Sun Solaris |
At least 2048 |
Linux |
At least 1024 |
· HP-UX only:
¡ Process Size
The process size should be at least 2GB.

The process size is not limited for AIX and Sun Solaris.
¡ Files larger than 2 GB
Since TREX can also use files that are larger than 2GB, these must be activated at operating system level.
The TREX directory contains a test program that you can use to check whether the kernel parameters are set at a suitable level. If this is not the case, you should change the kernel parameters.
...
1. Log on with the user <sapsid>adm.
2. Go to the TREX directory.
3. Set the environment variables required by TREX:
¡ Bourne shell sh, Bourne-again shell bash, Korn shell ksh:
. TREXSettings.sh
¡ C shell csh:
source TREXSettings.csh
4. Test the size and number of open files per process:
portlibtester.x –file
Number of open files:
This command creates test files in the directory /tmp/portlibtester. The test must give a result of at least 1000 files (Linux) or 2000 files for other UNIX platforms. If this is not the case, you should change the kernel parameters.
5. Only HP-UX – Test the possible process size:
portlibtester.x –mem
This command calls upon as much main memory as possible. The test must output the value 1900 MB at least. If this is not the case, you should change the kernel parameters.
...
1. Log on as root.
2. Carry out the following steps as appropriate, depending on whether you are working with or without a Network Information System (NIS).
¡ (Without NIS) Execute the following command:
chuser nofiles=2000 trx<instance_number>
¡ (With NIS) Add the following entry to the file /etc/security/limits:
trx<instance_number>:
nofiles=2000
3. Restart the host using reboot.
..
1. Log on as root.
2. Open the administration tool SAM (usr/sbin/sam).
3. Set at least the following values in the dialog box kernel configuration/configurable.
Kernel Parameter |
Lowest Acceptable Value |
Process Size |
|
maxdsiz |
0X80000000 or 2147483648 |
maxdsiz_64bit |
0X80000000 or 2147483648 |
maxtsiz |
0X40000000 or 1073741824 |
maxtsiz_64bit |
0X40000000 or 1073741824 |
Number of Open Files |
|
maxfiles |
2048 |
maxfiles_lim |
2048 |
nfile |
20000 |
4. Restart the host using reboot.
...
1. Log on as root.
2. Execute the following command:
fsadm -o largefiles <mount-point>
In doing this, you activate usage of files larger than 2 GB on a certain file system.
...
1. Add the following line to the end of the script <TREX_DIR>/TREXSettings.sh:
ulimit -n 1024
2. Add the following line to the end of the script <TREX_DIR>/TREXSettings.csh:
unlimit openfiles

TREXSettings.csh is not relevant for the TREX daemon. It is only relevant if you start the TREX servers manually or execute test scripts.
3. If the TREX daemon is running, restart it.
.
1. Log on as root.
2. Add the following lines to the configuration file /etc/system.
set rlim_fd_max=2048
set rlim_fd_cur=2048
3. Restart the host using reboot.
After making the change, execute portlibtester.x –file again. If the number of open files is still too low, the UNIX system administrator must have restricted this parameter in another way. Contact the UNIX system administrator to remove this restriction.

Note for Linux: If you receive error messages during indexing, the value 1024 for the number of open files may not be sufficient. If this is the case, run TREX on root (you can only raise the parameter value to 2048 on root). Proceed as follows:
· Make sure that the script <TREX_DIR>/TREXSettings.sh contains the following line at the end:
ulimit -n 2048
· Make sure that the script <TREX_DIR>/TREXSettings.csh contains the following line at the end:
unlimit openfiles
TREXSettings.csh is not relevant for the TREX daemon. It is only relevant if you start the TREX servers manually or execute test scripts.
· Add a comment sign to the configuration file <TREX_DIR>/<host_name>/TREXDaemon.ini before the following lines:
#userid = trx<instance_number>
#groupid = <group>
This change causes the TREX daemon to run on root next time it starts.
