With ~4K ports, a port-create with fixed-mac takes about 7 secs
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R4.0 |
Fix Committed
|
Medium
|
Sahil Sabharwal | |||
Trunk |
Fix Committed
|
Medium
|
Sahil Sabharwal |
Bug Description
R2.1 Build 26 Ubuntu 12.04 Icehouse Multi-node (2 cfgm ) setup
A normal port-create on a VN takes less than a second
In a VN, i have ~4K ports.
Now, a port-create with fixed-mac takes more than 7sec. Per Ajay, some optimization can be done here.
root@nodei34:
Created a new port:
+------
| Field | Value |
+------
| admin_state_up | True |
| device_id | |
| device_owner | |
| fixed_ips | {"subnet_id": "7dab9edf-
| id | b84107f7-
| mac_address | 00:01:00:00:0f:3c |
| name | b84107f7-
| network_id | 6943e235-
| security_groups | 505bf680-
| status | DOWN |
| tenant_id | 2be87ae2cd7f4e1
+------
real 0m7.782s
user 0m0.317s
sys 0m0.063s
root@nodei34:
-------
from neutron_
def port_create(self, context, port_q):
<snip>
# if mac-address is specified, check against the exisitng ports
# to see if there exists a port with the same mac-address
if 'mac_address' in port_q:
ports = self._vnc_
for port in ports:
for mac in macs.get_
-------
root@nodei34:~# time neutron port-create 6943e235-
127.0.0.1 - - [2015-02-24 00:37:34] "GET /virtual-
192.168.1.2 - - [2015-02-24 00:37:34] "POST /neutron/network HTTP/1.1" 200 592 0.081134
127.0.0.1 - - [2015-02-24 00:37:34] "GET /virtual-
127.0.0.1 - - [2015-02-24 00:37:38] "GET /virtual-
127.0.0.1 - - [2015-02-24 00:37:41] "GET /project/
127.0.0.1 - - [2015-02-24 00:37:41] "POST /virtual-
INFO:api-0:Sending request(xid=7706): Create(
INFO:api-0:Received response(xid=7706): u'/api-
127.0.0.1 - - [2015-02-24 00:37:41] "POST /instance-ips HTTP/1.1" 200 357 0.082358
127.0.0.1 - - [2015-02-24 00:37:41] "GET /virtual-
INFO:api-0:Sending request(xid=7707): GetData(
INFO:api-0:Received response(xid=7707): ('54250743-
127.0.0.1 - - [2015-02-24 00:37:41] "GET /virtual-
127.0.0.1 - - [2015-02-24 00:37:41] "GET /instance-
192.168.1.3 - - [2015-02-24 00:37:41] "POST /neutron/port HTTP/1.1" 200 670 6.545466
summary: |
- With ~4K ports, a port-create with fixed-mac, takes about 7 secs + With ~4K ports, a port-create with fixed-mac takes about 7 secs |
Instead of reading all ports, we should do filter on the mac address.