Skip to content

Conversation

@VladoLavor
Copy link
Collaborator

@VladoLavor VladoLavor commented Jan 23, 2024

I have added a simple API memory benchmark/test.

Example output:

Running GoVPP API calls memory test
For 100000 show-version calls:
		Measured	Threshold
-----------------------------------------
Total alloc:	424.57 MB	250.00 MB
Memory Freed:	5.22 MB 
Heap alloc:	1.92 MB 	5.00 MB 
Objects alloc:	5,499,561
Obj freed:	5,476,772
Objects remain:	22,789		50,000
Message rate:	11534 m/s
Num goroutines:	8
Duration:	8.669396593s

For 100000 create/delete loopback calls:
		Measured	Threshold
-----------------------------------------
Total alloc:	284.17 MB	350.00 MB
Memory Freed:	3.89 MB 
Heap alloc:	2.18 MB 	5.00 MB 
Objects alloc:	4,108,089
Obj freed:	4,079,319
Objects remain:	28,770		50,000
Message rate:	9863 m/s
Num goroutines:	8
Duration:	10.138160233s

It measures 1k, 10k, 100k, and 1M APIs by default. A custom number of APIs can be tested with the -api-num parameter. Thresholds are pre-defined only for default values. The test runs the GetVersion API, which can be called indefinitely.

Signed-off-by: Vladimir Lavor vlavor@cisco.com

@VladoLavor VladoLavor self-assigned this Jan 23, 2024
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Copy link

@kerart kerart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some suggestions here and there

Copy link
Contributor

@sknat sknat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @VladoLavor ! I made a few comments inline.

@VladoLavor VladoLavor marked this pull request as ready for review March 18, 2024 13:24
@VladoLavor VladoLavor requested review from kerart and sknat March 18, 2024 13:24
Copy link

@kerart kerart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I added a suggestion to make it easier to add new metrics

Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
@VladoLavor VladoLavor requested a review from kerart April 4, 2024 10:56
Copy link

@kerart kerart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. LGTM

Copy link
Contributor

@sknat sknat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks !

@sknat sknat merged commit f9786a4 into master Apr 8, 2024
@sknat sknat deleted the memory-benchmark branch April 8, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants