-
Notifications
You must be signed in to change notification settings - Fork 34
[VPC Mgr] Fix VPC Creation Performance Issue #357
[VPC Mgr] Fix VPC Creation Performance Issue #357
Conversation
...s/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/SegmentController.java
Outdated
Show resolved
Hide resolved
services/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/VpcController.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
|
@kevin-zhonghao In this PR description, can you detail the issue and how you fix it? Some recommended format like the following, which was how I edited the previous PR so I would like you to practice it as well :-) Bug Description Proposed Solution |
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look pretty good. I left a few more minor comments. Please take a look.
.../vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/allocator/NetworkKeyAllocator.java
Outdated
Show resolved
Hide resolved
|
|
||
| key = networkGRERange.allocateKey(); | ||
| cache.put(networkGRERange.getId(), networkGRERange); | ||
| if (!key.equals(ConstantsConfig.keyNotEnoughReturnValue)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend to put this check into a util method which could be used for other extended validation, not only checking keyNotEnoughReturnValue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's right ~ but we could make this change when we have other extended validation later, what do you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...pc_manager/src/main/java/com/futurewei/alcor/vpcmanager/service/Impl/SegmentServiceImpl.java
Show resolved
Hide resolved
services/vpc_manager/src/test/java/com/futurewei/alcor/vpcmanager/SegmentControllerTests.java
Show resolved
Hide resolved
|
@kevin-zhonghao This PR has some conflicting files with your other PR #353 that just got merged to master. Should be a minor fix. Pls take a look. |
# Conflicts: # services/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/SegmentController.java # services/vpc_manager/src/test/java/com/futurewei/alcor/vpcmanager/SegmentControllerTests.java
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for continuing tuning the performance.
Bug Description
The creation of vpc will take a long time (avg about 0.8s), and the time will increase as the amount of data in the database increases.
Proposed Solution
We found that the process of creating vxlan took a lot of time, so I replaced repo.findAllItems() in addVxlanEntity() method with repo.findItem() and set up partition as the key of the map in cache.