Understanding files

In Acquia Cloud, uploaded files are separate from the Drupal database and your code repository. Acquia Cloud deployment code creates a symbolic link to your application's /files directory. If you use Drupal's multisite feature, Acquia Cloud creates a separate /files directory for each settings.php file in the /sites directory.

On Acquia Cloud, you manage your Drupal codebase (including Drupal core, contributed modules, and custom code) using the Git version control system. Git can manage text files full of code, but is not suitable for large collections of user-uploaded objects. Acquia Cloud stores your application's /files directories outside of your repository and manages them for you. This simplifies your workflow and makes your repository smaller and more manageable. To access your application's /files directories, use the sftp, scp, rsync, or ssh commands. For more information, see About disk storage in Acquia Cloud.

An Acquia Cloud Enterprise application runs on several redundant web nodes (servers) simultaneously. If the application used local file storage on the web notes, files uploaded to one web node would not be available on another. Acquia Cloud Enterprise uses shared file systems to ensure that data your code writes to a /files directory is accessible on all web nodes running your application's code.

When you import or create your Drupal codebase, Acquia Cloud creates symbolic links to your public file directory. Every Drupal multisite website in your account has its own /files directory.

  • [docroot]/files links to /mnt/files/[site].[env]/files
  • [docroot]/sites/default/files links to /mnt/files/[site].[env]/sites/default/files
  • [docroot]/sites/example.com/files links to /mnt/files/[site].[env]/sites/example.com/files

To ensure its privacy, the /files-private directory is not symbolically linked to your application's [docroot]. For private file handling, you can either use the absolute path to [docroot] or a relative path under ../acquia-files. For more information, see Setting the private file directory on Acquia Cloud.

Handling large files

Using very large files can cause problems on your application. For example, large images can increase page load times, causing a perceived performance issue for your visitors. Additional problems can include having files that are too large for your application's Varnish cache, and that uploading large files through Drupal can fail due to timeouts at various levels of the stack.

If, however, you need to use very large files, consider these resources and factors:

  • If you find that uploads of large files to Acquia Cloud Enterprise are timing out or otherwise failing, see Correcting broken uploads on Acquia Cloud Enterprise.
  • If you need to upload files greater than 280 MB in size, contact Acquia Support to discuss having your application configured to allow larger uploads. This option is available only if you are entitled to file Acquia Support tickets.
  • Read Handling large files for best practices about image processing, file organization, and storage.

Downloading large files

Drupal application on Acquia Cloud support downloads of files of any size. However, large downloads require a correct Content-Length header in the HTTP response in order to succeed. For any static file, the Apache web server in the Acquia Cloud stack will provide the correct header. If the download is large (1 GB or greater) and is dynamically generated (for example, generated by a PHP script), the download is likely to fail unless a Content-Length header is explicitly provided.

Large numbers of files

If you maintain a very large number of files in your application, it can have a substantial negative effect on performance and stability, especially if they are all contained in the same directory. We have found that over 2,500 files in any single directory in the files structure can seriously impact your server's performance and potentially its stability. If your application requires a large number of files, maintain them in multiple directories. For more information about files and performance, see Improving application performance, Proactively organizing files in subfolders, and Optimizing file paths: Organizing files in subfolders, which includes scripts for migrating files into subdirectories in your file system.

Storing more than a terabyte of files

Acquia Cloud uses Amazon Elastic Block Stores (EBS) for an application's files directory.

An EBS volume can be no larger than 1 terabyte. If you require more than 1 terabyte of file storage, you should use Amazon's S3 storage service. Amazon S3 is highly reliable and can scale to any size storage. For Drupal 7 applications, you can use the AmazonS3 module, which uses the Drupal file wrapper to send files directly to and from S3.

For more information, see Using external storage for files.

File execution restrictions

Files in your application's file storage are not executable by Acquia Cloud PHP processes.

Contact supportStill need assistance? Contact Acquia Support