Limit on number of TCP connections

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Limit on number of TCP connections

Alex H
Hello,

I stumbled upon a limitation in the MEMP_NUM_TCP_PCB setting, where the maximum is an unsigned short. I was wondering if there is a simple way to boost this limit, as I get the following warning currently and cannot connect more than 16960 clients:

In file included from lwip/src/core/memp.c:48:
lwip/src/include/lwip/memp.h:106:5: warning: unsigned conversion from ‘int’ to ‘short unsigned int’ changes value from ‘1000000’ to ‘16960’ [-Woverflow]
  106 |     (num), \
      |     ^
lwip/src/core/memp.c:78:42: note: in expansion of macro ‘LWIP_MEMPOOL_DECLARE’
   78 | #define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc)
      |                                          ^~~~~~~~~~~~~~~~~~~~
lwip/src/include/lwip/priv/memp_std.h:50:1: note: in expansion of macro ‘LWIP_MEMPOOL’
   50 | LWIP_MEMPOOL(TCP_PCB,        MEMP_NUM_TCP_PCB,         sizeof(struct tcp_pcb),        "TCP_PCB")
      | ^~~~~~~~~~~~

Do you think it would be a big change to boost that unsigned short to an unsigned int? Or is there any memory pool settings I can tinker with to avoid this limitation?

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Limit on number of TCP connections

goldsimon@gmx.de
Am 27.02.2020 um 16:25 schrieb Alex H:
> Hello,
>
> I stumbled upon a limitation in the MEMP_NUM_TCP_PCB setting, where the
> maximum is an unsigned short. I was wondering if there is a simple way
> to boost this limit, as I get the following warning currently and cannot
> connect more than 16960 clients:

I guess lwIP is not really designed for that many connections. If you
really need that many tcp connections however, you may need to adjust
other memp pools also, which should hit the limit before the TCP_PCB pool.

I suggest to enable MEMP_MEM_MALLOC and just set the heap size high
enough...

Regards,
Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users