Theme
Soft and hard quotas on a virtual file system
Every Disk, S3, Azure and GCP virtual file system (VFS) in Syncplify Server! can carry a soft quota and a hard quota. Both are set in the VFS editor, accept SI units (for example 100 MB or 2 GB), and a value of 0, or an empty field, means unlimited. You may set one, the other, or both.
INFO
Syncplify Server! v4 and v5 expressed quotas in KB. From v6 they are expressed in bytes, and the v8 editor lets you type them with a unit.
What each quota does
The two limits play different roles, and the exact behavior is this:
- When a client starts an upload, the server compares the space used on the VFS (including the uploads still in progress) with the limits. If the usage has reached the soft quota, or the hard quota, the upload is refused.
- While an upload is in progress, the server counts the bytes as they arrive. The moment the upload would push the usage past the hard quota, the transfer is aborted with an error, the client sees a failed upload, and the
OnQuotaExceededevent fires for your scripts. When only a soft quota is set, the soft quota plays this role too.
In practice: the soft quota is the level past which no new upload starts, but an upload that started below it is allowed to finish, as long as it stays below the hard quota. The hard quota is the level no upload is ever allowed to cross. A typical configuration sets the soft quota a little below the hard quota, so that a large file started just under the soft limit still has room to complete.
How usage is measured
Calculating the size of a folder tree with millions of files is expensive, so the server does not re-evaluate it at every operation. Instead, the used space of every VFS with a quota is refreshed on two schedules, set for the whole virtual site on the Quotas page of the Admin UI, under Storage:
- Approximate refresh (minutes): a lightweight update of the usage figure, which can run often.
- Full refresh (minutes): an exact measurement of the whole tree, which is heavy and should not run too often.
Between refreshes, the bytes of the uploads in progress are added to the last measured figure, so a burst of uploads cannot slip past the limits unnoticed. When a full refresh finds a VFS past its soft or hard quota, a notification appears in the Admin UI, once, until the usage drops back within the limits. Older versions had a per VFS Quota TTL field instead of these two settings.
The manual describes the settings in Quotas.