Maximum amount of paths with device-mapper-multipath in RHEL 5, 6 ,7 and 8?
Environment
- Red Hat Enterprise Linux (RHEL) 5
- Red Hat Enterprise Linux (RHEL) 6
- Red Hat Enterprise Linux (RHEL) 7
- Red Hat Enterprise Linux (RHEL) 8
- device-mapper-multipath
Issue
- How many paths per map does device-mapper-multipath support?
- How many paths to a single LUN can device-mapper-multipath handle?
- What is the maximum number of paths that can be in a path group?
- What is the maximum number of path groups?
Resolution
- device-mapper-multipath and the kernel support up to 1024 paths per path group and up to 1024 path groups.
Root Cause
- As defined in drivers/md/dm-mpath.c within the kernel:
static struct priority_group *parse_priority_group(struct arg_set *as,
struct multipath *m)
{
static struct param _params[] = {
{1, 1024, "invalid number of paths"},
{0, 1024, "invalid number of selector args"}
};
- The _params struct is passed into read_param, and the 1024 there is the max for that particular parameter:
/*
* read the paths
*/
r = read_param(_params, shift(as), &pg->nr_pgpaths, &ti->error);
if (r)
goto bad;
r = read_param(_params + 1, shift(as), &nr_selector_args, &ti->error);
if (r)
goto bad;
- read_param is defined in the same file:
static int read_param(struct param *param, char *str, unsigned *v, char **error)
{
if (!str ||
(sscanf(str, "%u", v) != 1) ||
(*v < param->min) ||
(*v > param->max)) {
*error = param->error;
return -EINVAL;
}
return 0;
}
- As it is reading the list of paths that is passed in when 'dmsetup create' is called, if it finds less than the min number of args or more than the max, it prints that error. The same holds true for the number of priority groups:
static int multipath_ctr(struct dm_target *ti, unsigned int argc,
char **argv)
{
/* target parameters */
static struct param _params[] = {
{1, 1024, "invalid number of priority groups"},
{1, 1024, "invalid initial priority group number"},
};
- Therefore, theoretically you can have 1024*1024 paths in a single map if you have 1024 paths in 1024 different priority groups.
SBR
Product(s)
Components
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.