Speed up steps using a RAM disk

Tasks which are heavily dependent on disk IO can be sped up by performing those operations in memory, and avoiding the disk. This is especially true if you're using the Docker executor on CircleCI, and we have an in depth blog post here about the issue.

Docker Executor

On the docker executor we have enabled an available RAM disk by default which you can use to dramatically increase step speeds. This is highly encouraged for steps like cache/workspace restores. You can read about configuring it in our docs here.

The short version is that you have access to a special directory,  /mnt/ramdisk, which acts as any other directory. Files stored here will use the machines assigned resource class memory. For instance, you can set your entire working directory to be stored in memory with working_directory: /mnt/ramdisk in your job configuration.

Other executors

The RAM disk is not configured by default on other executors. It's less likely that you'll need it because they operate as isolated VMs, and avoid the issues outlined in the blog post mentioned above. You may still find that a RAM disk offer performance benefits over utilizing the hard disk. In other executors (Machine,  MacOS, etc) you have far more control over the environment, so it's possible to configure a RAM disk yourself. Using instructions such as this stack exchange answer for Linux based systems

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.