Hi embhorn,
Thanks for the quick reply and the clarification.
Yes, I’m using TLS (wolfSSL) on top of the MQTT connection — that’s likely where most of the overhead comes from. The device runs on a lightweight custom TCP/IP stack (similar to lwIP, but trimmed down for our MCU).
I understand that WolfMQTT itself is quite efficient, but it seems the combination of TLS handshakes, message fragmentation, and limited heap memory (only around 64 KB total) might be contributing to the slowdown.
I’ll experiment with matching the MQTT buffer size to the TCP driver buffer as you suggested. Do you recommend keeping the MQTT buffer slightly smaller than the TCP buffer, or the same size?
Also, would using non-blocking sockets help reduce latency under tight memory constraints?
Best regards,
bettylim