set permanent ulimit

Hi all

I have a request from user to change the file descriptors limit to 8192. The current setting are:

root@xxxxx:(wmdev)> ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         1048576
stack(kbytes)        131072
memory(kbytes)       unlimited
coredump(blocks)     4194303
nofiles(descriptors) 4096
root@xxxxx:(wmdev)>

I have tried to change it with command

 ulimit -n 8192

but when i logged off the server the setting went back to 4096

Is there anyway I can make this change permanent? I know that I can edit the user's .profile or /etc/profile but I am not sure how and what I need to add to the profile. This is the user's .profile

# @(#)B11.23_LR       

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
        if [ "$TERM" = "" ]
        then
                eval ` tset -s -Q -m ':?hp' `
        else
                eval ` tset -s -Q `
        fi
        stty erase "^H" kill "^U" intr "^C" eof "^D"
        stty hupcl ixon ixoff
        tabs

# Set up the search paths:
        PATH=$PATH:.

# Set up the shell environment:
        set -u
        trap "echo 'logout'" 0

# Set up the shell variables:
        EDITOR=vi
        export EDITOR

        HISTSIZE=1000
        export HISTSIZE

# Set Library paths
        export SHLIB_PATH=/u01/app/webMethods_dev/IntegrationServer/lib

# Set Java Path
        JAVA_HOME=/u01/app/webMethods_dev/jvm/hp142/jre/bin

        mesg -y

        resize > /dev/null

Also, you can see the OS version I am using-HP UX 11.23

Please help, I need to sort this out today..thank you

---------- Post updated at 05:58 PM ---------- Previous update was at 05:34 PM ----------

Thanks for viewing,

I'm answering my own questions, added the line

ulimit -n 8192

to the user's .profile:

#set number of open files

        ulimit -n 8192
".profile" 43 lines, 709 characters 

Lets see if this works

---------- Post updated at 06:16 PM ---------- Previous update was at 05:58 PM ----------

that didn't work:

ulimit: The specified value exceeds the user's allowable limit.

On a linux system editing /etc/security/limits.conf will allow you to set ulimits on several different levels (user, group, etc).

I don't have access to an HP-UX machine, so I don't know if this caries to that flavour of UNIX. If it's not the same under HP-UX, maybe there is something similar.

Yup I know, the same for AIX, its set at /etc/security/

Having hard time with HP-UX here

The limits for an ordinary user and root are different.
Check "ulimit" when logged in as the user (not root).

The general answer is to up the HP-UX kernel parameter "maxfiles" (maximum files open by one user) then control individual users with "ulimit". Depending on what the application is doing this could also involve increasing the kernel parameter "nflocks".

Personally this has only been necessary with systems incorrectly configured with impersonal access to a database which created umpeen open files per username with "umpteen times users" locked files.