1825766 Members
2098 Online
109687 Solutions
New Discussion

HP UNIX Accounting Files

 
Frijo Franco
Advisor

HP UNIX Accounting Files

Hello, Can cany one help me with a solution for a strange problem(not sure if its really a problem)

We are using a timeshare environment of around 25 HP UNIX servers for processing. We have some shel scripts which does the data formatting and LSF submission using a batch ID. Also this can be run by users using a shell. We are seeing only 2-4 entries in the Process Accounting files when it is run by a batch ID(without a shell/terminal) but when it is run by a user terminal it creates thousands of entries in the accounting files. So its looks to the Sys Admin that the script is spawning thousands of processes. can any one please give an explanation for this.

Thanks in advance.
Frijo Franco
11 REPLIES 11
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

Does any one know about this Accouting files, please help...
thanks
frijo
OldSchool
Honored Contributor

Re: HP UNIX Accounting Files

LSF? Are you referring to Platform LSF batch scheduler?
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

Yes. But my questions is on Unix Account files. It logs the program name multiple times in the accounting files why????

thanks
frijo
OldSchool
Honored Contributor

Re: HP UNIX Accounting Files

are you sure its not spawning lots of processes?

If some one runs it from a terminal, what does "ps -fu " return?

also, "man 4 acct" will describe the file formats in use.
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

I have created a sample script as below and when I run it, it logs the program name 6 times in the accounting file. I am sure this program doesnt spawn any processes.

#!/bin/ksh

echo "test" | cut -c1-2
echo "test" | cut -c3
echo "test" | cut -c1-4
echo "test" | cut -c1
echo "test" | cut -c2-3
echo "test" | cut -c2

here is the entries in the accounting file.

mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 148.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.01 0.01 0.00
cut prfrf pts/24 22:30:45 22:30:45 0.01 0.01 40.00
mydbu prfrf pts/24 22:30:45 22:30:45 0.10 0.04 963.00
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

Does any one know about this.

Thanks
Frijo
Matti_Kurkela
Honored Contributor

Re: HP UNIX Accounting Files

A script like your example definitely *does* spawn other processes.

"cut" is not an internal command of the shell, so the shell must fork+exec (spawn) a process to run it. If it didn't do that (if you prepended "exec" to the command) the command would replace the shell process executing the script, and the script would not run any further after that command.

"echo" may be an internal command of the shell or it may be using an external binary /bin/echo.

To create a pipeline, the shell must create a process for each pipeline component, so that their inputs & outputs can be connected together.

To your original question:
it looks like either your batch ID has different settings for Process Accounting than the user sessions (basically, the accounting system is logging more things about user sessions than on batch IDs) or the application really behaves differently when run by a batch ID.

MK
MK
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

thanks for the reply. But if you see the above accounting table info,the program name "mydbu" is repeated mutiple times. I am not botherd about the "cut" but the program name is logged multiple times. Thats my problem and i want to know any. please help me on this.

Thanks in advance.

-Frijo
Dennis Handly
Acclaimed Contributor

Re: HP UNIX Accounting Files

>program name "mydbu" is repeated mutiple times.

You may want to run tusc. Perhaps it is forking that many times??
Frijo Franco
Advisor

Re: HP UNIX Accounting Files

Hello,

The content of "mydbu" is as follows.

#!/bin/ksh

echo "test" | cut -c1-2
echo "test" | cut -c3
echo "test" | cut -c1-4
echo "test" | cut -c1
echo "test" | cut -c2-3
echo "test" | cut -c2

Thanks
Frijo
Dennis Handly
Acclaimed Contributor

Re: HP UNIX Accounting Files

tusc shows there were 13 processes. 7 execve and 12 forks.

So it seems the 13 entries in your log file match up to the processes.