From 182044d628314290a38440bab203d27fb9db755d Mon Sep 17 00:00:00 2001 From: shenjiatong Date: Sun, 15 May 2022 10:12:47 +0800 Subject: [PATCH] Do not auto subquery load DistributedPortBindings We observe excessive DB calls to load DistributedPortBindings, We have enabled DVR and have some huge virtual routers with around 60 router interfaces scheduled on around 200 compute nodes. Under such situation, subquery load DistributedPortBinding looks like not a very wise idea, because it is not explicitly used. I glance through the code and have a feeling that ml2_distributed_port_bindings is not used except explicitly called. So IMO it is safe to change it to default lazy load without causing serious regression. Closes-bug: #1973576 Change-Id: Ib2c48bd5ad55e9c754a8e4938e6c5eafacc75dcc --- neutron/plugins/ml2/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/neutron/plugins/ml2/models.py b/neutron/plugins/ml2/models.py index e4bf8de3355..6061eaa1bd6 100644 --- a/neutron/plugins/ml2/models.py +++ b/neutron/plugins/ml2/models.py @@ -129,6 +129,5 @@ class DistributedPortBinding(model_base.BASEV2): models_v2.Port, load_on_pending=True, backref=orm.backref("distributed_port_binding", - lazy='subquery', cascade='delete')) revises_on_change = ('port', )