Help Center/ Server Migration Service/ FAQs/ OS Compatibility and Migration Restrictions/ How Do I Set Resource Limits for SMS-Agent During a Linux Server Migration?
Updated on 2024-08-31 GMT+08:00

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

You can limit how many CPU, memory, and disk throughput resources of the source server can be used by the SMS-Agent.

Precautions

Limiting resources for SMS-Agent requires the built-in cgroups feature on Linux. If cgroups on the source server is broken or abnormal, the resource limits may not be applied. If you need help, contact SMS technical support.

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 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 use cgroups, submit a service ticket to ask SMS migration experts 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
  • Cgroups V2

    Cgroups V2 is mounted on /sys/fs/cgroup. Unlike V1, cgroups 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 source server to be migrated and click Configure Target in the Migration Stage/Status column.
  4. Expand Resource Limits (Optional), read parameter description and precautions carefully, and set CPU Limit, Memory Limit, and Disk Throughput Limit.

    Table 1 Parameters for setting resource limits

    Parameter

    Description

    Precaution

    CPU Limit

    Controls the maximum percentage of CPUs 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 of SMS-Agent 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, set a limit to at least 10 MB/s.

Modifying Resource Limits

You can modify resource limits if a task has a target server configured but is not started, is paused, or is waiting to execute an incremental synchronization. After locating the task, in the Operation column, choose More > Manage Migration Settings > Set Migration Limits. Then you can modify the resource limits.

Viewing Resource Usage

You can run the top or iotop command 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.