Skip to content

EPOL-19: Parse latency histogram#5

Open
bodushka wants to merge 1 commit into
mainfrom
histogram_prox_update-EPOL-19
Open

EPOL-19: Parse latency histogram#5
bodushka wants to merge 1 commit into
mainfrom
histogram_prox_update-EPOL-19

Conversation

@bodushka
Copy link
Copy Markdown
Contributor

cmpd_parser.c was modified.
Added new function parse_bucket_size_freq to parce bucket size and TSC frequency. Call it in handle_stats_and_packets.

prox_client.py was modified.
Added new functions:
_recv_multiline for multi-line parsing
lat_all_stats for parsing latency histogram, bucket size and TSC frequency.

Comment thread VNFs/DPPD-PROX/helper-scripts/prox_client.py Outdated
Comment thread VNFs/DPPD-PROX/helper-scripts/prox_client.py Outdated
Comment thread VNFs/DPPD-PROX/helper-scripts/prox_client.py Outdated
Comment thread VNFs/DPPD-PROX/helper-scripts/prox_client.py Outdated
Comment thread VNFs/DPPD-PROX/helper-scripts/prox_client.py Outdated
@invicta198
Copy link
Copy Markdown
Contributor

Request to add following information in the comments:

  1. PROX compilation logs
  2. Value of full_response observed from the method _recv_multiline

@bodushka bodushka force-pushed the histogram_prox_update-EPOL-19 branch from 6b4ef01 to f6caa3d Compare August 18, 2025 13:01
@bodushka
Copy link
Copy Markdown
Contributor Author

Request to add following information in the comments:

1. PROX compilation logs

2. Value of `full_response` observed from the method `_recv_multiline`

debug_multiline.log
compitation.log

While rebuilding PROX I encountered a build fail caused by undeclared PTHREAD in files display.c and lconf.c
The problem has gone after adding #include <pthread.h> to these files
In compilation.log I included both of error outputs without <pthread.h> in those files. And the last, successful output of build after I added <pthread.h>

@bodushka bodushka force-pushed the histogram_prox_update-EPOL-19 branch from f6caa3d to d01ad7c Compare August 20, 2025 09:26
@bodushka
Copy link
Copy Markdown
Contributor Author

Added #include <pthread.h> in display.c and lconf.c to resolve undeclared PTHREAD issues.

invicta198
invicta198 previously approved these changes Aug 21, 2025
@deebhatia
Copy link
Copy Markdown
Member

Can you measure the impact of incorporating this in terms of CPU cycles spent. Also, Is this correc to assume this parsing computation is being done by master process only?

Do the measurements and update in confluence with full load:

  1. Single Core for 64 byte ethernet frame (UDP) on 25 Gb NIC (cross Node)
  2. Multiple Cores for 64 byte ethernet frame (UDP) on 25 Gb NIC (cross Node)
  3. Multiple Cores for 64 byte ethernet frame (UDP) on 100 Gb NIC (cross Node)

Get required infra and time window to run this. We need to make sure you have exclusive access, cluster is tuned and nothing else is running on the cluster when we are measuring.

@bodushka
Copy link
Copy Markdown
Contributor Author

bodushka commented Sep 8, 2025

Can you measure the impact of incorporating this in terms of CPU cycles spent. Also, Is this correc to assume this parsing computation is being done by master process only?

Do the measurements and update in confluence with full load:

1. Single Core for 64 byte ethernet frame (UDP) on 25 Gb NIC (cross Node)

2. Multiple Cores for 64 byte ethernet frame (UDP) on 25 Gb NIC (cross Node)

3. Multiple Cores for 64 byte ethernet frame (UDP) on 100 Gb NIC (cross Node)

Get required infra and time window to run this. We need to make sure you have exclusive access, cluster is tuned and nothing else is running on the cluster when we are measuring.

Brief summary: With the new changes, the packet loss with 1 queue remains about the same as without changes, around 0.01%. However, with 3 queues, the loss is significantly higher: 0.01% without changes vs 0.075% with changes.

The new change introduces 2 simple getters while handling the lat all stats command, but the impact is observed even when the command has not been invoked.

With 3 cores, the Tx/Rx bandwidth increases, but latency also rises: from 14336-16383 TSC to 20480-22527 TSC and higher (shifting from buckets 7 and 8 to buckets 9, 10 and above).

Report for manual testing (with 100 Gb/s NIC yet):
https://voereir-my.sharepoint.com/:x:/p/bohdan/EbOmY5ln_RxPsuScMn4b7-kBSnBRrO8xi3aagks-GUrH6w?e=SU9sGP

NLL_report.pdf

@sdevshali sdevshali added the Pending Tests The code change is pending comprehensive dev testing. label Sep 12, 2025
try:
# lat all stats sends +-130 lines (128 buckets + stats lines)
lines_received = 0
max_expected_lines = 130
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the bucket count increases, this will fail, right?

Why don't we run the loop until chunk is None?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will issue an infinite loop since recv() usually returns empty bytes or raises exceptions. But will work with a short timeout. So I added 2 sec timeout to collect all histogram data.

cmpd_parser.c was modified:
Added new command "lat tot stats"
 - Added function parse_cmd_lat_tot_stats
 - A copy of "lat all stats", but shows total packets latency histogram
   instead of packets per second histogram
Added new function handle_total_latency_histogram
 - Shows latency histogram for all packets since reset
 - Called in parse_cmd_lat_tot_stats
Added new function parse_bucket_size_freq to parce bucket size and TSC frequency
 - Called in handle_stats_and_packets to add info for "lat all stats"
 - Called in handle_total_latency_histogram to add info for "lat tot stats"

stats_latency.h & stats_latency.c were modified:
Added new function stats_core_lat_total_histogram
 - A copy of stats_core_lat_histogram but returns tot_lat_test.buckets instead
   of lat_test.buckets. lat_test is for collecting latency data per second while
   tot_lat_test is for collecting total latency data

prox_client.py was modified:
Added new function _recv_multiline
 - A copy of _recv but for multi-line parsing
Added new function _parse_histogram_response
 - Processes multiline responses from PROX "lat all stats" and
   "lat tot stats" commands, returns tuple of histogram_data + bucket_info
   Called in _get_latency_histogram_stats
Added new function _get_latency_histogram_stats
 - Collects and returns all histogram and additional data
 - Called in lat_all_stats & lat_tot_stats
Added new function lat_all_stats
 - Collects current latency histogram and additional data from PROX
   showing packets per second
Added new function lat_tot_stats
 - Collects current latency histogram and additional data from PROX
   showing total packets amount since reset

in files display.c and lconf.c added #include <pthread.h>
to solve undeclared PTHREAD issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending Tests The code change is pending comprehensive dev testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants