Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory benchmark #186

Merged
merged 6 commits into from
Apr 8, 2024
Merged

Memory benchmark #186

merged 6 commits into from
Apr 8, 2024

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

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

test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
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.

test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
test/memory/memory_api_test.go Outdated Show resolved Hide resolved
@VladoLavor VladoLavor marked this pull request as ready for review March 18, 2024 13:24
Copy link

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

test/memory/memory_api_test.go Outdated Show resolved Hide resolved
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
@VladoLavor VladoLavor requested a review from hardeker April 4, 2024 10:56
Copy link

@hardeker hardeker 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
9 checks passed
@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.

3 participants