Add performance test for set/delete routes#2344
Conversation
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
10.1.0.37 [](start = 37, length = 9)
The neigh IP is too similar to the interface IPs. Do you want to use a totally different IP? #Closed
There was a problem hiding this comment.
Updated to a different IP.
There was a problem hiding this comment.
@qiluo-msft , @shi-su , the neighbor is expected to be in the same subnet as interface IP. With the subnet of /31, it can have only one neighbor, ie. 10.1.0.55. Suggest to change to a /24 subnet and have few neighbors so as to cover ECMP as well.
There was a problem hiding this comment.
@prsunny . Thanks for this suggestion. I updated the test to fix it.
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
ROUTE_JSON [](start = 0, length = 10)
Use ansible tempfile module to generate a safe temp filename? #Closed
There was a problem hiding this comment.
Using mktemp in DUT to generate this temp file.
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
ROUTE_JSON [](start = 62, length = 10)
Actually you don't need to copy a file into container. You can call docker exec -i swss swssconfig /dev/stdin < filename #Closed
There was a problem hiding this comment.
Fixed as prescribed.
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
duthost.shell [](start = 22, length = 13)
duthost.shell [](start = 22, length = 13)
Is there already a function for this? #Closed
There was a problem hiding this comment.
I did not find a function that does this job. I did find a few other places that use similar sonic-db-cli and redis-cli to get keys.
There was a problem hiding this comment.
I am worried about the performance. I found a better solution https://stackoverflow.com/a/18247870/2514803
In reply to: 505121217 [](ancestors = 505121217)
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
10000 [](start = 17, length = 5)
I thought you change this number much to get a performance diagram. If this is the right use case, could you make a testcase parameter with a default value? #Closed
There was a problem hiding this comment.
Added a testcase parameter with default value for the number of routes.
tests/conftest.py
Outdated
There was a problem hiding this comment.
The --num_routes option has been defined in tests/vxlan/conftest.py. There is conflicting. PR testing failed because of this conflicting. Suggest to move definition of this --num_routes specific to route testing to tests/route/conftest.py.
There was a problem hiding this comment.
Thanks for this suggestion! I did move it to tests/route/conftest.py but the PR tests still fail. And I could not reproduce this problem locally. Wondering if you have any idea about this?
There was a problem hiding this comment.
It turns out that the vxlan tests define the option in init.py and it can be seen outside. Moved the part to a separate conftest.py file resolves the problem.
prsunny
left a comment
There was a problem hiding this comment.
I think we should have two more cases to consider:
- Add IPv6 routes
- Add ECMP routes, by creating ~8 neighbors or so and add route pointing to those 8 neighbors.
tests/route/test_route_perf.py
Outdated
There was a problem hiding this comment.
Not every platforms have Ethernet72. Is this intended to run only on some platform?
There was a problem hiding this comment.
Updated the interface used for the test. Also added IPv6 and multiple neighbors.
|
retest this please |
qiluo-msft
left a comment
There was a problem hiding this comment.
LGTM, please also resolve others' review comments.
tests/route/test_route_perf.py
Outdated
| 'interface' : 'Ethernet%d' % (idx_neigh * 4 + 4), | ||
| 'ip' : '10.%d.0.1/24' % (idx_neigh + 1), | ||
| 'neighbor' : '10.%d.0.2' % (idx_neigh + 1), | ||
| 'mac' : '55:54:00:ad:48:%0.2x' % idx_neigh |
There was a problem hiding this comment.
55 as the first byte would cause issue in some platforms as they treat this as a multicast mac. For e,g 01:00:53 is the standard multicast mac but many platforms checks only the first byte 01. So please change it to 54 or 00
There was a problem hiding this comment.
Thanks for the suggestion! Fixed.
tests/route/test_route_perf.py
Outdated
| 'interface' : 'Ethernet%d' % (idx_neigh * 4), | ||
| 'ip' : '%x::1/64' % (0x2000 + idx_neigh), | ||
| 'neighbor' : '%x::2' % (0x2000 + idx_neigh), | ||
| 'mac' : '55:54:00:ad:48:%0.2x' % idx_neigh |
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| def pytest_addoption(parser): |
There was a problem hiding this comment.
Why do we have vxlan change in this PR? Suggest to separate if not part of this feature. @theasianpianist for visibility
There was a problem hiding this comment.
This change is to resolve the --num-routes option conflicting issue. Please refer to #2344 (comment)
There was a problem hiding this comment.
The --num_routes option is used for route tests and vxlan tests. Currently, vxlan test put pytest_addoption in init.py. This will be seen by pytest during initialization and cause conflict if any other tests try to add --num_routes option. I moved pytest_addoption to conftest.py to resolve conflict.
|
retest this please |
Description of PR
Summary: Add a performance test for setting and deleting routes
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
The goal of this PR is to add a test case to quantify the performance of set/delete routes and make sure the operation could finish within the time limit.
How did you do it?
Set or delete multiple (10k level) routes with
swssconfigand record the time for the routes to show up in ASIC_DB.How did you verify/test it?
Verified by running the test locally with a virtual switch.
Any platform specific information?
Supported testbed topology if it's a new test case?
Any.
Documentation