psTestGetIPAddresses

Syntax

psTestGetIPAddresses -Tnumber_of_threads -Xiterations
-Ccomputer_names -Sstack_size -Nnumber_of_files_to_open
-Flog_file -Ooptions

 

Arguments

-T

Number of Threads to Launch [100]

-X

Iterations over list of computer names [100]

-C

Computer names (if a list, enclose in quotes) [firstsun]

-S

Stack size [1048576]

-N

Number of temp files to create & fopen() [0]

-F

Output log of messages [standard output]

-O

Options

 

Options

n

Do NOT do lookups

o

Do opens() instead of fopens()

s

Spawn a child process that does the same thing

i

Let child inherit parent's file descriptors

 

Environment Variables Behind the Scenes

PS_SYSMSG_FILE

For the location of the system-wide messages file.

 

Notes

     This program opens N files.   While they are open, this program
makes calls to the operating system's version of gethostbyname.
     The problem is, is that most C I/O libraries only support up
to 256 file descriptors.   One can only have 256 standard C I/O
descriptors open.   If one tries to fopen() a C I/O file after that,
fopen() fails.
     Also, gethostbyname_r() and gethostbyname() uses the standard C
I/O library to fopen() some file under the covers.   If the
application is already using 256 descriptors and then calls
such a gethostbyname, gethostbyname fails.
     While fopen() uses a standard C I/O file descriptor.   open()
does not.   You can open() more files than fopen().  A descriptor
is still a descriptor.  It is just that the C I/O library sees the
first 256.   If the app opens() 256 times, there are no more file
descriptors left for calls to fopen() to succeed.  The app can still
call open() hundreds of more times, but not fopen().
     Remember that standard input, output and error are always open
open.   They consume 3 file descriptors.   So really, you have only
253 available standard C I/O file descriptors.
     Watch out for thread size.  On some platforms, a new thread
allocates its entire stack up front.  You may have to decrease the
stack size in order to create additional threads.
     Spawning a child process.   When -Os, this program spawns a child
process after opening all its files.  This tests how many files your
child process can open.   Since your child process inherits open
file descriptors from its parent, the number of new files the child
can create depends on how many the parent has opened.   We are also
testing the FD_CLOEXEC flag.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009