AIX change ulimit for a user

I have seen two different ways for changing the ulimit for a user in aix. Which one is better?

Option 1

edit /etc/security/limits

oracle:
        fsize = -1
        data = -1
        stack = -1
        fsize_hard = -1
        nofiles = -1
        nofiles_hard = -1

Option 2

chuser rss=-1 oracle
chuser fsize=-1 oracle
chuser data=-1 oracle
chuser nofiles=-1 oracle
chuser stack=-1 oracle

they both do exactly the same - there is no better or worse :slight_smile:
btw - it is almost always a bad idea to increase the hard limits for a non-root user ... and to set nofiles to unlimited

3 Likes

I only set nofiles = 64000. Do you think that is to high? I was just using the above as an example.

Greetings and Happy New Year!

You can't judge like that what is good/bad...
Oracle is no ordinary user: many users access to files using oracle UID the same for processes etc
So it will depend on the size of your RDBMS or how many instances you have running on a server, how many processes are "oracle" etc the same for files and file size: no ordinary user would produce a file on a system the size of a full export (oracle)...
Why unlimited as value is not a good idea unless you know what you are doing AND what the others do:
Just an example: if a coder badly checked his new code that went in production ( or just a bug...) fall on a case you case have files opening but not closed correctly, worse though quite funny when it occurs: executing an infinite loop opening new processes...
You end with a freeze of the system where if lucky and an admin can connect will shutdown gracefully the box, more severe no one can connect and you have no other choice but to power off...
AIX at least lets you define on a specific user basis, may not be the case of all Unixes you see

Addendum:
Q: Do you have any issues? Giving a lot of resources will give you peace ( no errors or warning of running out of resources...) only that waste of resource will affect performance, if that is OK with you and production are happy, well why worry except for the case you do have an issue, it will be in proportion with what you gave

1 Like

The point is: set a real limit.
"Unlimted" means a process is allowed to consume all system resources. And a buggy/wild/looping process could do so.

1 Like

This part makes sense. Some users know what they are doing and some don't.

Why unlimited as value is not a good idea unless you know what you are doing AND what the others do:

They said they were having trouble creating the files they need to create.

64k is fine - its very unlikely that oracle will have this many files open at the same time anyways (which is what this tunable determines) as the Database itself is in just a number of large .dbf files. In addition they will have some text files and libraries open - but I doubt the user oracle even owns 64.000 files :slight_smile: