30 Load average with fping script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting 30 Load average with fping script
# 1  
Old 12-22-2009
30 Load average with fping script

Hi! I've make a script that gets a list of 200 Ip's and calls another script once per ip in a infinite loop with a pause of 10 seconds. So It calls over 200 times every 10 seconds the second script (that makes a fping). But this cause a load average of 30. I've been reading about this and I undestand that the load average is high because there are a lot of processes (the second script I guess) waiting to be executed. My server has a good performance so, is possible that this high load will become a problem in the future or is it a normal behavior when you run such scripts as I do?

My top info:
Code:
top - 11:27:01 up  2:36,  2 users,  load average: 27.23, 28.56, 28.74
Tasks: 281 total,  32 running, 248 sleeping,   0 stopped,   1 zombie
Cpu(s):  1.4%us, 97.1%sy,  0.5%ni,  0.0%id,  0.0%wa,  0.0%hi,  1.0%si,  0.0%st
Mem:   3115860k total,   588408k used,  2527452k free,   104720k buffers
Swap:  5177336k total,        0k used,  5177336k free,   278932k cached


Last edited by charlscross; 12-22-2009 at 06:30 AM.. Reason: Add
# 2  
Old 12-22-2009
You are correct - it has the potential for performance problems. Combine the two scripts. Make the second script a function call with some editing
Code:
second_script()
{
   # edit your other script file and put it here.



}
#  main ---------------
while :
do
   second_script  arg
done

# 3  
Old 12-22-2009
Thanks brother! But I need the second script to play in parallel, so I call the second with the & option.

Code:
    nohup /etc/pingers/insertPingWan.sh $d > /dev/null&

This is because every ping cannot wait for other pings to be completed, so the new question is will the function be played in parallel as the script did? Or is there anyway for launching the function in parallel?
# 4  
Old 12-22-2009
Try it and see for yourself.
# 5  
Old 12-22-2009
Ok, I tried several ways, but always get high load average if I do it in parallel. I-m running a one processor CentOS VM inside an 1,86 x 2 processor with 3,6 of Memory. I-m just doing 1000 fpings into a minute, with their 1000 mysql inserts. So is normal in this enviroment to get that load average values or my machine should carry with this without problem?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script affect load average

Hello I have created next scritpt to do the next: chekp if host is alive. When the host down, launch telnet other equip to do checks. When execute the script the load average of the machines increase. For example: Before launch script top - 11:14:56 up 14 days, 18:06, 3 users, load... (3 Replies)
Discussion started by: capilla
3 Replies

2. Shell Programming and Scripting

Script to load daily average I/O stats from a .ksh file into Oracle db

Hi can anyone help me with a script to load output of the .ksh file into an Oracle database. I have attached sample output of the information that i need to load to the database (2 Replies)
Discussion started by: LucyYani
2 Replies

3. HP-UX

Load average unit

Hi, On load average graph, unit is 100m, 200m, 300...800m. I don't understand what it means. Thx for helping (3 Replies)
Discussion started by: Michenux
3 Replies

4. UNIX for Dummies Questions & Answers

Help with load average?

how load average is calculated and what exactly is it difference between cpu% and load average (9 Replies)
Discussion started by: robo
9 Replies

5. UNIX for Advanced & Expert Users

Load average in UNIX

Hi , I am using 48 CPU sunOS server at my work. The application has facility to check the current load average before starting a new process to control the load. Right now it is configured as 48. So it does mean that each CPU can take maximum one proces and no processe is waiting. ... (2 Replies)
Discussion started by: kumaran_5555
2 Replies

6. UNIX for Dummies Questions & Answers

Load Average threshold

What should be the threshold for load average of a quad core processor? What constitutes "good" and "bad" load average values? (2 Replies)
Discussion started by: proactiveaditya
2 Replies

7. UNIX for Dummies Questions & Answers

Please Help me in my load average

Hello AlL,.. I want from experts to help me as my load average is increased and i dont know where is the problem !! this is my top result : root@a4s # top top - 11:30:38 up 40 min, 1 user, load average: 3.06, 2.49, 4.66 Mem: 8168788k total, 2889596k used, 5279192k free, 47792k... (3 Replies)
Discussion started by: black-code
3 Replies

8. Solaris

load average query.

Hi, i have installed solaris 10 on t-5120 sparc enterprise. I am little surprised to see load average of 2 or around on this OS. when checked with ps command following process is using highest CPU. looks like it is running for long time and does not want to stop, but I do not know... (5 Replies)
Discussion started by: upengan78
5 Replies

9. UNIX for Dummies Questions & Answers

Load Average

Hello all, I have a question about load averages. I've read the man pages for the uptime and w command for two or three different flavors of Unix (Red Hat, Tru64, Solaris). All of them agree that in the output of the 2 aforementioned commands, you are given the load average for the box, but... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

10. UNIX for Advanced & Expert Users

load average

we have an unix system which has load average normally about 20. but while i am running a particular unix batch which performs heavy operations on filesystem and database average load reduces to 15. how can we explain this situation? while running that batch idle cpu time is about %60-65... (0 Replies)
Discussion started by: gfhgfnhhn
0 Replies
Login or Register to Ask a Question