Swap stress test


 
Thread Tools Search this Thread
Operating Systems Solaris Swap stress test
# 1  
Old 04-07-2013
Bug Swap stress test

I was hoping to test a bug posted by oracle, which indicates that the system may crash when using a zfs volume as a swap device. We moved swap away from zfs and over to raw disk devices in order to stop the crashes we've been experiencing.
What I wanted to do was to re-create the crash in a test environment in order to validate our suspicions. I compiled a program that uses malloc() to eat up memory, but the system will kill it before any swap space is used.
how can I reliably force the system to use swap space?
# 2  
Old 04-07-2013
Read the documentation about "sunvts".

SunVTS 7.0 Tests
# 3  
Old 04-07-2013
Quote:
Originally Posted by butchie3980
I compiled a program that uses malloc() to eat up memory, but the system will kill it before any swap space is used.
Can you elaborate ? Solaris shouldn't kill processes reserving memory. There is no OOM killer mechanism.
# 4  
Old 04-08-2013
some more details

here's some more details about what we run into. perhaps we're just not going about it the right way. for starters, we're running solaris 10 u10. installed ram is 128GB. Swap space is 8GB volume.
the idea is to trigger swap usage, and we try to monitor that two ways, using top and "swap -l"
first step that we try is to fill up /tmp with a couple of simple "mkfile 10g /tmp/memeater01" style commands. We can see the available ram decrease each time we create one of those files in /tmp.

we get down to about 10-ish GB of free ram and start to encounter "no space available" errors when trying to create tmp files.

Next think we tried was to push it over the edge using a program that simply uses malloc() calls to reserve ram and hold onto it. we can also watch the avalable ram decrease until the 10GB (roughly) threshold and then this program dies.

A combination of both /tmp files and the malloc() program still dies around the 10gb free threshold and we never ever see any indicators that swap space is being used.

---------- Post updated at 10:29 AM ---------- Previous update was at 10:24 AM ----------

Just downloaded VTS, and started reading the documentation. Tried a test run, but don't know if the defaults are what we need. We only enabled the memory test and ran it. According to top, free RAM dropped to 36GB and stayed there, Free swap stayed the same no changes. We sat there and watched top for about 30 minutes before getting pulled away to a meeting. so we stopped it and decided to try later. are there some parameters we need to set or change?
# 5  
Old 04-08-2013
Just calling malloc() isn't going to do a thing other than reserve swap space. The call to malloc() is just going to reserve memory - it's not going to actually create the virtual pages and their mappings to physical pages. For that to happen, you actually need to USE the memory.*

Change your malloc() calls to calloc() - you should see swap space get used then.

* - for the overly-pedantic, that's not TOTALLY true as multiple calls to malloc() will probably cause at least a handful of pages to be created and mapped, but it's close enough.
# 6  
Old 04-08-2013
Quote:
Originally Posted by butchie3980
the idea is to trigger swap usage, and we try to monitor that two ways, using top and "swap -l"
first step that we try is to fill up /tmp with a couple of simple "mkfile 10g /tmp/memeater01" style commands. We can see the available ram decrease each time we create one of those files in /tmp.

we get down to about 10-ish GB of free ram and start to encounter "no space available" errors when trying to create tmp files.
You have exhausted your virtual memory, which includes most of the RAM plus all of the swap area when you get these messages. Can you post the actual numbers and the commands you use to measure memory and swap usage ?
Quote:
Next think we tried was to push it over the edge using a program that simply uses malloc() calls to reserve ram and hold onto it. we can also watch the avalable ram decrease until the 10GB (roughly) threshold and then this program dies.
How (why) does it die ?
Quote:
A combination of both /tmp files and the malloc() program still dies around the 10gb free threshold and we never ever see any indicators that swap space is being used.
Are you you actually accessing all of the the allocated pages ?
Quote:
Just downloaded VTS, and started reading the documentation. Tried a test run, but don't know if the defaults are what we need. We only enabled the memory test and ran it. According to top, free RAM dropped to 36GB and stayed there, Free swap stayed the same no changes. We sat there and watched top for about 30 minutes before getting pulled away to a meeting. so we stopped it and decided to try later. are there some parameters we need to set or change?
VTS is to stress test you hardware in order to detect faulty components. I don't think this is what you are looking for, although I don't precisely understand what exactly you are trying to achieve/fix ...
# 7  
Old 04-08-2013
from the VTS docu:

Quote:
Memory Test

The Memory test is used to test the DRAMs, the memory subsystem, virtual memory, and the swap partitions of disks in system. This test achieves large memory bandwidths and performs a mix of read and write MARCH operations to the memory. This test also uses background patterns to bring out pattern sensitive faults in the DRAMs. A part of the test uses the Solaris valloc (page aligned) system call to allocate, write, read, and compare virtual memory. The system call causes heavy paging activity in the system and simulates a stressful environment for the OS. The test reports hard and soft error correction (ECC) errors, memory read errors and addressing problems.
from that information i suppose there will be access to the swap space...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Network stress test.

Hi there. First things first, this is nothing to do with the internet or ISP speed, I know what that is, I know what it's doing. I have a cluster of 128 single board computers running a branch of Debian. I want to run some kind of stress test to ensure they can transfer data (a) to each... (2 Replies)
Discussion started by: MuntyScrunt
2 Replies

2. IP Networking

Stress Test a NIC

I need to find out if the NIC on my MP-RAS box is bad. Unfortunately just sending out a ping to the loop back is not going to cut it. I need to be able to send out packets of information for several minutes at a time. I can't seem to find a tool or command to do this. Is anyone aware of a way to... (1 Reply)
Discussion started by: wardduncan
1 Replies

3. UNIX for Advanced & Expert Users

Stress Run

Please anyone can tell me what is Stress in unix and how can I Perform Stress Runs on the UNIX environment Please reply soon it's urgent:confused: (5 Replies)
Discussion started by: mubashir
5 Replies

4. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

5. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

6. Programming

Stress testing memory using malloc in linux ??

Hi to all, Recently i am testing an equipment that runs in i586 fedora linux. I have to test mmap function. For that i determined to fill the memory and run the required application to check whether it throws any mmap error regarding low resources. This is the line that does the allocation. ... (3 Replies)
Discussion started by: frozensmilz
3 Replies

7. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

8. UNIX and Linux Applications

Solaris & Linux memory stress test?

I'm looking for a script or some other application that will use up a lot of memory on a Solaris or Linux server, in order to test a monitoring application. So far I have found a script that's good for CPU usage but it does nothing for memory. I have also tried the application called 'stress'... (0 Replies)
Discussion started by: Kraas
0 Replies

9. Solaris

how to stress the memory

Hi All, Is there way to stress memory on Solaris 10? If yes, how do I monitor the memory usage? (3 Replies)
Discussion started by: samnyc
3 Replies
Login or Register to Ask a Question