1748194 Members
4091 Online
108759 Solutions
New Discussion юеВ

unix scripting

 
abhi_291984
New Member

unix scripting

my script was working yesterday but today it is slow why?
it may be the reason below?
1- script does't find the database
2- it find the database
3- it eats the memory
4- cpu utilaization is too much
give me the reason for each.why it is slow.

7 REPLIES 7
Steven Schweda
Honored Contributor

Re: unix scripting

Are you joking?

My car is running slow. What do you think
the problem is?
abhi_291984
New Member

Re: unix scripting

if ur car is slow then it has a problem?
Steven Schweda
Honored Contributor

Re: unix scripting

> if ur car is slow then it has a problem?

Perhaps your script has a problem, too.
OldSchool
Honored Contributor

Re: unix scripting

this feels like a test or interview question....especially since you didn't include the script, any error messages, or diagnostic outputs.
Basheer_2
Trusted Contributor

Re: unix scripting

1- script does't find the database
if it didn't find the database, modify the scrpit to find the database.

2- it find the database
if it finds the database, then what is that you want to do

3- it eats the memory
How you know it is busy eating
check vmstat
4- cpu utilaization is too much
how you know this
iostat

give me the reason for each.why it is slow

check if yesterday's script finsihed to completion.

check if this script is running multiple instances.

ps -ef |grep your-script
Suraj K Sankari
Honored Contributor

Re: unix scripting

Hi Abhi,

What kind of script you are using post your script?

>>my script was working yesterday but today it is slow why?

Did you checked how much time it was taken on yesterday and how much time today?

There are plenty of possibility why your script slow today.

Suraj
V. Nyga
Honored Contributor

Re: unix scripting

Hi,

what do YOU think what is the problem?
What have you checked till now?

>script does't find the database
Then I believe the script will not run.
>it find the database
Then all's fine.
>it eats the memory
Have you checked it?
If you search in this forum for 'memory leak' you'll find many hints, one would be to use glance:
https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-15-28^9637_4000_100__
Else for a first trial you can use:
'swapinfo -tam'
'vmstat -n' you can see your system swapping under 'po'.
'ps -el | sort -r -k10 | head -10'
sorts the 10 proceses with the highest 'memory' usage (column 10).

See the man-pages of these commands for the usage.

>cpu utilaization is too much
Have you checked it?
If you search in this forum for 'cpu utilization' you'll find many hints, one would be to use glance, for a first trial you can use 'top'.
See the man-pages of this command for the usage.

HTH (and maybe you can give more details in your next answer)
Volkmar

*** Say 'Thanks' with Kudos ***