Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i've made a ramdisk this way:

mkdir -p /media/ramdisk
mount -t tmpfs -o size=512M tmpfs /media/ramdisk/

The reason for this is because i run a lot of node.js scripts and their execution time is very small, but i suspect that the time overhead is because it reloads the node.js executable from disk and destroys it on each subsecuent run. So i think this might be the solution to gain a bit, if not much, performance. How can i move a program like node to the ramdisk and run it from there? The idea is to have a startup script that creates the ramdisk and puts the node files inside of it. Note that i'm currently using fedora 16 for what's it's worth. Thanks in advance.

share|improve this question
    
The file contents are probably already cached in RAM if they're accessed frequently, as ErikA explained. But node.js probably still has to parse the JavaScript code each time. That's a matter of CPU time, not disk access. –  Wyzard Jun 19 '12 at 0:46
add comment

1 Answer

If the scripts are being read frequently, they will reside in the kernel's read cache, and thus are already being read from memory.

share|improve this answer
    
The scripts are not written into disk, they exist as the input to node.js –  alfa64 Jun 19 '12 at 2:13
    
Regardless, if they are accessed by anything on the system, they will be in the kernel's read cache. –  EEAA Jun 19 '12 at 2:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.