[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] webserver problem
From: |
Noam weissman |
Subject: |
Re: [lwip-users] webserver problem |
Date: |
Tue, 9 Jul 2013 14:33:30 +0300 |
Hi,
As default the MSS size is defined to be 1500 bytes. This is too large for
embedded.
Try to reduce it to 536 and increase the total number of PCBS.
These are my settings:
/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE (10*1024) //(7*1024)
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
sends a lot of data out of ROM (or other static memory), this
should be set high. */
#define MEMP_NUM_PBUF 100
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
per active UDP "connection". */
#define MEMP_NUM_UDP_PCB 10
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
connections. */
#define MEMP_NUM_TCP_PCB 12
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
connections. */
#define MEMP_NUM_TCP_PCB_LISTEN 5
/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
timeouts. */
#define MEMP_NUM_SYS_TIMEOUT 10
/* ---------- Pbuf options ---------- */
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE 20
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE 600
/* ---------- TCP options ---------- */
#define LWIP_TCP 1
#define TCP_TTL 255
/* Controls if TCP should queue segments that arrive out of
order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ 0
/* TCP Maximum segment size. */
//#define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU -
IP header size - TCP header size) */
#define TCP_MSS 536
/* TCP sender buffer space (bytes). */
//#define TCP_SND_BUF (2*TCP_MSS)
#define TCP_SND_BUF (8*TCP_MSS)
/* 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. */
//#define TCP_SND_QUEUELEN (2* TCP_SND_BUF/TCP_MSS)
#define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF)/(TCP_MSS))
/* TCP receive window. */
//#define TCP_WND (2*TCP_MSS)
#define TCP_WND (4*TCP_MSS)
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
segments. */
//#define MEMP_NUM_TCP_SEG 20
#define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN // 20 // This was previosly
20 and cause a MEM_ERR it was changed
// to BE THE SAME SIZE AS
TCP_SND_QUEUELEN
BR,
Noam.
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Nikolas Karakotas
Sent: ג 09 יולי 2013 11:16
To: Mailing list for lwIP users
Subject: Re: [lwip-users] webserver problem
Hi,
Try and increase your MEM_SIZE.
Nick
-----Original Message-----
From: pcu
Sent: Monday, July 08, 2013 6:11 PM
To: address@hidden
Subject: [lwip-users] webserver problem
Hello,
I work with STM32F217 + LWIP 1.3.2 + FreeRTOS 6.1.0
I have several services in parallel:
One webserver (therefore on TCP)
One UDP client to connect NTP.
One UDP client ECHO request.
One UDP server listening broadcast messages.
The webserver is heavy, because pages are in javascript and need Jquery
mobile(91kB).
Neverthless, So far so good.
But If I connect other services, all the pages from webserver are not loaded.
I tried to increase some parameters but without success. I don't know where to
go to improve the webserver.
This is the screenshot from Chrome:
Bad:
<http://lwip.100.n7.nabble.com/file/n21697/Capture.jpg>
Good, with all UDP services disabled:
<http://lwip.100.n7.nabble.com/file/n21697/Capture1.jpg>
Note that I updated the ethernefif.c like this:
http://lwip.100.n7.nabble.com/STM32-RBUS-Receive-Buffer-Unavailable-bit-set-after-debugger-break-td11154.html#a11161
Thank you for your help,
Pierre.
--
View this message in context:
http://lwip.100.n7.nabble.com/webserver-problem-tp21697.html
Sent from the lwip-users mailing list archive at Nabble.com.
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
************************************************************************************
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
************************************************************************************
- [lwip-users] webserver problem, pcu, 2013/07/08
- Re: [lwip-users] webserver problem, Nikolas Karakotas, 2013/07/09
- Re: [lwip-users] webserver problem,
Noam weissman <=
- Re: [lwip-users] webserver problem, Pomeroy, Marty, 2013/07/09
- Re: [lwip-users] webserver problem, Noam weissman, 2013/07/09
- Re: [lwip-users] webserver problem, Vincent Cui, 2013/07/09
- Re: [lwip-users] webserver problem, Nikolas Karakotas, 2013/07/09
- Re: [lwip-users] webserver problem, pcu, 2013/07/09
- Re: [lwip-users] webserver problem, pcu, 2013/07/09
- Re: [lwip-users] webserver problem, pcu, 2013/07/11
- Re: [lwip-users] webserver problem, Bill Auerbach, 2013/07/11
- Re: [lwip-users] webserver problem, pcu, 2013/07/11
- Re: [lwip-users] webserver problem, Pomeroy, Marty, 2013/07/09