Operating System - HP-UX
1834133 Members
2574 Online
110064 Solutions
New Discussion

vx_maxlink parameter current value

 
SOLVED
Go to solution
ankitj1983
Frequent Advisor

vx_maxlink parameter current value

Hello All,

Can any let me know how to check curent used value of vx_maxlink parameter.

I think this value has reached the limit.

i know default size if 32767 using kctune.



Regards

Ankit
16 REPLIES 16
ankitj1983
Frequent Advisor

Re: vx_maxlink parameter current value

Kindly Reply
Horia Chirculescu
Honored Contributor
Solution

Re: vx_maxlink parameter current value

Hello,

kctune -v vx_maxlink

Should give you the current value of vx_maxlink parameter.

Are you sure that you have reached that limit?

For one file, you can find out the number of hard links like this:

ls -l your_file

-rw------- 1 root root 2379 Nov 12 2008 your_file

The second column (1 in this sample) contain has this info.


From man vx_maxlink:

vx_maxlink â Configure the number of links to a file

....

DESCRIPTION

The vx_maxlink tunable is used to configure the number of links possible to a file on VxFS filesystem

As vx_maxlink is initialized when system is booted, the changes made to vx_maxlink will take effect only from the next system reboot.

Horia.
Best regards from Romania,
Horia.
Dennis Handly
Acclaimed Contributor

Re: vx_maxlink parameter current value

>I think this value has reached the limit.

As Horia asked, any reason you think you need more than that many hardlinks to the same file?
SoorajCleris
Honored Contributor

Re: vx_maxlink parameter current value

Hi,

You can use #kcusage to check the usage

http://nixdoc.net/man-pages/HP-UX/kcusage.1m.html

Regards,
Sooraj

"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Dennis Handly
Acclaimed Contributor

Re: vx_maxlink parameter current value

>Sooraj: You can use kcusage to check the usage

Not for vx_maxlink: Unsupported Tunable: vx_maxlink
ankitj1983
Frequent Advisor

Re: vx_maxlink parameter current value

Hello All,

Thansk to all for replying.

will let u know the error tmrw once i reach to office when i am creating any link.

Regards

Ankit
Dennis Handly
Acclaimed Contributor

Re: vx_maxlink parameter current value

>will let you know the error when I am creating any link.

If you go crazy, you get this error:
ln: too many links to make_hlink
-rwxrwxr-x 32767 326 Apr 20 15:42 make_hlink

EMLINK The maximum number of links to a file would be exceeded.
Horia Chirculescu
Honored Contributor

Re: vx_maxlink parameter current value

>when I am creating any link

Any link to any file? Meaning that you get an error even if you try to make a link to a file with a small number of links to it? Try to make a new file (touch test.txt) and then try to make a hard link to it (ln -f test.txt link1.txt)

This parameter (vx_maxlink) sets the number of possible links to a file. Not to all files (combined - sum of all links to all files from the filesystem).

Horia.
Best regards from Romania,
Horia.
ankitj1983
Frequent Advisor

Re: vx_maxlink parameter current value

The error is below.

mkdir:
cannot create
/LOG_RECV/EDI/R00002/EDIorders/k8c35: Too many
links

Dennis Handly
Acclaimed Contributor

Re: vx_maxlink parameter current value

>mkdir: cannot create /LOG_RECV/EDI/R00002/EDIorders/k8c35: Too many
links

Doh! When I created my test case, I deliberately avoided the above issue.

You can't have more than vx_maxlink - 2 directories in a directory.
What's in /LOG_RECV/EDI/R00002/EDIorders?

I suppose you could cheat and create the directories elsewhere and use a symlink.
Horia Chirculescu
Honored Contributor

Re: vx_maxlink parameter current value

I assume the sub-directories on
/LOG_RECV/EDI/R00002/EDIorders
are created by some application that runs periodically, right?

Can't you archive those directories then perform cleanup (delete the directories and the content) after the data has been processed? You could do that on regular basis as a cron job.

Horia.
Best regards from Romania,
Horia.
ankitj1983
Frequent Advisor

Re: vx_maxlink parameter current value

Hello Dennis,

I understood you solution 70% can you explain further for better understanding.

Honia,

I can't remove the files as its managed by appliaction team so virtually they have to decide whether to keep the files or not.

Regards

Ankit
Horia Chirculescu
Honored Contributor

Re: vx_maxlink parameter current value

>so virtually they have to decide whether to keep the files or not.

Yes, virtually... But do they ever delete any sub-directory from that location?


Horia.
Best regards from Romania,
Horia.
VK2COT
Honored Contributor

Re: vx_maxlink parameter current value

Hello,

By default, the number of subdirectories (and
links too) on HP-UX is 32767.

It can be viewed by:

# kctune -v vx_maxlink

Tunable vx_maxlink
Description Maximum number of links to a VxFS file
Module vxfs50
Current Value 32767 [Default]
Value at Next Boot 32767 [Default]
Value at Last Boot 32767
Default Value 32767
Constraints vx_maxlink >= 32767
vx_maxlink <= 65534
Can Change At Next Boot Only

This is a static kernel parameter so
a reboot is required.

The other method to check the defaults is:

# grep LINK_MAX /usr/include/limits.h

# define _POSIX_LINK_MAX 8 /* The value of a files link count */
# define _POSIX_SYMLINK_MAX 255 /* Number of bytes in a symbolic link */
# define LINK_MAX 32767 /* Max number of links to a single file */

In your specific case, it seems that
it is not the number of symbolic links that
is hurting but number of subdirectories.

So, quite probably your directory
/LOG_RECV/EDI/R00002/EDIorders
already contains 32767 - 2 = 32767
subdirectories.

Possible cleanup:

a) Move some directories into other places;

or

b) Remove some of them;

or

c) Increase the value of parameter
vx_maxlink to up to 65534, which means you
can have 65532 subdirectories in
/LOG_RECV/EDI/R00002/EDIorders

Cheers,

VK2COT
VK2COT - Dusan Baljevic
VK2COT
Honored Contributor

Re: vx_maxlink parameter current value

Hello,

Hmm, silly mathematics by me, that might
work for accountants but not
for IT staff and scientists :)

32767 - 2 = 32767

It should say:

32767 - 2 = 32765

Bad typing, sorry.

VK2COT
VK2COT - Dusan Baljevic
Dennis Handly
Acclaimed Contributor

Re: vx_maxlink parameter current value

>I understood your solution 70% can you explain further for better understanding.

Subdirectories point to themselves and their parents. The latter increments the link count in the parent so that's why you are limited to 32767 - 2.

>I can't remove the files as its managed by application team so virtually they have to decide whether to keep the files or not.

You don't have to remove them, just move them and add a symlink.