Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need script to over load system 1

Status
Not open for further replies.

lpblauen

Technical User
Dec 2, 2004
193
US
I have a test system. It just has aix 5.2.0.4 on it and I want to run something on it to eat memory and cpu so I can test verious maxperm and minperm settings to see how we can tune the system under high loads. What can I run to do this? We have a production system that is using all the memory in the system for filesystemcache. I want to make adjustments and see If I can get the system to use less memory for filesystem cacheing. I know I can set min and max perm to 20 and maxclient to 20 but how do I get the numperm to go down from 79% and test it?
 
Hi

Not sure if will be usefull for you too, I usually do :

- Eat memory :
Code:
for ((i=0;i<1000;i++)); do a[i]=`cat /var/log/messages`; done
- Eat CPU :
Code:
while :; do :; done
Note, that the above method to consume CPU capacity is not very usefull without the [tt]nice[/tt] command.

Feherke.
 
I get a error running the command

0403-057 Syntax error at line 3 : `(' is not expected.

This is a korn shell command?
 
I redid the script like this and it runs but is not eating up the system memory.

#!/usr/bin/ksh
set -x
total=0
while (( $total < 1800 ))
do `cat /var/adm/wtmp`
((total = $total +1))
done

It does put some load on the cpu but only eats 2% of the menory.
 
I use "dd" along with a really big file to eat memory.
First, create a big file of >1GB.
Now, use a loop like you had before, but force the system to eat big chunks of memory:

Code:
while true
do
dd if=bigfile of=otherfile bs=1000000k
done
This will buffer up the first 1GB before writing it out to the destination file.
I don't think this would hammer the CPU too hard, however. But, you can tune just how much memory you want to eat.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
I think I found a way to eat the memory. I was ftping a file to the system and memory started going down. Now I'm waiting to see if the system memory will come back now that I stopped the ftp. It seems to stay where it was. Not getting memory back. Do I need to run something to get the memory to refresh?
 
lpblauen,
When you say you are not getting the memory back, do you mean the number of free pages is not increasing?

AIX only frees memory when it must. What you will normally see under AIX is that the memory utilization starts growing after a reboot, and then seems to level off around 100%. This is how it is designed. Why free a file cache page if it's not needed for something else? If you are using vmstat to show how many pages are free it will normally hover around 128 pages or so (assuming no tuning has been done).

Now that you scripting question is answered it seems that ultimately your question is about diagnosing and tuning an AIX system so you might want to checkout the IBM Performance Tools RedBook ( You could also try in the AIX forum here on Tek-tips. If you can fully describe what the problem is and its actual effects (i.e. slow database reads or bad database cache hits) we might be able to give you pointers on how you might go about tuning the system (i.e. I tune databases to maxperm between 10 - 25% because the database engine is already caching the database blocks).

I apologize if I misunderstand the intent of your question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top