lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] R: lwip-users Digest, Vol 201, Issue 6


From: CORRADIN Michele
Subject: [lwip-users] R: lwip-users Digest, Vol 201, Issue 6
Date: Mon, 11 May 2020 08:24:15 +0000


-----Messaggio originale-----
Da: lwip-users [mailto:lwip-users-bounces+michele.corradin=address@hidden] Per 
conto di address@hidden
Inviato: lunedì 11 maggio 2020 0.15
A: address@hidden
Oggetto: lwip-users Digest, Vol 201, Issue 6

Send lwip-users mailing list submissions to
address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.nongnu.org/mailman/listinfo/lwip-users
or, via email, send a message with subject or body 'help' to
address@hidden

You can reach the person managing the list at
address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of lwip-users digest..."


Today's Topics:

   1. Re: httpd, tls, multiple get requests, delays (Mário Luzeiro)
   2. Re: httpd, tls, multiple get requests, delays (Trampas Stern)
   3. Re: httpd, tls, multiple get requests, delays (Mário Luzeiro)


----------------------------------------------------------------------

Message: 1
Date: Sun, 10 May 2020 18:51:27 +0000
From: Mário Luzeiro <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays
Message-ID:
<address@hidden>

Content-Type: text/plain; charset="iso-8859-1"

Hi Trampas, thanks for sharing.
It was not clear, are you using some custom loading of resources (eg script and 
css files) ? Or do you mean just data (such as JSON)?
Could you share details how that is performed?
I was looking for some way that I can manage the loading manually and request 
each resource one by one instead of browser doing it..
but I couldn't find a way.

Unfortunately from what I search, there is no way to configure the browsers how 
should they behave on loading the multiple resources files.
I tried some tags for preload etc and none made any effect (at leas in firefox, 
where I was testing..)

Mario

________________________________________
From: lwip-users <lwip-users-bounces+mrluzeiro=address@hidden> on behalf of 
Trampas Stern <address@hidden>
Sent: 10 May 2020 13:21
To: Mailing list for lwIP users
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays

I have ran into similar issues.  I ended up changing my HTML source files.

To understand let me start with the background.  I have a web page where ever 
second I request data from the embedded server and display it.  So in the 
Javascript for the web page I had a 1000ms timeout that requested new 
data(file).  This worked great on the bench.  However the customer was testing 
it and complaining about it being slow.  As it turns out the issue was the 
customer had a slow laptop and when they started a zoom meeting the network 
traffic on the laptop went up and my device got really really slow.
What I found was happening is I would make a request for data, it would time 
out inside chrome which would retry the request.  That is as the requests timed 
out in the browser it would retry, this meant as time moved forward I would 
start with browser trying to request one copy of data, then if that timed out 
it would request it again while my timer in javascript also requested it again, 
now I had two connections for the same file on the embedded device. Then three, 
then four...

The solution was to change the javascript such that it made request and if I 
did not get a response in 500ms it would time out the request, before I made a 
second request. This way at any time the browser would only allow one request 
per file. I also could increase the timeout between requests to match network 
speed.   I found this also needed to be done with CSS files.  That is sometimes 
I found that I would get random failure requesting files.  For example at one 
time my Phy chip was getting too hot and causing random network failures that 
cause havoc on my system.  I found that this would cause random failures, and 
retries.  By having the javascript control the time out on the file it helped.  
That is with the random failures and the time out for the http connection in 
lwip I would again get where I had two open connections for the same 
resource/file.  Hence timing out on javascript would send the close to the 
server and thus kill one connection before starting a new one.

This also leads to the other issue, when you use LWIP you have think about how 
the system handles multiple requests for the same resource.  That is if you are 
sending out a file can lwip have two open connections to the file?  For example 
two computers accessing your server at the same time.  This is one reason I 
implemented authentication system, as it restricts the number of connections, 
by restricting the number of users.

Trampas



On Sat, May 9, 2020 at 5:03 PM Mário Luzeiro 
<address@hidden<mailto:address@hidden>> wrote:
Hello all,

I'm looking for some ideas how can I improve an issue I have.
I have a httpd over TLS. As you may know, browsers fire multiple requests at 
same time to get the resources.

I had a lot of issues related with TLS / LWIP connections to handle this 
multiple connections but the major are now working ok...
but as you can see in the screenshot, despite most of the requests are handled 
very quickly but for some reason.. some will take too long to handle.
There is some pattern on this, sometimes a bit random on the time it takes..
The first time the browser connects to the server it takes a lot to initialize 
the TLS, but its ok because the next ones are very fast.. except that random 
get requests

Any idea how can it be improved ?

I already support 20 TCP connections ( MEMP_NUM_TCP_PCB is 20 * 2 ) and played 
with lots of parameters that I tuned for the best results except this last one..

Regards,
Mario Luzeiro
_______________________________________________
lwip-users mailing list
address@hidden<mailto:address@hidden>
https://lists.nongnu.org/mailman/listinfo/lwip-users



------------------------------

Message: 2
Date: Sun, 10 May 2020 17:12:43 -0400
From: Trampas Stern <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays
Message-ID:
<address@hidden>
Content-Type: text/plain; charset="utf-8"

So you can load css and such with javascript:
https://www.geeksforgeeks.org/how-to-load-css-files-using-javascript/
https://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript

https://stackoverflow.com/questions/4724606/how-to-use-javascript-to-check-and-load-css-if-not-loaded/25615777

What I am doing is loading JSON like this.

function loadjson() {
xmlhttp = new XMLHttpRequest();
xmlhttp.timeout = 500; // time in milliseconds
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
//handle parsing json and updating fields
 }
xmlhttp.open("GET", "/json", true);
xmlhttp.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
xmlhttp.ontimeout = function () {
//exit and do nothing we will make another request
// here if you are not doing a periodic load you could call function again
to try again.
}
xmlhttp.send();
}

  setInterval(loadjson , 1000);


On Sun, May 10, 2020 at 2:51 PM Mário Luzeiro <address@hidden> wrote:

> Hi Trampas, thanks for sharing.
> It was not clear, are you using some custom loading of resources (eg
> script and css files) ? Or do you mean just data (such as JSON)?
> Could you share details how that is performed?
> I was looking for some way that I can manage the loading manually and
> request each resource one by one instead of browser doing it..
> but I couldn't find a way.
>
> Unfortunately from what I search, there is no way to configure the
> browsers how should they behave on loading the multiple resources files.
> I tried some tags for preload etc and none made any effect (at leas in
> firefox, where I was testing..)
>
> Mario
>
> ________________________________________
> From: lwip-users <lwip-users-bounces+mrluzeiro=address@hidden> on
> behalf of Trampas Stern <address@hidden>
> Sent: 10 May 2020 13:21
> To: Mailing list for lwIP users
> Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays
>
> I have ran into similar issues.  I ended up changing my HTML source files.
>
> To understand let me start with the background.  I have a web page where
> ever second I request data from the embedded server and display it.  So in
> the Javascript for the web page I had a 1000ms timeout that requested new
> data(file).  This worked great on the bench.  However the customer was
> testing it and complaining about it being slow.  As it turns out the issue
> was the customer had a slow laptop and when they started a zoom meeting the
> network traffic on the laptop went up and my device got really really slow.
> What I found was happening is I would make a request for data, it would
> time out inside chrome which would retry the request.  That is as the
> requests timed out in the browser it would retry, this meant as time moved
> forward I would start with browser trying to request one copy of data, then
> if that timed out it would request it again while my timer in javascript
> also requested it again, now I had two connections for the same file on the
> embedded device. Then three, then four...
>
> The solution was to change the javascript such that it made request and if
> I did not get a response in 500ms it would time out the request, before I
> made a second request. This way at any time the browser would only allow
> one request per file. I also could increase the timeout between requests to
> match network speed.   I found this also needed to be done with CSS files.
> That is sometimes I found that I would get random failure requesting
> files.  For example at one time my Phy chip was getting too hot and causing
> random network failures that cause havoc on my system.  I found that this
> would cause random failures, and retries.  By having the javascript control
> the time out on the file it helped.  That is with the random failures and
> the time out for the http connection in lwip I would again get where I had
> two open connections for the same resource/file.  Hence timing out on
> javascript would send the close to the server and thus kill one connection
> before starting a new one.
>
> This also leads to the other issue, when you use LWIP you have think about
> how the system handles multiple requests for the same resource.  That is if
> you are sending out a file can lwip have two open connections to the file?
> For example two computers accessing your server at the same time.  This is
> one reason I implemented authentication system, as it restricts the number
> of connections, by restricting the number of users.
>
> Trampas
>
>
>
> On Sat, May 9, 2020 at 5:03 PM Mário Luzeiro <address@hidden<mailto:
> address@hidden>> wrote:
> Hello all,
>
> I'm looking for some ideas how can I improve an issue I have.
> I have a httpd over TLS. As you may know, browsers fire multiple requests
> at same time to get the resources.
>
> I had a lot of issues related with TLS / LWIP connections to handle this
> multiple connections but the major are now working ok...
> but as you can see in the screenshot, despite most of the requests are
> handled very quickly but for some reason.. some will take too long to
> handle.
> There is some pattern on this, sometimes a bit random on the time it
> takes..
> The first time the browser connects to the server it takes a lot to
> initialize the TLS, but its ok because the next ones are very fast.. except
> that random get requests
>
> Any idea how can it be improved ?
>
> I already support 20 TCP connections ( MEMP_NUM_TCP_PCB is 20 * 2 ) and
> played with lots of parameters that I tuned for the best results except
> this last one..
>
> Regards,
> Mario Luzeiro
> _______________________________________________
> lwip-users mailing list
> address@hidden<mailto:address@hidden>
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.nongnu.org/archive/html/lwip-users/attachments/20200510/579c4807/attachment.html>

------------------------------

Message: 3
Date: Sun, 10 May 2020 21:59:54 +0000
From: Mário Luzeiro <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays
Message-ID:
<address@hidden>

Content-Type: text/plain; charset="iso-8859-1"

Thanks for the links
Previous I tried to investigate some library that manages it but it looks few 
code that I can try.

Related with JSON, I'm already doing "Ajax requests" and they work fine..
it looks after the first connection and if it requests regularly, it keeps 
working well all the time with very short time communications.
I guess it is because it (browser) keeps the same TCP connection to it.


Still.. if anyone has a suggestion to improve LWP/TLS configurations to help on 
this issue..

Regards,
Mario

________________________________________
From: lwip-users <lwip-users-bounces+mrluzeiro=address@hidden> on behalf of 
Trampas Stern <address@hidden>
Sent: 10 May 2020 22:12
To: Mailing list for lwIP users
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays

So you can load css and such with javascript:  
https://www.geeksforgeeks.org/how-to-load-css-files-using-javascript/
https://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript
https://stackoverflow.com/questions/4724606/how-to-use-javascript-to-check-and-load-css-if-not-loaded/25615777

What I am doing is loading JSON like this.

function loadjson() {
xmlhttp = new XMLHttpRequest();
xmlhttp.timeout = 500; // time in milliseconds
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
//handle parsing json and updating fields
 }
xmlhttp.open("GET", "/json", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.ontimeout = function () {
//exit and do nothing we will make another request
// here if you are not doing a periodic load you could call function again to 
try again.
}
xmlhttp.send();
}

  setInterval(loadjson , 1000);


On Sun, May 10, 2020 at 2:51 PM Mário Luzeiro 
<address@hidden<mailto:address@hidden>> wrote:
Hi Trampas, thanks for sharing.
It was not clear, are you using some custom loading of resources (eg script and 
css files) ? Or do you mean just data (such as JSON)?
Could you share details how that is performed?
I was looking for some way that I can manage the loading manually and request 
each resource one by one instead of browser doing it..
but I couldn't find a way.

Unfortunately from what I search, there is no way to configure the browsers how 
should they behave on loading the multiple resources files.
I tried some tags for preload etc and none made any effect (at leas in firefox, 
where I was testing..)

Mario

________________________________________
From: lwip-users 
<lwip-users-bounces+mrluzeiro=address@hidden<mailto:address@hidden>> on behalf 
of Trampas Stern <address@hidden<mailto:address@hidden>>
Sent: 10 May 2020 13:21
To: Mailing list for lwIP users
Subject: Re: [lwip-users] httpd, tls, multiple get requests, delays

I have ran into similar issues.  I ended up changing my HTML source files.

To understand let me start with the background.  I have a web page where ever 
second I request data from the embedded server and display it.  So in the 
Javascript for the web page I had a 1000ms timeout that requested new 
data(file).  This worked great on the bench.  However the customer was testing 
it and complaining about it being slow.  As it turns out the issue was the 
customer had a slow laptop and when they started a zoom meeting the network 
traffic on the laptop went up and my device got really really slow.
What I found was happening is I would make a request for data, it would time 
out inside chrome which would retry the request.  That is as the requests timed 
out in the browser it would retry, this meant as time moved forward I would 
start with browser trying to request one copy of data, then if that timed out 
it would request it again while my timer in javascript also requested it again, 
now I had two connections for the same file on the embedded device. Then three, 
then four...

The solution was to change the javascript such that it made request and if I 
did not get a response in 500ms it would time out the request, before I made a 
second request. This way at any time the browser would only allow one request 
per file. I also could increase the timeout between requests to match network 
speed.   I found this also needed to be done with CSS files.  That is sometimes 
I found that I would get random failure requesting files.  For example at one 
time my Phy chip was getting too hot and causing random network failures that 
cause havoc on my system.  I found that this would cause random failures, and 
retries.  By having the javascript control the time out on the file it helped.  
That is with the random failures and the time out for the http connection in 
lwip I would again get where I had two open connections for the same 
resource/file.  Hence timing out on javascript would send the close to the 
server and thus kill one connection before starting a new one.

This also leads to the other issue, when you use LWIP you have think about how 
the system handles multiple requests for the same resource.  That is if you are 
sending out a file can lwip have two open connections to the file?  For example 
two computers accessing your server at the same time.  This is one reason I 
implemented authentication system, as it restricts the number of connections, 
by restricting the number of users.

Trampas



On Sat, May 9, 2020 at 5:03 PM Mário Luzeiro 
<address@hidden<mailto:address@hidden><mailto:address@hidden<mailto:address@hidden>>>
 wrote:
Hello all,

I'm looking for some ideas how can I improve an issue I have.
I have a httpd over TLS. As you may know, browsers fire multiple requests at 
same time to get the resources.

I had a lot of issues related with TLS / LWIP connections to handle this 
multiple connections but the major are now working ok...
but as you can see in the screenshot, despite most of the requests are handled 
very quickly but for some reason.. some will take too long to handle.
There is some pattern on this, sometimes a bit random on the time it takes..
The first time the browser connects to the server it takes a lot to initialize 
the TLS, but its ok because the next ones are very fast.. except that random 
get requests

Any idea how can it be improved ?

I already support 20 TCP connections ( MEMP_NUM_TCP_PCB is 20 * 2 ) and played 
with lots of parameters that I tuned for the best results except this last one..

Regards,
Mario Luzeiro
_______________________________________________
lwip-users mailing list
address@hidden<mailto:address@hidden><mailto:address@hidden<mailto:address@hidden>>
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
address@hidden<mailto:address@hidden>
https://lists.nongnu.org/mailman/listinfo/lwip-users



------------------------------

Subject: Digest Footer

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

------------------------------

End of lwip-users Digest, Vol 201, Issue 6
******************************************
Informativa sul trattamenti dei dati dei contatti di clienti e fornitori La 
Società, Titolare del trattamento La informa che, nell’esecuzione del rapporto 
contrattuale o precontrattuale che ci lega alla impresa per cui lei opera, 
potranno venir comunicati reciprocamente tra le due imprese, o comunque messi a 
disposizione dei rispettivi referenti, i Suoi dati personali e di contatto 
(dati anagrafici, e-mail aziendali, telefoni aziendali, smartphone ad uso 
lavorativo, etc.) in funzione delle mansioni e degli incarichi a Lei conferiti, 
per la gestione ed esecuzione dei rapporti precontrattuali o contrattuali in 
questione. Pertanto, la nostra azienda tratterà tali dati personali nei limiti 
in cui siano strettamente necessari per la esecuzione di tutti gli aspetti del 
contratto. I dati verranno conservati fino al completamento delle reciproche 
prestazioni oggetto del contratto e successivamente in ragione dei termini 
prescrizionali previsti per gli atti e documenti dell’impresa.

Information on data processing of customer and supplier contacts The Company, 
owner of the personal data, informs you that, in the execution of the 
contractual or pre-contractual relationship that binds us to the company you 
are currently working for, might exchange respective contacts, your personal 
data and contact details (personal data, company e-mails, company telephones, 
smartphones for business use, etc.) according to the tasks and tasks assigned 
to you, for the management and execution of the pre-contractual or contractual 
relationships in question. Therefore, our company will process such personal 
data to the extent that it is strictly necessary for the execution of all 
aspects of the contract. The data will be retained until the completion of the 
reciprocal services covered by the contract and subsequently according to the 
prescribed time limits for the company's documents and documents.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]