Help Center/ Server Migration Service/ User Guide(ME-Abu Dhabi Region)/ FAQs/ OS Compatibility and Migration Restrictions/ How Do I Set Resource Limits for SMS-Agent During a Linux Server Migration?
Updated on 2023-06-28 GMT+08:00

How Do I Set Resource Limits for SMS-Agent During a Linux Server Migration?

You can set limits for CPU usage, memory usage, and disk throughput for SMS-Agent on the source server.

Prerequisites

Cgroups has been installed and enabled on the source server.

To check if it has been installed, run the following command on the source server:

mount | grep cgroup

If the following cgroups V1 or V2 mounting information is displayed, cgroups is enabled on the source server. Otherwise, it is not.

Before setting resource limits on the SMS console, evaluate whether installing or enabling cgroups will affect services on the source server. If source services are related to cgroups, submit a service ticket to contact SMS migration experts in advance to check whether the SMS resource limits conflict with the source services.

  • cgroups V1

    The example output shows that the following three mount points were attached to the CPU, memory, and disk I/O controllers, respectively.

    • /sys/fs/cgroup/CPU,CPUacct
    • /sys/fs/cgroup/memory
    • /sys/fs/cgroup/blkio
  • cgroup V2

    cgroup V2 is mounted on /sys/fs/cgroup. Unlike cgroup V1, cgroup V2 has no mount points attached to specific resources.

Procedure

  1. Log in to the SMS console.
  2. In the navigation pane on the left, choose Servers.
  3. In the server list, locate the server to be migrated, and click Configure in the Target column.
  4. Set resource limits based on the following table.

    Table 1 Parameters

    Parameter

    Description

    Precaution

    CPU Limit

    Controls the maximum of CPU resources to be used by the SMS-Agent on the source server.

    • If this parameter is left blank, the CPU usage of SMS-Agent is not limited.
    • 1% ≤ CPU limit (integer) ≤ 100%
    • To ensure a smooth migration, allocate at least 0.2 CPUs to SMS-Agent.

    Formula: CPU limit (%) = Maximum number of CPUs allowed for SMS-Agent/Total number of CPUs x 100%

    For example:

    If the source server has 4 CPUs, and you want to allocate 0.5 CPUs for SMS-Agent, you can enter 13% (0.5/4x100%).

    • The CPU limit and disk throughput limit may affect the migration speed.
    • When the resource limits are applied, a folder named sms_mig_cgroup will be created in /sys/fs/cgroup on the source server, and parameters for configured limits are created here.

    Memory Limit

    Controls the maximum of memory to be used by SMS-Agent. If the configured limit is reached, SMS-Agent will be stopped or ended.

    • If this parameter is left blank, the memory usage of SMS-Agent is not limited.
    • 200 MB ≤ Memory Limit ≤ 1,000 MB
    • To ensure a successful migration, allocate at least 200 MB of memory to SMS-Agent.

    Disk Throughput Limit

    Controls the maximum disk throughput to be used by SMS-Agent. After the limit is set, the disk read/write speed during the migration will not exceed the limit.

    • If this parameter is left blank, the disk throughput of SMS-Agent is not limited.
    • 10 MB/s ≤ Disk Throughput Limit ≤1000 MB/s
    • To ensure a successful migration, allocate at least 10 MB/s of disk throughput to SMS-Agent.

Modifying Resource Limits

You can modify resource limits for tasks in which the target servers have been configured but the migration is not started, those have been paused, and those in which the full migration is complete and incremental synchronizations are to be performed. After locating such a task, choose More > Set Migration Limits in the Operation column to reset the resource limits.

Viewing Resource Usage

You can run the top and iotop commands on the source server to view the resource usage during the migration. It is normal for the resource usage of SMS-Agent to slightly exceed the configured limits.