Update the processing of assigned addresses when assigning addresses

Bug #1813253 reported by Chengqian Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Chengqian Liu

Bug Description

openstack allinone.

16 cpus with 2.40GHz
16G memery

only one subnet in a network.

1. Neutron-server takes a long time when creating a port with multiple addresses at once

neutron port-create --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 --fixed-ip subnet_id=474b9575-b569-48dd-a3f2-0b02b752c098 66105fab-7ea9-4efc-b9c8-1839f742bdd1

When there are already 6300+ addresses, it takes 50s to allocate the address part every time the command is run.

in _generate_ips,
2s+ for list_allocations (not fixed in this fix)
2s+ for ip_allocations.add(ipallocation.ip_address)
10 times.

https://github.com/drkjam/netaddr/issues/171

- list_allocations
I found it is slow because of log in process_rows method. https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/engine/result.py
I turn off 'connection_debug' in neutron.conf ,Speed increases quickly, '2 seconds , 741903 microseconds' to '711636 microseconds'.

2.When the current address pool does not have enough addresses,
  all addresses are allocated from the current pool,
  and allocations are continued from the next address pool
  until all addresses are assigned.

Changed in neutron:
assignee: nobody → Chengqian Liu (liuchengqian90)
description: updated
description: updated
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Lajos Katona (lajos-katona) wrote :

Hi could you give some details for the usecase where you add so much addresses to one port?
Am I right that you worked with master neutron?

Revision history for this message
Chengqian Liu (liuchengqian90) wrote :

Hi
I just want to test the performance of the neutron assigned address.
And, I worked with rocky.

description: updated
description: updated
Changed in neutron:
status: New → In Progress
Revision history for this message
LIU Yulong (dragon889) wrote :
summary: - Neutron-server takes a long time when creating a port with multiple
- addresses at once
+ Update the processing of assigned addresses when assigning addresses
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/633406
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1746d7e0e682eab1001bfc434b73efb1cdf5f0f4
Submitter: Zuul
Branch: master

commit 1746d7e0e682eab1001bfc434b73efb1cdf5f0f4
Author: liuchengqian90 <xieling1990.happy@163.com>
Date: Sun Jan 27 20:47:50 2019 +0800

    Update the processing of assigned addresses when assigning addresses

    1.It is best not to use 'netaddr.IPSet.add',
      because _compact_single_network in 'IPSet.add' is quite time consuming

    2.When the current address pool does not have enough addresses,
      all addresses are allocated from the current pool,
      and allocations are continued from the next address pool
      until all addresses are assigned.

    Change-Id: I804a95fdaa3552c785e85ffab7b8ac849c634a87
    Closes-Bug: #1813253

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b2

This issue was fixed in the openstack/neutron 14.0.0.0b2 development milestone.

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

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/736969

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

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/738548

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

Reviewed: https://review.opendev.org/736969
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b182f9c326df8b943e840ffe3a5c5f64f535ac48
Submitter: Zuul
Branch: stable/queens

commit b182f9c326df8b943e840ffe3a5c5f64f535ac48
Author: liuchengqian90 <xieling1990.happy@163.com>
Date: Sun Jan 27 20:47:50 2019 +0800

    Update the processing of assigned addresses when assigning addresses

    1.It is best not to use 'netaddr.IPSet.add',
      because _compact_single_network in 'IPSet.add' is quite time consuming

    2.When the current address pool does not have enough addresses,
      all addresses are allocated from the current pool,
      and allocations are continued from the next address pool
      until all addresses are assigned.

    Change-Id: I804a95fdaa3552c785e85ffab7b8ac849c634a87
    Closes-Bug: #1813253
    (cherry picked from commit 1746d7e0e682eab1001bfc434b73efb1cdf5f0f4)

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

Reviewed: https://review.opendev.org/738548
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e23f226d15f77a2aad6f675f7b89b987aa6ab56b
Submitter: Zuul
Branch: stable/rocky

commit e23f226d15f77a2aad6f675f7b89b987aa6ab56b
Author: liuchengqian90 <xieling1990.happy@163.com>
Date: Sun Jan 27 20:47:50 2019 +0800

    Update the processing of assigned addresses when assigning addresses

    1.It is best not to use 'netaddr.IPSet.add',
      because _compact_single_network in 'IPSet.add' is quite time consuming

    2.When the current address pool does not have enough addresses,
      all addresses are allocated from the current pool,
      and allocations are continued from the next address pool
      until all addresses are assigned.

    Change-Id: I804a95fdaa3552c785e85ffab7b8ac849c634a87
    Closes-Bug: #1813253
    (cherry picked from commit 1746d7e0e682eab1001bfc434b73efb1cdf5f0f4)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron queens-eol

This issue was fixed in the openstack/neutron queens-eol release.

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

This issue was fixed in the openstack/neutron rocky-eol release.

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.