Amazon EFS with Posit Team

Set up Amazon Elastic File System (EFS) with Posit Team, and follow best practices for ongoing use.

Before continuing, review the Storage documentation as it likely supersedes the content on this page.

This page explains how to set up Amazon Elastic File System (EFS) with Posit Team and details best practices for ongoing usage of EFS. Additionally, this document covers how we came up with these recommendations.

Important

Amazon EFS has unique design characteristics that can make it challenging to use with Posit Team. To be successful with EFS, read this entire page and adhere to its guidance.

Amazon EFS is a managed shared file system that scales elastically with the amount of storage you use. Since it supports Network File System (NFS), it is possible to use EFS as the shared file system with Posit products. However, in some situations relevant to Posit Professional Products, EFS can suffer from slower performance relative to Elastic Block Store (EBS).

This slower performance is particularly prevalent in workloads that are sensitive to latency (as opposed to throughput). Specifically, EFS is not performant when reading and writing thousands of small files. When managing R workloads on a server, this can be problematic because some R packages that contain C++ code can contain a great many C++ header files. For example, the BH package on CRAN contains ~12K header files, so installation of BH can be slow on EFS.

On some rare occasions, this can also affect direct data science work in cases where the workflow requires reading many files. For example, performance might be poor when training a deep neural network that processes image files in bulk.

Important

Product-specific limitations and recommendations

This section is relevant to Posit Workbench, Posit Connect, and Posit Package Manager usage. We only have a few product-specific limitations and recommendations.

  • The default lock type of link-based does not work. Use the advisory type instead.

  • Use RStudio Workbench 1.4 or later, including all versions of Workbench.

    We highly recommend upgrading to version 2021-09.0 because this release includes several performance improvements for EFS.

  • If you choose to configure Database.Dir, this also must point to the same shared location.

Special considerations

  • Operations that write many small files (thousands or more) do not perform well in most EFS settings.
  • To prevent users from having to repeatedly install R packages, Posit recommends preinstalling the R packages.
  • Consider adopting code patterns that prefer reading large files over splitting data between many small files.
  • When using an EFS file system for many users, we recommend segmenting data files into user-specific directories as much as is possible. Writing large files blocks metadata operations in that directory until the write completes. Separate user directories limit the impact on other users.

Since EFS performance is largely based on individual usage patterns, this document serves as a starting point rather than an absolute directive. Tune your EFS configuration after you monitor user behavior. You might need to adjust the configuration over time to keep performance high.

Testing and benchmarking your configuration with fsbench

If you want to collect data about file system performance on your own EFS installation, use the Posit benchmarking tool. The benchmarking tool runs a suite of file operations to help characterize system behavior and compare it against other known configurations.

For information on how to configure and run benchmark testing, please refer to the fsbench package documentation.

Back to top