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

msgq: optimize queue size #344

Open
adeebshihadeh opened this issue Aug 16, 2022 · 1 comment
Open

msgq: optimize queue size #344

adeebshihadeh opened this issue Aug 16, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@adeebshihadeh
Copy link
Contributor

msgq uses a fixed default size for all queues. Since our struct are all different sizes, this leaves some services with only 10s of buffer and others with more than an hour; if left running for long enough, the queues will use up ~400MB. At build time, we know the struct size (except lists) and frequency for all services, so we can set each service's queue size based on buffer time, which should save quite a bit of memory.

@adeebshihadeh adeebshihadeh added the enhancement New feature or request label Aug 16, 2022
@deanlee
Copy link
Contributor

deanlee commented Jan 16, 2025

The table below shows the average message sizes calculated using a simple Python script from the demo route.

Message Type Average Size (bytes)
sentinel 48.00
uiDebug 48.00
onroadEventsDEPRECATED 51.74
mapRenderState 56.00
microphone 56.00
peripheralState 56.00
temperatureSensor 80.00
lightSensor 80.00
clocks 80.00
roadEncodeIdx 88.00
qRoadEncodeIdx 88.00
wideRoadEncodeIdx 88.00
driverEncodeIdx 88.00
sendcan 93.20
liveTorqueParameters 96.00
driverMonitoringState 104.00
liveParameters 104.00
gyroscope 112.00
accelerometer 112.00
magnetometer 112.00
gpsLocationExternal 128.00
uploaderState 128.00
navInstruction 158.00
liveCalibration 176.00
driverCameraState 184.00
roadCameraState 184.00
wideRoadCameraState 184.00
carState 193.87
radarState 232.00
liveTracksDEPRECATED 239.39
cameraOdometry 248.00
carControl 256.00
controlsState 329.60
pandaStates 344.00
longitudinalPlan 392.00
driverStateV2 392.00
ubloxRaw 417.76
deviceState 480.00
lateralPlanDEPRECATED 536.00
ubloxGnss 538.63
uiPlanDEPRECATED 664.00
logMessage 852.55
can 929.13
androidLog 1075.09
liveLocationKalmanDEPRECATED 1208.00
gnssMeasurements 1221.55
managerState 1472.00
navRoute 1560.00
navModelDEPRECATED 1816.00
carParams 1856.00
modelV2 8736.00
thumbnail 9932.00
navThumbnail 12160.00
initData 25600.00
procLog 89224.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants