Skip to content

Commit 1260cdd

Browse files
committed
update default overcommit
This change updates the cpu and ram initial allocation ratios to 4.0 and 1.0 to reflect the typical values that are suitable for non web hosting workloads. Change-Id: I283eb270a4e47da15cf01d098b4f3952f7b5b570 implements: bp/nova-change-default-overcommit-values
1 parent ce15e7f commit 1260cdd

File tree

8 files changed

+49
-15
lines changed

8 files changed

+49
-15
lines changed

doc/source/admin/scheduling.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,16 @@ control the initial allocation ratio values for a compute node:
11001100
* :oslo.config:option:`initial_disk_allocation_ratio` the initial DISK_GB
11011101
inventory allocation ratio for a new compute node record, defaults to 1.0
11021102

1103+
Starting with the 27.0.0 Antelope release, the following default values are used
1104+
for the initial allocation ratio values for a compute node:
1105+
1106+
* :oslo.config:option:`initial_cpu_allocation_ratio` the initial VCPU
1107+
inventory allocation ratio for a new compute node record, defaults to 4.0
1108+
* :oslo.config:option:`initial_ram_allocation_ratio` the initial MEMORY_MB
1109+
inventory allocation ratio for a new compute node record, defaults to 1.0
1110+
* :oslo.config:option:`initial_disk_allocation_ratio` the initial DISK_GB
1111+
inventory allocation ratio for a new compute node record, defaults to 1.0
1112+
11031113
Scheduling considerations
11041114
~~~~~~~~~~~~~~~~~~~~~~~~~
11051115

nova/conf/compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
* ``initial_disk_allocation_ratio``
530530
"""),
531531
cfg.FloatOpt('initial_cpu_allocation_ratio',
532-
default=16.0,
532+
default=4.0,
533533
min=0.0,
534534
help="""
535535
Initial virtual CPU to physical CPU allocation ratio.
@@ -545,7 +545,7 @@
545545
* ``cpu_allocation_ratio``
546546
"""),
547547
cfg.FloatOpt('initial_ram_allocation_ratio',
548-
default=1.5,
548+
default=1.0,
549549
min=0.0,
550550
help="""
551551
Initial virtual RAM to physical RAM allocation ratio.

nova/tests/functional/test_server_group.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ class ServerGroupFakeDriver(fake.SmallFakeDriver):
103103
"""
104104

105105
vcpus = 1000
106-
memory_mb = 8192
106+
# the testcases were built with a default ram allocation ratio
107+
# of 1.5 and 8192 mb of ram so to maintain the same capacity with
108+
# the new default allocation ratio of 1.0 we use 8192+4096=12288
109+
memory_mb = 12288
107110
local_gb = 100000
108111

109112

nova/tests/functional/test_servers_provider_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ def setUp(self):
8282
},
8383
'MEMORY_MB': {
8484
'total': 8192,
85-
'allocation_ratio': 1.5,
85+
'allocation_ratio': 1.0,
8686
'max_unit': 8192,
8787
'min_unit': 1,
8888
'reserved': 512,
8989
'step_size': 1,
9090
},
9191
'VCPU': {
9292
'total': 10,
93-
'allocation_ratio': 16.0,
93+
'allocation_ratio': 4.0,
9494
'max_unit': 10,
9595
'min_unit': 1,
9696
'reserved': 0,

nova/tests/unit/objects/test_compute_node.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ def test_compat_allocation_ratios_zero_conf(self, mock_update):
666666
CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio)
667667

668668
mock_update.assert_called_once_with(
669-
self.context, 123, {'cpu_allocation_ratio': 16.0,
670-
'ram_allocation_ratio': 1.5,
669+
self.context, 123, {'cpu_allocation_ratio': 4.0,
670+
'ram_allocation_ratio': 1.0,
671671
'disk_allocation_ratio': 1.0})
672672

673673
@mock.patch('nova.db.main.api.compute_node_update')
@@ -694,8 +694,8 @@ def test_compat_allocation_ratios_None_conf_zero_values(self, mock_update):
694694
CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio)
695695

696696
mock_update.assert_called_once_with(
697-
self.context, 123, {'cpu_allocation_ratio': 16.0,
698-
'ram_allocation_ratio': 1.5,
697+
self.context, 123, {'cpu_allocation_ratio': 4.0,
698+
'ram_allocation_ratio': 1.0,
699699
'disk_allocation_ratio': 1.0})
700700

701701
@mock.patch('nova.db.main.api.compute_node_update')
@@ -722,8 +722,8 @@ def test_compat_allocation_ratios_None_conf_None_values(self, mock_update):
722722
CONF.initial_disk_allocation_ratio, compute.disk_allocation_ratio)
723723

724724
mock_update.assert_called_once_with(
725-
self.context, 123, {'cpu_allocation_ratio': 16.0,
726-
'ram_allocation_ratio': 1.5,
725+
self.context, 123, {'cpu_allocation_ratio': 4.0,
726+
'ram_allocation_ratio': 1.0,
727727
'disk_allocation_ratio': 1.0})
728728

729729
def test_get_all_by_not_mapped(self):

nova/tests/unit/virt/libvirt/test_driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21366,7 +21366,7 @@ def _get_inventory(self):
2136621366
'min_unit': 1,
2136721367
'max_unit': self.vcpus,
2136821368
'step_size': 1,
21369-
'allocation_ratio': 16.0,
21369+
'allocation_ratio': 4.0,
2137021370
'reserved': 0,
2137121371
},
2137221372
orc.PCPU: {
@@ -21382,7 +21382,7 @@ def _get_inventory(self):
2138221382
'min_unit': 1,
2138321383
'max_unit': self.memory_mb,
2138421384
'step_size': 1,
21385-
'allocation_ratio': 1.5,
21385+
'allocation_ratio': 1.0,
2138621386
'reserved': 512,
2138721387
},
2138821388
orc.DISK_GB: {

nova/tests/unit/virt/vmwareapi/test_driver_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,15 +2123,15 @@ def test_update_provider_tree(self, mock_get_avail_ds):
21232123
'min_unit': 1,
21242124
'max_unit': 16,
21252125
'step_size': 1,
2126-
'allocation_ratio': 16.0,
2126+
'allocation_ratio': 4.0,
21272127
},
21282128
orc.MEMORY_MB: {
21292129
'total': 2048,
21302130
'reserved': 512,
21312131
'min_unit': 1,
21322132
'max_unit': 1024,
21332133
'step_size': 1,
2134-
'allocation_ratio': 1.5,
2134+
'allocation_ratio': 1.0,
21352135
},
21362136
orc.DISK_GB: {
21372137
'total': 95,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
upgrade:
3+
- |
4+
In this release the default values for the initial ram and cpu allocation
5+
ratios have been updated to 1.0 and 4.0 respectively. This will not
6+
affect any existing compute node resource providers but the new default
7+
will take effect on the creation of new resource providers.
8+
other:
9+
- |
10+
The default initial allocation ratios enabled ram over commit by default
11+
with a factor of ``1.5``. This value was chosen early in nova's history
12+
as the predominant workload was web hosting or other light weight
13+
virtualization. Similarly the default initial cpu allocation ratio
14+
defaulted to 16. As more demanding workload from telco, enterprise,
15+
scientific and governmental users became the norm the initial values we
16+
had chosen became less and less correct overtime. These have now been
17+
updated to reflect a more reasonable default for the majority of our users.
18+
As of this release the initial ram allocation value is 1.0 disabling
19+
overcommit by default for new compute nodes and the initial cpu allocation
20+
ratio is now 4.0 which is a more reasonable overcommit for non idle
21+
workloads.

0 commit comments

Comments
 (0)