Swap space calculation

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
# 1  
Swap space calculation

Hi every one.

I have a client with a Unixware 7.1.3 system.
4GB Ram
2 x Xeon CPU's
4 x 147GB scsi Raid 5 Config
1 x 147GB Scsi spare drive

Running a database application on top of Unixware

What is the formula you use to determine what the size of the swap file is suppose to be ?.

The "Administration and Installation" guide does not list this information it only says "Size of System = 256MB Size of swap space = 200MB"

On Debian Linux i use the following:
2 x ( Physical Ram ) = ( Swap file size )

For the client's Unixware system the following information was retrieved

# swap -l
path dev swaplo blocks free
/dev/swap 7679,2 0 4192256 4192256

swap blocks = 4192256 x 512 = 2,146,435,072 ( 2.1 GB )
free blocks = 4192256 x 512 = 2,146,435,072 ( 2.1 GB )

# swap -s
total: 0 allocated + 1977784 reserved = 1977784 blocks used, 10311584 blocks available

used 1977784 x 512 = 101,265,408 ( 101MB )
available 10311584 x 512 = 5,279,531,008 ( 5.2GB )

So my total swap space is 5.3GB.

What i'm trying to establish here is this.

1) Did the guy who installed the system do the correct calculation for the swap file ?.

2) What is the correct formula to follow for calculation swap space for a new system ?.

Thanks in advance
# 2  
There is no fixed determination for a swap/RAM ratio - generally you have a good handle on it. 2x -> 3x the size of RAM is reasonable to start with. What you show with 5+ GB is not out of that range. And your calculation seems to me to be alright. This is my opinion. Do you see very high swap utilization right now? Is there something to indicate a big performance problem?

A lot of documentation simply gives an estimate of what a single app requires with no additional load on the system other than app users.

What I see:
If this is a commercial application with more than 10 concurrent users, your system could be short on disk for a real db application. Example: we have a CIS with .5 terabytes of data and 450 users. It is installed across 20 filesystems each on physically distinct disks.

The point is there was a lot of load balancing needed early on to get things to work well, like keeping swap separate from tablespaces, putting active tablespaces on their own filesystem/disk. You cannot do much of that with 2 physical disks.
# 3  
Completely agree with jim. There is no magic formula to size swap. It depends on how many applications and processes are running on your system and what their performance requirements are. In fact if you have enough memory installed you may have no need for swap...which is pretty subjective in itself. Adding more swap means you can fit more application pages into virtual memory at the expense of reduced performance though.

The recommendation of 200Mb in your case is for the database application that you are installing on your machine and since you have 5.2Gb installed system-wide that should more than suffice. Starting off I usually set...

Swap Size = Physical Memory

Later on if you add more memory to the machine or load more applications onto it you may extend swap as needed based on best practices or the metrics provided by the system monitor that is installed on the box.
# 4  
Thanks for the reply guys.....Smilie

Below is how my system is partitioned.

# df -v
Mount Dir Filesystem blocks used avail %used
/ /dev/root 6291456 2804708 3486748 45%
/stand /dev/stand 122880 10688 112192 9%
/proc /proc 0 0 0 0%
/dev/fd /dev/fd 0 0 0 0%
/dev/_tcp /dev/_tcp 0 0 0 0%
/home /dev/dsk/c0b0t0d0s4 3440640 498720 2941920 15%
/system/pr /processorfs 0 0 0 0%
/tmp /tmp 503808 168 503640 1%
/var/tmp /var/tmp 503808 168 503640 1%
/raid /dev/dsk/c0b0t1d0s1 1132646400 329204480 803441920 30%

The database is on /raid mount.

The server has got about 130 users connecting to it.

The performance is fine, no problems with that.
We are having problems with backups and not getting the throughput that we should. IBM Had come and tested and replaced hardware but still no fix.
We are using a Ultruim LTO 3 drive and we are getting 6.4MB/s data transfer rate.Smilie
# 5  
Sounds like the system is I/O bound. Raid 5 with four disks ~ 3 disks worth of storage.
But it is all on the same logical volume. And swap is on there as well. Maybe a sysadmin with current skills will see this thread, but I personally would concentrate very very hard on iostat data. Can you move swap off onto the scsi drive?

Have you looked at iostat data? ESpecially during high load (== high I/O) times, like during backup
# 6  
What throughput are you expecting? Besides hardware a lot depends on how your database is physically laid out under the /raid mount point. Is it striped over the 4 x 147GB scsi Raid 5 disks? Are all your connections fibre or copper? Is it SAN or dedicated? Where is the backup software loaded? Is it on the same storage as the database or is it on the internal disk? As you can see more information is needed before the root cause of the performance problem can be isolated.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #712
Difficulty: Medium
On a large scale, the ability to treat instructions as data is what makes assemblers, compilers, linkers, loaders, and other automated programming tools possible.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Need to remove leading space from awk statement space from calculation

I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation? Here is my query: cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}' 02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies

2. Red Hat

Swap space not getting used

CENT OS 5.8 server running with a huge java application which uses up all my ram (4GB) and requires excess of atleast 2GB.But the swap is not getting used up((8GB) of swap space left unused) leading a wierd error and stopping application to stop working. Any one here dealt with the same kind of... (2 Replies)
Discussion started by: shiek.kaleem
2 Replies

3. Solaris

Swap space

Dear All, I have a swap space of 16G available in Sol 10. I have allocated it as a seperate file system. But when the RAM Is full used , the system gets rebooted and the swap is not being used,. Any reasons for this. Rgds Rj (5 Replies)
Discussion started by: jegaraman
5 Replies

4. Linux

How to reclaim the space which i used to increse the swap space on Xen,

Hi, i have done a blunder here, i increased the swap space on Xen5.6 server machine using below steps :- 1056 dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 1057 ls -l /root/myswapfile 1058 chmod 600 /root/myswapfile 1059 mkswap /root/myswapfile 1060 swapon /root/myswapfile ... (1 Reply)
Discussion started by: apm
1 Replies

5. Solaris

Swap Space

Could someone please explain how you know how much swap space you have on your system. See below: # swap -s total: 8225048k bytes allocated + 4863488k reserved = 13088536k used, 4008032k available # swap -l swapfile dev swaplo blocks free /dev/dsk/c3t0d0s1 32,25 16... (2 Replies)
Discussion started by: jamba1
2 Replies

6. Linux

swap space

Hi, I want to know how can i free the swap space if it is completely full, 0 mb remaining, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

7. UNIX for Dummies Questions & Answers

Swap space used???

Plz I need to know how much swap mem free and used i have. I'm using Compaq Tru64 UNIX V5.1A (rev 1885) Thanx (1 Reply)
Discussion started by: Lestat
1 Replies

8. AIX

swap space / paging space

how do you get the paging space reduced without rebooting the machine ? the os is aix (2 Replies)
Discussion started by: aaronh
2 Replies

9. UNIX for Dummies Questions & Answers

pageing space vs swap space

Hello, I would like to know if there is any difference between the pageing space and the swap space. Thank you in advance. (1 Reply)
Discussion started by: VeroL
1 Replies

10. UNIX for Dummies Questions & Answers


All, I am using SOLARIS 7. I have formated my hard drive to consist of only 150MB of swap space. This isn't enough considering I am running Oracle. How do I create additional swap space? Please list sources or commands. PS mkswap doesn't work on my machine. ( I have swap and... (5 Replies)
Discussion started by: SmartJuniorUnix
5 Replies

Featured Tech Videos