How to use RAM to increase the performance of GNS3
Increasing GNS3’s performance is on anyones wish list that uses it. This pro tip is quick to setup and very effective. We will use our systems RAM to store a few dynamips files for faster and quicker access.
To do this we will use a RAMDisk. A RAMDisk is space in your systems RAM that has been allocated as a hard disk by the OS, that is, a virtual hard disk. Reading and writing files on the RAMDisk is many times faster than your SATA drive.
One thing to keep in mind, the RAMDisk is a non-persistent drive. So any files stored on the drive are not retained. This limits us to what files can be stored on the RAMDisk. In GNS3, we will move dynamips working directory to the RAMDisk. Since the files are only used while we are actively running our labs, we can safely store them on the RAMDisk. It does not matter if we lose them on a system reboot because they are recreated each time we startup our lab.
Creating a RAMDisk
Creating a RAMDisk is a different process for each OS.
Linux
Linux - or at least Ubuntu - is the easiest to configure. The RAMDisk is created by default by the OS. When you first install the OS it allocates /run/shm as a RAMDisk for programs to use for storing files.
To determine if your system has it run “df -h” on the CLI.
Ubuntu@Desktop:/opt/gns3$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 20G 8.5G 11G 46% / udev 5.9G 4.0K 5.9G 1% /dev tmpfs 2.4G 1.1M 2.4G 1% /run none 5.0M 0 5.0M 0% /run/lock none 5.9G 7.8M 5.9G 1% /run/shm /dev/sda3 1.8T 260G 1.5T 15% /home
Notice the 5.9G allocated to /run/shm, that is our RAMDisk. It is possible to adjust the default size of the RAMDisk. For more infomoration see here.
Windows
Windows, while not as easy at *nix, isn’t really that difficult. To create a RAMDisk you will need to download and install a program called, oddly enough, RAMDisk.
The software is free with the caveat that it is used for personal use and the disks cannot be larger than 4GB in size. If you need something bigger than 4GB then you will need purchase a license.
Once the software is installed, launch it and adjust the size of the disk under the settings tab. After that just start the RAMDisk.

GNS3 Setup
The last step is to configure the dynamips preferences within GNS3.
Launch GNS3 and go to “edit” then “preferences”. From there click on “dynamips” and find the “Working directory for Dynamips:” textbox.

In this textbox put the full path to your newly created RAMDisk and hit “Apply” then “OK”. You can see from the screenshot above that I am using /run/shm which is my RAMDisk on my Ubuntu machine.
That’s is, now fire up a lab and watch your routers fly! You can verify that everything is working by viewing the RAMDisk and checking that dynamips has created the temp files.
[Update]: You may have to reboot GNS3 once you configure the dynamips working directory setting.
Hope that helps. Leave any tips that you might have in the comments.
Happy Lab’ing,
CJ

