part-cw / LNhealth

Health-related apps using the LambdaNative framework
http://lnhealth.lambdanative.org
Other
22 stars 3 forks source link

WidgetDemo/About making spurious network connections at high rate #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

Compiled widgetdemo for Linux - when I hit "About" I see very many connections to 172.217.16.68:80 created and reset at a very high rate. Looking at the DNS cache the request was probably for www.google.com although reverse DNS shows different names.

This is before hitting "for more information visit.." which actually works as intended.

No other page from WidgetDemo has this strange behaviour.

mgorges commented 6 years ago

apps/WidgetDemo/sandbox/main.sx#L59 calls (host-ipaddr) - potentially every time that page is rendered, which should probably be changed? As for the IP it is strange, but it might be due to the use of a CDN by Google? - If you look at modules/ln_core/ipaddr.scm#L40 in LambdaNative, it does poll for it as a test to see what our IP address is?

ghost commented 6 years ago

On Sat, Mar 10, 2018 at 09:59:43PM +0000, Matthias Görges wrote:

apps/WidgetDemo/sandbox/main.sx#L59 calls (host-ipaddr) - potentially every time that page is rendered, which should probably be changed? As for the IP it is strange, but it might be due to the use of a CDN by Google? - If you look at modules/ln_core/ipaddr.scm#L40 in LambdaNative, it does poll for it as a test to see what our IP address is?

the IP most likely comes from asking for Google, the local DNS cache associates those in a way I can pretty sure quess it resulted from a query to www.google.com so that would be a very good explanation.

What I don't understand is how many of those connections are opened without anything else going on. Don't know how to count those easily as they are immediately destroyed again but it is 50 new connections per second at least or perhaps much more. Is the rendering routine called so often (on Linux)? Just noticed the same page is rather sluggish on Android (eg scrolling the license) so it could be the same problem there as well.

Actually.. I am looking for a very basic uiform example, without the lnhealth stuff and sandboxes.

mgorges commented 6 years ago

If the rendering happens at 30fps, I would expect 30 such requests per second. If the frame rate is higher, this should similarly go up. Bug fixed in commit 765857c, which checks this only once on initalization.

mgorges commented 6 years ago

As for a minimal uiform example I don't have one, as we only have complete apps using it (or lnhealth), which I don't wish to share. Are you looking for a minimal main.sx file?

The minimal main.scm for the sandbox container can be autogenerated - see modules/lnhealth/migrate.sh with the apps/WidgetDemo/main.scm being a good example.

ghost commented 6 years ago

On Sat, Mar 10, 2018 at 04:47:35PM -0800, Matthias Görges wrote:

As for a minimal uiform example I don't have one, as we only have complete apps using it (or lnhealth), which I don't wish to share. Are you looking for a minimal main.sx file?

I was looking for something independent of lnhealth and the sandboxes.. just a hello world button ot so using uiform.

ddunsmuir commented 6 years ago

I'm making a demo app for this, but there are apparently a few issues with using uiform without lnhealth, the first being that it doesn't list many things it needs in its MODULES file. Once I have fixed the issues, I'll commit it and let you know.

ddunsmuir commented 6 years ago

Ok, I just had to fix the MODULES and set it up properly in the app. See the new DemoUIForm app in lambdanative. Minus the license code it's under 100 lines including the script for a few simple pages.

ghost commented 6 years ago

On Tue, Mar 13, 2018 at 05:25:08PM +0000, Dustin wrote:

Ok, I just had to fix the MODULES and set it up properly in the app. See the new DemoUIForm app in lambdanative. Minus the license code it's under 100 lines including the script for a few simple pages.

great thanks, exactly what I was looking for.