Update the processing of assigned addresses when assigning addresses

Bug #1813253 reported by Chengqian Liu on 2019-01-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
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
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?

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
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

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

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

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

Other bug subscribers