DHCP notification could be optimized

Bug #1923161 reported by Oleg Bondarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Oleg Bondarev

Bug Description

DHCP notification is done after each create/update/delete for
network, subnet and port [1].

This notification currently has to retrieve network from DB each time,
which is a quite heavy DB request and hence affects performance of
port and subnet CRUD [2].

2 proposals:
- not fetch network when it's not needed
- pass network dict from plugin

[1] https://github.com/openstack/neutron/blob/bdd661d21898d573ef39448316860aa4c692b834/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py#L111-L120

[2] https://github.com/openstack/neutron/blob/bdd661d21898d573ef39448316860aa4c692b834/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py#L200

Revision history for this message
Oleg Bondarev (obondarev) wrote :
Changed in neutron:
status: New → In Progress
Miguel Lavalle (minsel)
Changed in neutron:
importance: Wishlist → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/785581
Committed: https://opendev.org/openstack/neutron/commit/130655cdb98f493d0ceda72e2c3a0649c3d9024d
Submitter: "Zuul (22348)"
Branch: master

commit 130655cdb98f493d0ceda72e2c3a0649c3d9024d
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 9 11:52:29 2021 +0300

    DHCP notification optimization

    DHCP notification is done after each create/update/delete for
    network, subnet and port.
    This notification currently has to retrieve network from DB almost
    every time, which is a quite heavy DB request and hence affects
    performance of port and subnet CRUD.

    This patch suggests 2 optimizations:
    - do not fetch network if not needed (only fetch when schedule needed)
    - for port and subnet AFTER_CREATE event pass network dict from plugin

    According to Rally tests these changes improve performance:
    - port create ~20%
    - port update ~20%
    - subnet create ~15%
    - port delete and subnet update/delete - not tested

    Closes-Bug: #1923161
    Change-Id: I0ab836ac09225f4f3ad435e9ceaf315018855d52

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/786435

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/786435
Committed: https://opendev.org/openstack/neutron/commit/b0b64e3e033f179176911c7a53b97f1a43aee634
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit b0b64e3e033f179176911c7a53b97f1a43aee634
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 9 11:52:29 2021 +0300

    DHCP notification optimization

    DHCP notification is done after each create/update/delete for
    network, subnet and port.
    This notification currently has to retrieve network from DB almost
    every time, which is a quite heavy DB request and hence affects
    performance of port and subnet CRUD.

    This patch suggests 2 optimizations:
    - do not fetch network if not needed (only fetch when schedule needed)
    - for port and subnet AFTER_CREATE event pass network dict from plugin

    According to Rally tests these changes improve performance:
    - port create ~20%
    - port update ~20%
    - subnet create ~15%
    - port delete and subnet update/delete - not tested

    Closes-Bug: #1923161
    Change-Id: I0ab836ac09225f4f3ad435e9ceaf315018855d52
    (cherry picked from commit 130655cdb98f493d0ceda72e2c3a0649c3d9024d)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/787191

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/787193

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/787194

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/787191
Committed: https://opendev.org/openstack/neutron/commit/342814db723dd60800539e72629d5c6de47af960
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 342814db723dd60800539e72629d5c6de47af960
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 9 11:52:29 2021 +0300

    DHCP notification optimization

    DHCP notification is done after each create/update/delete for
    network, subnet and port.
    This notification currently has to retrieve network from DB almost
    every time, which is a quite heavy DB request and hence affects
    performance of port and subnet CRUD.

    This patch suggests 2 optimizations:
    - do not fetch network if not needed (only fetch when schedule needed)
    - for port and subnet AFTER_CREATE event pass network dict from plugin

    According to Rally tests these changes improve performance:
    - port create ~20%
    - port update ~20%
    - subnet create ~15%
    - port delete and subnet update/delete - not tested

    Conflicts:
         neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

    Closes-Bug: #1923161
    Change-Id: I0ab836ac09225f4f3ad435e9ceaf315018855d52
    (cherry picked from commit 130655cdb98f493d0ceda72e2c3a0649c3d9024d)

tags: added: in-stable-victoria
tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/787193
Committed: https://opendev.org/openstack/neutron/commit/48b30783c0d550b4fb23c5886090c4f57b88ad53
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 48b30783c0d550b4fb23c5886090c4f57b88ad53
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 9 11:52:29 2021 +0300

    DHCP notification optimization

    DHCP notification is done after each create/update/delete for
    network, subnet and port.
    This notification currently has to retrieve network from DB almost
    every time, which is a quite heavy DB request and hence affects
    performance of port and subnet CRUD.

    This patch suggests 2 optimizations:
    - do not fetch network if not needed (only fetch when schedule needed)
    - for port and subnet AFTER_CREATE event pass network dict from plugin

    According to Rally tests these changes improve performance:
    - port create ~20%
    - port update ~20%
    - subnet create ~15%
    - port delete and subnet update/delete - not tested

    Conflicts:
         neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

    Closes-Bug: #1923161
    Change-Id: I0ab836ac09225f4f3ad435e9ceaf315018855d52
    (cherry picked from commit 130655cdb98f493d0ceda72e2c3a0649c3d9024d)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/787194
Committed: https://opendev.org/openstack/neutron/commit/8d7cc27532a5da64382cbd7258d8ce3dcecbda0d
Submitter: "Zuul (22348)"
Branch: stable/train

commit 8d7cc27532a5da64382cbd7258d8ce3dcecbda0d
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 9 11:52:29 2021 +0300

    DHCP notification optimization

    DHCP notification is done after each create/update/delete for
    network, subnet and port.
    This notification currently has to retrieve network from DB almost
    every time, which is a quite heavy DB request and hence affects
    performance of port and subnet CRUD.

    This patch suggests 2 optimizations:
    - do not fetch network if not needed (only fetch when schedule needed)
    - for port and subnet AFTER_CREATE event pass network dict from plugin

    According to Rally tests these changes improve performance:
    - port create ~20%
    - port update ~20%
    - subnet create ~15%
    - port delete and subnet update/delete - not tested

    Conflicts:
         neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

    Closes-Bug: #1923161
    Change-Id: I0ab836ac09225f4f3ad435e9ceaf315018855d52
    (cherry picked from commit 130655cdb98f493d0ceda72e2c3a0649c3d9024d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 15.3.4

This issue was fixed in the openstack/neutron 15.3.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.3.2

This issue was fixed in the openstack/neutron 16.3.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 17.1.2

This issue was fixed in the openstack/neutron 17.1.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.1.0

This issue was fixed in the openstack/neutron 18.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.