WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Apps downloading is pretty slow  (Read 25473 times)

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #60 on: August 25, 2020, 11:44:51 PM »
@Rich
Code: [Select]
cat /opt/wlan0.sh
#!/bin/sh
pkill udhcpc
udhcpc -b -i wlan0 -x hostname:box -p /var/run/udhcpc.eth0.pid

@GNUser
Even my /opt dir is not persistent so chattr doesn't work :( .
Try adding your desired DNS servers to the top of /usr/share/udhcpc/default.script like this, for example:
Code: [Select]
dns="1.1.1.1 1.0.0.1"Then running wifi.sh
After also reading http://forum.tinycorelinux.net/index.php?topic=8019.0
OMG That worked !!! Now the file remained with dns at 8.8.8.8 and 8.8.4.4 but sadly, even then the forum doesn't load.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11661
Re: Apps downloading is pretty slow
« Reply #61 on: August 26, 2020, 08:12:53 AM »
Hi Sashank999
If you used this:
Code: [Select]
dns="8.8.8.8 8.8.4.4"It will not try  8.8.4.4  unless it can not connect to  8.8.8.8.  Those are both Google DNS servers so they probably see a lot of traffic.

I found that for me page loads were much faster with  4.2.2.4  than  8.8.4.4.

Also, when was the last time you gave your router a hard reboot. On occasion, I found if my connection slowed down, unplugging
the routers power cord for 10 seconds helped.

... But I have a DASAN Router ...
What's the model number?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1523
Re: Apps downloading is pretty slow
« Reply #62 on: August 26, 2020, 08:22:43 AM »
Sashank999,
It would be good to confirm that this is a TCL issue and not something else (e.g., hardware issue, router issue, or ISP issue).
If you boot a different OS on the same machine, does the problem go away?

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #63 on: August 27, 2020, 09:24:35 AM »
@Rich
I gave hard reboot. But it doesn't go away. My router model number is "H662GS", manufactured by "DASAN Network Solutions".

@GNUser
Yes, this is not only a TCL issue. I went to other OS (Windows 10 and Phoenix OS(android x86 derivative)) and the forums load slow even in them. I was actually here to propose that Apps should verify deps by running multiple subprocess for its direct dependencies(not whole tree file, only dep file) so that it can load them faster.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1523
Re: Apps downloading is pretty slow
« Reply #64 on: August 27, 2020, 09:39:10 AM »
...this is not only a TCL issue...
Well, then you need to exclude hardware, router, and ISP issues (e.g., if other machines connected to same wireless router have same problem, then it's a router or ISP issue; if a wired connection has same problem, then it's probably an ISP issue; etc). Until you can pinpoint the problem, it's counterproductive to search for a solution.

I was actually here to propose that Apps should verify deps by running multiple subprocess for its direct dependencies(not whole tree file, only dep file) so that it can load them faster.
Oops, sorry. I guess I missed the point of the thread. TCL is very much a community project and encourages a do-it-yourself approach. The developers welcome patches.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Apps downloading is pretty slow
« Reply #65 on: August 27, 2020, 12:52:30 PM »
Multiple downloads in parallel from a single server is considered rude, and it may not even help your case. The throttling you see may not be per-connection but per-area.
The only barriers that can stop you are the ones you create yourself.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #66 on: August 28, 2020, 12:31:53 AM »
@Curaga
I am not saying "Multiple thread downloads". I am saying to verify the already downloaded dependency tczs in multiple processes.
For example, lets take "ffmpeg4".tcz. It contains a lot of tree dependencies. So, to verify them faster, creating subprocesses to tree dependencies may help.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Apps downloading is pretty slow
« Reply #67 on: August 28, 2020, 02:45:52 AM »
What do you mean verify? md5sum? It's quite fast...
The only barriers that can stop you are the ones you create yourself.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #68 on: August 28, 2020, 08:32:41 AM »
I forgot to include the word "loading" beside verifying. My bad.

I mean to run subprocesses for loading and verifying. It would be really fast.
It is similar to "make -j2" - dividing the load of compiling to 2 processors. Just like that I propose running subprocesses to load dependencies recursively.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11661
Re: Apps downloading is pretty slow
« Reply #69 on: August 28, 2020, 09:50:31 AM »
Hi Sashank999
Doing that means those processes would be running asynchronously in the background, creating a race condition. This will cause
problems for cases when the order of extension loading matters, such as  graphics-KERNEL  and  alsa-config.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #70 on: August 29, 2020, 05:45:16 AM »
Oh. I didn't know that.
Is there a way to add timeout option for tce-load or wget ? Or else a retry option for wget ?
Sometimes the connection to repo just breaks in the middle (happens like once or twice a month, so no bother). But when it breaks when I am downloading an extension that has like 100 tree deps (for example) it would take another 15 minutes for the Apps or tce-load to do the whole thing again. Hence I am asking this.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11661
Re: Apps downloading is pretty slow
« Reply #71 on: August 29, 2020, 09:49:31 AM »
Hi Sashank999
... Is there a way to add timeout option for tce-load or wget ? Or else a retry option for wget ? ...
wget has both of those options (-T  and  -c):
Code: [Select]
tc@E310:~$ busybox wget --help
BusyBox v1.29.3 (2018-12-19 15:29:37 UTC) multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
        [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy
tc@E310:~$

If you search the  tce-*  scripts:
Code: [Select]
tc@E310:~$ grep wget /usr/bin/tce-*
/usr/bin/tce-audit:             wget -cq -P /tmp "$MIRROR"/"$TARGET" 2>/tmp/fetch_result
/usr/bin/tce-fetch.sh:  wget -cq -O- "$MIRROR"/"${1//-KERNEL.tcz/-${KERNELVER}.tcz}"
/usr/bin/tce-fetch.sh:  wget -cq "$MIRROR"/"$F"
/usr/bin/tce-load:      wget -cq "$MIRROR"/"$1".md5.txt 2>/dev/null
/usr/bin/tce-load:      wget -c "$MIRROR"/"$1"
/usr/bin/tce-load:                                      if (system("rm -f "depfile"; wget -c -P "optional" "mirror"/"name".dep 2>/dev/null") == 0 && ! SUPPRESS)
/usr/bin/tce-status:                    busybox wget --spider -q "$MIRROR"/"$E" 2>/dev/null || echo "$E not found!"
/usr/bin/tce-update:    wget -cq "$MIRROR"/"$1"
/usr/bin/tce-update:            wget -cq "$MIRROR"/"$1" # Either there was no zsync file on the server, or it failed
tc@E310:~$
you'll see it uses the  -c  option for wget. You can add a  -T  option to the commands above if you think it will help you. Then add
those 4 files to your backup.

The timeout is being used to make sure the command does not hangup forever, not to try to make intermittent network connections
more tolerable. According to the  busybox  config file, the timeout for wget should default to  10 seconds.

Quote
... Sometimes the connection to repo just breaks in the middle (happens like once or twice a month, so no bother). But when it breaks when I am downloading an extension that has like 100 tree deps (for example) it would take another 15 minutes for the Apps or tce-load to do the whole thing again. ...
If  tce-load  gets interrupted, it resumes with the file that failed to download when you run it again.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 400
Re: Apps downloading is pretty slow
« Reply #72 on: August 30, 2020, 05:37:55 AM »
I said "to do the whole thing", not downloading. It takes time in verifying tree deps from start if interrupted, not in downloading. I already know that it continues previous downloads (which helped me when I did compiletc).

I think I should study those tce-* scripts. Thanks to the devs for using ash instead of C or C++ for tce- scripts (Idk C or C++).

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11661
Re: Apps downloading is pretty slow
« Reply #73 on: August 30, 2020, 08:40:39 AM »
Hi Sashank999
... Thanks to the devs for using ash instead of C or C++ for tce- scripts (Idk C or C++).
You will probably also find some  awk  in those scripts.