Open Slion opened 3 weeks ago
@goldsimon @yarrick what's your opinion on this? Any good read you recommend about lwIP configuration?
Related to #2828
Try sending a question to lwip-users@nongnu.org and include debug logs and such.
After doing some tests and monitoring the heap size it's clear pbufs are not allocated from MEM_SIZE
so you don't really need it and could keep using the default. I'm using 2KB.
The rest of the suggested changes do make sense though.
Operating System
Others
Board
Raspberry Pi Pico WH
Firmware
lnet_lwip_webserver
What happened ?
OOM errors in lwIP logs.
Enable logs like that:
How to reproduce ?
Enable logs and maybe use some larger web page.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Not so relevant, that's about lwIP usage.
Description
There is something funny with this example lwIP configuration.
It does not specify
MEM_SIZE
which means the default 1600 bytes is used. Then it specifiesTCP_MSS
as 1500 bytes which will result in aPBUF_POOL_BUFSIZE
of about the same I believe. So there is barely enough room for a single pbuf in the lwIP heap. Also the overriding ofPBUF_POOL_SIZE
from 4 to 16 is questionable I think.When I built on this example to serve slightly larger web pages needing around 32 GET requests to load it worked mostly. But when I enabled the lwIP logs it became clear something was not right as there was a lot of OOM warnings.
I would remove
TCP_SND_BUF
,TCP_WND
andPBUF_POOL_SIZE
overrides. LeaveTCP_MSS
as it is maybe and add:Than again I admit I know very little about the inner working of lwIP myself so we ought to ask the experts really. However those changes did fix my OOM warnings and improved HTTP performance in my case.
I have checked existing issues, dicussion and documentation