sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
252 stars 240 forks source link

v4.activities.sugarlabs.org #939

Open quozl opened 3 years ago

quozl commented 3 years ago

Tested. I had to switch from my non-default updater to the Sugar default with;

gsettings set org.sugarlabs.update backend 'aslo.AsloUpdater'

It worked, but it was really slow. Looking at it with tcpdump, Sugar is making one connection for each installed activity. The connection is not cached. Since the connection now uses https, the encryption setup time is multiplied by the number of installed activities. With me in Australia, the server in the USA, and 39 activities, it took 42 seconds. We need a way to cache and re-use the connection.

srevinsaju commented 3 years ago

Tested. I had to switch from my non-default updater to the Sugar default with;

gsettings set org.sugarlabs.update backend 'aslo.AsloUpdater'

It worked, but it was really slow. Looking at it with tcpdump, Sugar is making one connection for each installed activity. The connection is not cached. Since the connection now uses https, the encryption setup time is multiplied by the number of installed activities. With me in Australia, the server in the USA, and 39 activities, it took 42 seconds. We need a way to cache and re-use the connection.

  • [ ] cache and re-use the connection,

Another possible solution is to use Cloudflare to manage our DNS. This would provide a faster Cache to any other country, including but not limited to Australia, as they have data centers all around the world. Alex and I had been recently talking about this. So, using this would be a huge benefit especially for children in countries with poor internet connection.

quozl commented 3 years ago

I don't think so; the DNS lookup occurs once and is cached.

srevinsaju commented 3 years ago

I don't think so; the DNS lookup occurs once and is cached.

Migrating our DNS to cloudflare would also help us to proxy certain domains through cloudflare's servers. Data which is transfered through their servers gets cached, and this cache would be served later on. This could possibly improve speed. This would be an improvement, along with using a single connection instance.

image

image

srevinsaju commented 3 years ago

@codewiz gave me another idea of using a single http request to get the data of multiple activities. This would however, require client side as well as server side changes.

Proposed plan POST a json with the bundle id's of required activities to

https://v4.activities.sugarlabs.org/services/multipleAsloUpdater/

aslo4-server should reply with the data required for updating for all activities. The size of response will increase, for reducing the number of connections. What do you think?

quozl commented 3 years ago

Sounds complicated. Can't we just fix our use of Soup.Session in downloader.py and aslo.py so that the connection is not closed unless it needs to be closed?

quozl commented 3 years ago

Regarding CDN, this doesn't fix slow last mile links, as experienced by school children sharing a limited connection. It will be even worse for them than it is for me.

srevinsaju commented 3 years ago

Sounds complicated. Can't we just fix our use of Soup.Session in downloader.py and aslo.py so that the connection is not closed unless it needs to be closed?

Agreed, I was suggesting something to be done along with Soup.Session.