Hi Folks,
I know generally the performance of SWAP Partitions are better than SWAP Files, specially if they resides on the beginning of the disk.
But inside an VMWare VPS, does this matter? Since that VMWare Virtual Disk simply is a file??
Generally I avoid using SWAP Space inside VM, but sometimes they are very useful; Like building software from Ports (I have difficulties with some packages without SWAP Space; Memory consuming GCC soon stops with some errors.).
http://ivoras.sharanet.org/freebsd/vmware.html
I've done a little benchmark using UnixBench with and without SWAP File. But since it's time consuming and cost demanding for me to reformat the tested VPS (It's a production server), restart from scratch and create a SWAP Partition, Does it worth? Does performance gain is that great?
Note that from the day one I formatted the whole 20 GB disk as one partition. On that moment I was thought if I need SWAP Space, simply I can use SWAP files. But I was never aware of such a huge difference [or at least before sending it to public never running some tests].
Here is the Spec & Result:
Best regards,
M.S. Babaei
I know generally the performance of SWAP Partitions are better than SWAP Files, specially if they resides on the beginning of the disk.
But inside an VMWare VPS, does this matter? Since that VMWare Virtual Disk simply is a file??
Generally I avoid using SWAP Space inside VM, but sometimes they are very useful; Like building software from Ports (I have difficulties with some packages without SWAP Space; Memory consuming GCC soon stops with some errors.).
http://ivoras.sharanet.org/freebsd/vmware.html
Code:
4. Disable internal VMWare swapping
Consider disabling VMWare internal memory swapping and make the virtual machine fit in in
the physical memory of the host for best performance. Of course, be informed on the impact
of VMWare's memory management before you commit on doing this.
I've done a little benchmark using UnixBench with and without SWAP File. But since it's time consuming and cost demanding for me to reformat the tested VPS (It's a production server), restart from scratch and create a SWAP Partition, Does it worth? Does performance gain is that great?
Note that from the day one I formatted the whole 20 GB disk as one partition. On that moment I was thought if I need SWAP Space, simply I can use SWAP files. But I was never aware of such a huge difference [or at least before sending it to public never running some tests].
Here is the Spec & Result:
Code:
FreeBSD 8.0 (VMWare ESXi 4.0 VPS)
384 MB Ram
Single CPU
20 GB H.D.D
Open-VM-Tools-noX11
kern.hz=50 in /boot/loader.conf
Code:
SWAPPING Disabled
==============================================================
BYTE UNIX Benchmarks (Version 4.1-wht.2)
System -- FreeBSD 3rr0r.babaei.net 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5
16:02:27 UTC 2010 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
/dev/da0s1a 20301670 2741446 15936092 15% /
Start Benchmark Run: Fri Jan 22 15:53:50 CET 2010
3:53PM up 11:45, 1 user, load averages: 0.00, 0.00, 0.00
End Benchmark Run: Fri Jan 22 16:05:24 CET 2010
4:05PM up 11:57, 1 user, load averages: 13.72, 5.85, 2.82
INDEX VALUES
TEST BASELINE RESULT INDEX
Dhrystone 2 using register variables 376783.7 6726822.6 178.5
Double-Precision Whetstone 83.1 1677.0 201.8
Execl Throughput 188.3 727.7 38.6
File Copy 1024 bufsize 2000 maxblocks 2672.0 33798.0 126.5
File Copy 256 bufsize 500 maxblocks 1077.0 22053.0 204.8
File Read 4096 bufsize 8000 maxblocks 15382.0 583159.0 379.1
Pipe Throughput 111814.6 1003147.0 89.7
Pipe-based Context Switching 15448.6 118393.1 76.6
Process Creation 569.3 1465.9 25.7
Shell Scripts (8 concurrent) 44.8 231.7 51.7
System Call Overhead 114433.5 648172.5 56.6
=========
FINAL SCORE 96.9
Code:
768 MB SWAP File
==============================================================
BYTE UNIX Benchmarks (Version 4.1-wht.2)
System -- FreeBSD 3rr0r.babaei.net 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5
16:02:27 UTC 2010 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
/dev/da0s1a 20301670 5297424 13380114 28% /
Start Benchmark Run: Thu Mar 25 01:30:35 CET 2010
1:30AM up 15 days, 3:15, 1 user, load averages: 0.00, 0.00, 0.00
End Benchmark Run: Thu Mar 25 02:01:24 CET 2010
2:01AM up 15 days, 3:45, 1 user, load averages: 10.49, 4.42, 2.07
INDEX VALUES
TEST BASELINE RESULT INDEX
Dhrystone 2 using register variables 376783.7 1993566.9 52.9
Double-Precision Whetstone 83.1 491.7 59.2
Execl Throughput 188.3 202.7 10.8
File Copy 1024 bufsize 2000 maxblocks 2672.0 16178.0 60.5
File Copy 256 bufsize 500 maxblocks 1077.0 16081.0 149.3
File Read 4096 bufsize 8000 maxblocks 15382.0 484252.0 314.8
Pipe Throughput 111814.6 274621.3 24.6
Pipe-based Context Switching 15448.6 32557.6 21.1
Process Creation 569.3 379.6 6.7
Shell Scripts (8 concurrent) 44.8 45.8 10.2
System Call Overhead 114433.5 175847.7 15.4
=========
FINAL SCORE 33.1
Best regards,
M.S. Babaei