08-05-2004 04:34 PM
We have some shell scripts that take about couple of minutes to execute on HP UX 10.20. But the same shell scripts are taking more than 7 minutes to execute HP UX 11.00.
Are there any parameters (shell / kernel) that can affect the execution of time of scripts so much?
If there are how do they need to be configured?
Can there be any other reason for the slow execution of scripts?
The scripts are mainly searching for some log files using find command and looking for messages in those files using grep command.
Any help will be appreciated.
08-05-2004 04:40 PM
If its using the find command then that probably explains the differences in execution time.
The larger the filesystem, the longer the find command will take to run. Try to limit the find to specific directories.
08-05-2004 04:46 PM
It will give the time taken by the script
Shell execution are depends upon the command and their environment and needs. Try to debug what your shell program doing as set -v or set -x (good)
Trace out what it is doing differently there.
Try to use effective logic's to use find / grep . Don't use cat logfile. Directly grep it or use < logfile.
It is good to have your shell script and time performance & debugging difference
08-05-2004 05:02 PM
08-05-2004 06:44 PM
If so, try:
find / -fsonly hfs
and find / -fsonly vxfs
Mark Syder (like the drink but spelt different)
08-05-2004 07:18 PM
Certainly the find
Put your logfiles in fixed places and then no find needed over the whole system.
You can even use the ln command to
make 1 directory containing softlinks to all your log directories and only search via the start point with the -follow option
08-06-2004 12:28 AM
Thank you for your replies and suggestions.
I do not think we have any issue with the file system because this script is part of the application that we are porting from HP UX 10.20 to HP UX 11.00 and it searches only in specific directories and only for specific files using the find command. The structure of the directory/file system is same on both HP UX 10.20 and HP UX 11.00 systems.
We will use the shell settings (set -x and/or set -v) to check the execution of the script to see if tells us anything.
08-06-2004 01:35 AM