Operating System - HP-UX
1820395 Members
3628 Online
109623 Solutions
New Discussion юеВ

Maximum number of files and directory within a single directory

 
Dan Goshdigian
New Member

Maximum number of files and directory within a single directory

I need help in answering these questions. This is related to the issue with reaching maximum file
limit on a HPUX 11.11 server with People Financial logs.

1) What is the HP-UNIX number of files limit?
2) Is this limit set per filesystem or directory?
3) Does this limit also include directories under the directory?

Thanks!
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Maximum number of files and directory within a single directory

Hi Dan:

There is no practical limit if 'largefiles' are enabled and you are running a VxFS filesystem. That is to say that inodes will be allocated as needed.

The practical constraint will be performance in searching for files and in updating the inode metadata associated with the files.

Multiple directories with smaller numbers of files will be more efficient than smaller numbers of directories containing large numbers of file from a search performance perspective.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Maximum number of files and directory within a single directory

Shalom,

1) No.
2) No.

However when you get past a certain number of files in a single directly, an ls command all by itself can bring a system to its knees.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: Maximum number of files and directory within a single directory

No, No, and No but even having to ask this question almost certainly indicates a bad design. A filetree is a poor substitute for a database and that seems to be exactly what you are doing. It is possible to create a vxfs filesystem (I assume that you are using vxfs filesystems rather than hfs.) with a fixed number of inodes but you must explicitly override the default behavior which dynamically creates additional inodes when needed. Rather than hitting these limits you will hit practical performance limits in searching large directories.

Although I doubt quotas are in play, it is possible to limit the number of files using quotas so that that could be a limit. It would be helpful to post the exact error message you are seeing as that would give some clue to the system call and errno value you are seeing.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: Maximum number of files and directory within a single directory

No limits. You can have millions and millions and millions of files in one directory. As mentioned, this design will come with VERY serious consequences. For instance, an ll command will take several minutes and if you decide to use the * character (like lp *), you will always get a LINE TOO LONG error message. In other words, the usual directory tools will be very, very painful to use.

Now, are you sure that your application will handle an unlimited number of log files? A badly designed program might try to open all of them at the same time (which will exceed the kernel's maxfiles or maxfiles_lim parameter). This is a question for the author of the application.


Bill Hassell, sysadmin
whiteknight
Honored Contributor

Re: Maximum number of files and directory within a single directory


1) What is the HP-UNIX number of files limit?
No limit

2) Is this limit set per filesystem or directory?
No limit

3) Does this limit also include directories under the directory?
No limit

Please paste the error message you encountered

WK
Problem never ends, you must know how to fix it