Operating System - HP-UX
1748246 Members
3495 Online
108760 Solutions
New Discussion юеВ

script performance with gzip, wait and background commands

 
SOLVED
Go to solution
George Spencer_4
Frequent Advisor

Re: script performance with gzip, wait and background commands

The reason that I am amazed that this works, is that if you attempt to run:

who > /tmp/who.1 & wait who > /tmp/who.2 &

Only the first who command will generate output; the second who command generates an empty file. However, the use of:

who > /tmp/who.3 & wait; who > /tmp/who.4 &

will result in both commands working.

I assume that the use of the wait command, after a group of background gzip's, is to wait until all of these have finished; before proceding to the next group. If the sizes of the logs is similar, then the gzip processes might all finish at around the same time. However, if there is a considerable difference between the log sizes, then the concatenated gzip's would not be the most efficient techique.

Excuse my previous attempt at structured English; I am a bit out of practice.
Dennis Handly
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

>George: Only the first who command will generate output; the second who command generates an empty file.

Right, that's what I said. But there is NO second who command, there is only a wait.

>who > /tmp/who.3 & wait; who > /tmp/who.4 &

Why propagate silliness? Put them all on separate lines.
Michael Resnick
Advisor

Re: script performance with gzip, wait and background commands

Sorry guys... A little communication issue with the DBA... The gzip commands are all on individual lines such as:

gzip... &
gzip... &
gzip... &
gzip... &
wait
gzip...
and so on.

So, this will spawn several gzip processes and then when it hits the wait, the script will not continue until all prior background processes have completed.

Still monitoring the system, but I can see that free memory is decreasing by about 400-500mb per day.
Dennis Handly
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

>but I can see that free memory is decreasing by about 400-500mb per day.

Have you found a process that is increasing in memory use? Does "swapinfo -tam" show an increase in total swap use?
Michael Resnick
Advisor

Re: script performance with gzip, wait and background commands

Since I'm a lowly SE I cannot run swapinfo. :(

I do have access to Glance and can get info from there, but am not an expert at reading the data nor how to locate a memory leak issue.
Dennis Handly
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

>Since I'm a lowly SE I cannot run swapinfo. :(

I'm confused. Only old broken versions of swapinfo fail to let anyone run them. What OS version are you using? What error do you get?

>but am not an expert at reading the data nor how to locate a memory leak issue.

Well, you can look at top and see if the size value is increasing. gpm's process display should have something similar.
Michael Resnick
Advisor

Re: script performance with gzip, wait and background commands

I guess our SysAdmin doesn't like to play fair:

me--> $ /usr/sbin/swapinfo -tam
ksh: /usr/sbin/swapinfo: cannot execute
me--> $ ll /usr/sbin/swapinfo
-r-xr--r-- 1 bin bin 20480 Nov 9 2000 /usr/sbin/swapinfo

me--> $ model
9000/800/S16K-A

It's an hp-ux 11.11 machine.

From top:
Memory: 2305944K (1189060K) real, 3826496K (2605988K) virtual, 2410436K free

That free memory was at about 2850000K yesterday morning, and at about 3250000k the morning before. After a reboot, it is around 6550000K
James R. Ferguson
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

Hi Michael:

> I guess our SysAdmin doesn't like to play fair

So it would seem, since on an 11.11 system of mine:

# ls -l /usr/sbin/swapinfo
-r-xr-xr-x 1 bin bin 20480 Sep 7 2004 /usr/sbin/swapinfo

At the least, have your syaadmin 'chmod' the binary as above. Then tell him/her and the DBA that an open dialog and some cooperation goes a long way to finding a solution.

Regards!

...JRF...

James R. Ferguson
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

Hi (again) Michael:

...and if you have 'glance' available you can see swap utilization with 'w'. Use '?' to see other available views.

Regards!

...JRF...

Dennis Handly
Acclaimed Contributor

Re: script performance with gzip, wait and background commands

>I guess our SysAdmin doesn't like to play fair:
-r-xr--r-- 1 bin bin 20480 Nov 9 2000 swapinfo

This may be HP's fault here. Your sysadmin would have to use swverify to determine it. But getting a latter patch may just fix it.
You might also make a copy of swapinfo and then add execute permission.

>From top: ... 2410436K free

I'm not sure how much you should be trusting top for this critical info.