Check what values you configured for the TCP settings of the stack.
The default values are located in include/lwip/opt.h you should customize them with your own lwipopts.hwhich get included at the top of opt.hand thus overwrites any default values.
The following values should be interesting for you. They have very conservative default settings to make LwIP run on very low ressources:
/**
* TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
* you might want to increase this.)
* For the receive side, this MSS is advertised to the remote side
* when opening a connection. For the transmit size, this MSS sets
* an upper limit on the MSS advertised by the remote host.
*/
#ifndef TCP_MSS
#define TCP_MSS 536
#endif
the other values are mostly calculated from this one:
/**
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
*/
#ifndef TCP_WND
#define TCP_WND (4 * TCP_MSS)
#endif
/**
* TCP_SND_BUF: TCP sender buffer space (bytes).
* To achieve good performance, this should be at least 2 * TCP_MSS.
*/
#ifndef TCP_SND_BUF
#define TCP_SND_BUF (2 * TCP_MSS)
#endif
/**
* TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
* as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
*/
#ifndef TCP_SND_QUEUELEN
#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
#endif
What you are experiencing is that the TCP window is too small and so the stack will wait for ACKs befor being able to send the next packet(s).
More info on this can be found in the LWIP wiki:
http://lwip.wikia.com/wiki/Lwipopts.h
the project homepage:
http://savannah.nongnu.org/projects/lwip/
or on the mailing list:
https://lists.nongnu.org/mailman/listinfo/lwip-users