There are ways to upload files into memory rather than /tmp, but I strongly advise against that, and will never even enable an option for ActionHero to do so. Here are a few of the reasons:
- You expose yourself to the easiest denial of service attack possible. I'll just keep POSTING 1 large file ~1GB to you until you run out of RAM and crash
- You can't truncate/terminate the upload mid-stream if you can detect that you are running out of RAM
- Parsing the file is only a sync option now (you can't load the file in like you would fs.readFile), as it is already present in RAM, and doing anything with that data will be blocking
That said, if you are worried about *speed*, there are a few OS-level hacks you can do:
- The location where you save the tmp uploads is configurable. You can mount a faster, but small hard drive to /mnt/fatDrive/tmp and put the files there
- You could also mount a RAMDISK and use that as the tmp uplaod location. What's nice about a ram disk is that you'll allocate a fixed space for it, not an ever-growing heap which would be the case if you uploaded files into node's RAM directly.
All of this said, reading a file from local disk is really fast. Are you sure that you'll have trouble reading at the throughput you need? Assuming your uploaders are sending files from outside of your datacenter, the time to upload will be an order of magnitude slower than local disk access, even at high volumes. Any extra time added from reading a disk will be negligible.