Writing to network mounts is slightly slower than to local mounts, most noticeably during high-volume sequential
file creation — in that case, a local mount is more effective. Applications polling network mounts for a new file
may not immediately detect it even though it exists.Detection can be delayed by approximately 30 seconds, so polling logic should account for this delay and not treat
a missing file as an error until that window has passed.
Supported versions
You can select the major and minor version. Patch versions are applied periodically for bug fixes and other maintenance updates. By default, you get the latest available patches each time you deploy. If your project has a maintenance window configured, Upsun Cloud applies patches only during that window. Upsun Cloud may still apply urgent or critical fixes outside of the maintenance window.- 1.0
Deprecated versions
The following versions are still available in your projects, but they’re at their end of life and are no longer receiving security updates from upstream.- 2.0
Retired versions
The following versions have been retired and are no longer available. If your project uses a retired version, you must update to a supported version. No retired versions.Usage example
1. Configure the service
To define the service, use thenetwork-storage type:
SERVICE_NAME must be RFC 1123 compliant, since it’s used as the network storage’s hostname:
- At most 63 characters
- Lowercase alphanumeric characters or
-only (no underscores) - Starts and ends with an alphanumeric character
shared-uploads.
2. Add the mount
To define the mount accessible by your application, use the following configuration:<TARGET_PATH>is the path to your mount within the app container (relative to the app’s root).SERVICE_NAMEis the name you defined in step 1.<SOURCE_PATH>specifies where the mount points inside the service.
If thesource_pathis an empty string (""), your mount points to the entire service.
If you don’t define asource_path, Upsun Cloud uses theMOUNT_PATHas default value, without leading or trailing slashes. For example, if your mount lives in the/my/files/directory within your app container, it will point to amy/filesdirectory within the service.
Example configuration
Multi-application usage
If your project contains multiple apps, they may sharestorage mounts.
Alternatively, they may use shared service mounts.
If the source_path is the same for both apps,
the files are shared between the two applications even if the mount location is different.
It’s also possible to have one app mount a source_path that’s a subdirectory of another application’s mount.
For example:
.upsun/config.yaml
app1 has access to the entire uploads directory by writing to web/uploads.
app2 has two mounts that it can write to: process and done.
The process mount refers to the same directory as the web/uploads/incoming directory does on app1,
and the done mount refers to the same directory as the web/uploads/done directory on app1.
How do I give my workers access to my main application’s files?
If you need to use a worker with access to the same file mount as your web-serving app, define all the necessary mounts asservice mounts.
The following example assumes a Network Storage service named files has been defined in .upsun/config.yaml.
Drupal files directories are shared between the web and worker instances,
while the Drush backup directory is unique to the web instance.
How can I migrate data from a storage mount to a service mount?
Network Storage service mounts can be shared between different apps,
while storage mounts can only be shared between different instances of the same app.
To move data from a storage mount to a service one, follow these instructions.
Assuming you have the following storage mount:
.upsun/config.yaml
- Add a new
network-storageservice to your configuration, naming itshared-uploads:
Make sure you allocate enough disk space to your
shared-uploads service
for your existing files with some buffer.- Add a new
servicemount, namednew-uploads:
source_path.
- Deploy your changes.
-
Copy all your files from the
storage(web/uploads) mount to theservice(new-uploads) mount usingrsync: -
Reverse the mounts.
To do so, rename the
storagemount toold-uploads, and point theweb/uploadsdirectory to theservicemount:
-
Push your changes and check that the files are now accessible from the
servicemount (now namedweb/uploads). To check that no files were lost during the transfer, run the following command: -
Delete the contents of the
old-uploadsstoragemount before removing it. - Push your changes again.