Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Stephen Carpenter <steve.carpenter@compaq.com>
Subject: Re: File and record locks
Date: Tue, 09 Jul 2002 14:21:03 GMT	[thread overview]
Message-ID: <3D2AEFD9.7030905@compaq.com> (raw)
In-Reply-To: 1026143512.25156.0.nnrp-12.c246a78e@news.demon.co.uk

To look at the # of file/record locks in use try compiling and running 
this program:


/*
  * Show the number of record locks configured on a system
  *
  * This program should be run set group-id kmem
  */

#include <stdio.h>
#include <nlist.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/flock.h>


/*
  * Define the name lists were are interested in
  */
struct nlist name_list[] = {
   { "_flckinfo" },
   { 0 }
};


void
main ()
{
   int kmem;
   struct flckinfo lock_info;

   kmem = open ("/dev/kmem", 0);

   /*
    * Get the kernel name list
    */
   nlist ("/vmunix", name_list);

   /*
    * Read the value of flckinfo
    */
   lseek (kmem, (off_t) name_list[0].n_value, 0);
   read (kmem, &lock_info, sizeof (struct flckinfo));

   /*
    * Print out the lock information
    */
   printf ("Max records locked       =  %d\n", (int) lock_info.recmax);
   printf ("Max files locked         =  %d\n", (int) lock_info.filmax);
   printf ("Lock records in use      =  %d\n", (int) lock_info.reccnt);
   printf ("File headers in use      =  %d\n", (int) lock_info.filcnt);
   printf ("Total lock records used  =  %d\n", (int) lock_info.rectot);
   printf ("Total file headers used  =  %d\n", (int) lock_info.filtot);
}




On a V5.x box to see the number of record locks configured run:

# sysconfig -q vfs nlock_record
vfs:
nlock_record = 10000


Use sysconfigdb or dxkerneltuner to change the nlock_record parameter.


Regards,

Stephen Carpenter



      parent reply	other threads:[~2002-07-09 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-08 15:51 File and record locks Nims
2002-07-09  6:56 ` Emmanuel Choquet
2002-07-09 14:21 ` Stephen Carpenter [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox