Some customers may benefit by moving files that NMIS reads/writes to very often to a RAM Disk. We have seen this improve performance on pollers that have shared storage and 2,000+ nodes provisioned. The concept is that NMIS will be able to read/write to RAM faster than the shared storage. Most of the files that NMIS touches very often are found in the nmis8/var directory.
Step #1 - Determine Space Required
There are two questions that quickly come to mind:
- How big should the RAM disk be?
- How much RAM is available?
Check how much space nmis8/var is currently using; minus the nmis8/var/events directory. We will keep the nmis8/var/events directory on a hard drive because it contains stateful event history; we don't want to loose these if the server is rebooted.
In this example we notice that the nmis8/var directory minus the nmis8/var/events directory is approximately 900MB. It appears that a RAM disk of 1GB would be sufficient.
How much RAM is available?
In the example above there appears to be 11GB of RAM available.
Step #2 - Create the RAM disk
The RAM disk mount point will need to be created. In this example we are using /media/ramdisk; be sure to mind the permissions.
The following commands will create the RAM disk, keep events on the hard drive, and ensure permissions are not lost. These commands should also need to be added to a script that runs at boot time. On Centos 6 /etc/rc.d/rc.local works well.
Use the df command to confirm that the ramdisk was created.
Step #3 - Disable NMIS
We need to disable NMIS so that it will not attempt to modify the files as we point nmis8/var to the new RAM disk. This is easily accomplished by placing a file called 'NMIS_IS_LOCKED' in the nmis8/conf directly as in the following example.
Once the lock file is in place check the server for any nmis.pl processes.
When none are found continue
Step #4 - Point nmis8/var at the RAM Disk
Since we are planning to put a sym link in /usr/local/nmis8/ for /var pointing at the new RAM disk; verify that in /usr/local/nmis8/conf/Config.nmis nmis8/var points to /usr/local/nmis8/var. Here's a sample of the directories configuration in that file.
Create the sym link in /usr/local/nmis8/ sending /var to the RAM disk.
Step #5 - Re-enable NMIS
Remove the previously created NMIS lock file.
Step #6 - Verify
move to the /usr/local/nmis8/var directory and execute a 'df -h .' command. This command should reveal that we are indeed on the ramdisk.
- Take a look in the /usr/local/nmis8/var directory and confirm that node.json and view.json files have been created.
- Verify that the NMIS GUI is functioning normally.
- Review the nmis8/logs/nmis.log file
- Check the root user mailbox