Fast create

When the fast create feature is enabled on AFM or AFM-DR filesets, this feature reduces the number of operations that are generated at the time of file creation at the cache. AFM needs to replicate each file creation operation to the home as a separate operation.

Every time when a file is created, operations such as create, truncate, write, chmod, chown, or set ACL/EA are generated at the file system level. Each operation is replicated to the target site as a separate operation. The applications that generate such workload are tar, git, or make, which increases stress on the gateway node to queue all file creation operations as a separate operation for each file creation. Each operation that is performed from an application node for a file creation triggers a separate RPC send or acknowledge to or from the gateway node.

On the clusters where the fast create feature is enabled, AFM does not send all operations. However, AFM combines all operations of a file creation and sends these combined operations to the target. The target performs all operations that are required so that both sites are in sync. This feature helps you to avoid queuing all operations and send only one operation for every file creation. Thus, the fast create feature improves the performance by saving many RPC exchanges between the application node and the gateway node and also saves memory and network bandwidth.

For the performance improvement, the afmAsyncDelay parameter must be tuned when the afmFastCreate parameter is set on an AFM or AFM-DR fileset. The tuning of the afmAsyncDelay parameter depends on the application and network workload. If you set the afmAsynDelay parameter value too high, more memory is consumed on the gateway node. To change the value of the afmAsyncDelay parameter, issue the following command:
# mmchfileset fs -j fileset -p afmAsyncDelay=Value

This feature can be enabled or disabled on any individual AFM or AFM-DR fileset. To enable this feature, all the nodes in the cluster must be upgraded to the latest release level and the latest file system format level. Before you enable this feature on a fileset, you must stop the fileset and then set this parameter. After you enable this feature, you need to start the fileset to continue the replication. For more information about stop and start the fileset, see Stop and start replication on a fileset.

Do the following steps to enable this feature on an AFM or AFM-DR fileset:
  1. Update the cluster release level to the latest level and the file system version to the latest version. For more information about the cluster release level, see Completing the upgrade to a new level of IBM Spectrum Scale, and for more information about file system version, see File system format changes between versions of IBM Spectrum Scale.
  2. Ensure that the fileset state is active and operations not are in the queue. To check the fileset state, issue following command:
    # mmafmctl fs getstate -j fileset
  3. To stop the fileset, issue the following command :
    # mmafmctl fs stop -j fileset
    Note: If you set the afmFastCreate parameter without stopping or unlinking a fileset,
    # mmchfileset fs fileset -p afmfastCreate=yes
    the following error is displayed:
    mmchfileset: [E] Fileset cannot be changed, either fileset is linked or not stopped.
    mmchfileset: Command failed. Examine previous error messages to determine cause.
  4. To enable or disable the fast create at the fileset level, issue the following command:
    # mmchfileset fS -j fileset -p  afmFastCreate=yes|no
  5. Start the fileset by issuing the following command:
    # mmafmctl fs start -j fileset
  6. Ensure that the fast create is enabled successfully by issuing the following command:
    # mmlsfileset fS fileset -L --afm
    For example,
    Filesets in file system '<FS>':
    
    Attributes for fileset <Fileset>:
    ============================
    Status                                  Linked
    Path                                    <Fileset_Linked_Path>
    Id                                      236
    Root inode                              30932995
    Parent Id                               0
    Created                                 Tue Mar 1 07:35:21 2020
    Comment
    Inode space                             59
    Maximum number of inodes                100096
    Allocated inodes                        100096
    Permission change flag                  chmodAndSetacl
    afm-associated                          Yes
    Target                                  nfs://<home>/<Fileset_Linked_Path>
    Mode                                    single-writer
    File Lookup Refresh Interval            30 (default)
    File Open Refresh Interval              60 (default)
    Dir Lookup Refresh Interval             60 (default)
    Dir Open Refresh Interval               60 (default)
    Async Delay                             15 (default)
    Last pSnapId                            0
    Display Home Snapshots                  no
    Number of Gateway Flush Threads         4
    Prefetch Threshold                      0 (default)
    Eviction Enabled                        yes (default)
    IO Flags                                263168 (fastCreate)
    
Note: RPO or peer snapshot feature is not supported when the afmFastCreate parameter is set on an AFM or AFM-DR fileset.
# mmpsnap fs create -j fileset
The following error is displayed:
mmpsnap: [E] Peer snapshot creation failed. Error code 22.
mmpsnap: Command failed. Examine previous error messages to determine cause.