aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Don't Lose Sources when aMule is Stopped and Restarted  (Read 4236 times)

nubtumbler

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 39
Don't Lose Sources when aMule is Stopped and Restarted
« on: October 05, 2005, 12:26:03 AM »

The problem:
When aMule is closed and rerun seconds later all sources are lost and must be found again.  This is a pain to users and also puts unnecessary load on servers.

A possible solution:
On exit, save all (or many) source IP's along with a timestamp.  On startup, compare the timestamp with the current time.  If the difference is something reasonable, like less than 30 seconds, all of the sources are loaded and used.  If the difference is too large ignore the saved source IP's.  

There is currently  an option to save 5 sources on rare files with less than 20 sources so it seems that much of the machinery is already there.
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #1 on: October 05, 2005, 07:56:19 AM »

I don't know what you do, but I for myself don't restart it more than once a day. The sources return within 5 minutes. But saving many sources of many parts would just cause to double the time of a shutdown.
Logged
Homefucking is killing prostitution

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #2 on: October 05, 2005, 11:23:45 AM »

and for also well spreaded file this would not make sence since like vollstrecker said it takes 1-2min and the sources are back
for rare files the saving is already done, if a file has less then (I think) 50 sources, 5sources are automatically saved at exit.


stefanero
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

nubtumbler

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 39
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #3 on: October 09, 2005, 04:15:49 AM »

Quote
Originally posted by Vollstrecker
I don't know what you do, but I for myself don't restart it more than once a day. The sources return within 5 minutes. But saving many sources of many parts would just cause to double the time of a shutdown.

Suppose you store one timestamp (8 bytes) and 100 source IPs (4 bytes) for each download.  You'd only be writing 408 additional bytes per download.  Even at 200 downloads that's only around 80K.  I can't see how an 80K write would double the shutdown time.

Not everyone is able to start amule up in the morning and close it when they shut the machine down at night. Some users must restart amule every hour or two. It's not as unusual as you might think.  Consider a guy with a laptop who has to close up and move to a different   lecture hall every 1.5 hours.
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #4 on: October 09, 2005, 10:54:04 AM »

If you can use amule in a lecture, you are a very happy guy. All institutes I know have proxys that allow only port http and https traffic. Sometimes pop and smtp, but they don't nat anything.
And if you have a notebook, you don't have to shutdown. These things are designed to run from Accu, so you can carry it to the lecture or mensa or toilette without shutting down the whole thing. Maybe you have to use cabled mediums, but when my ISP disconnects after 24 hours, the sources come back much faster than starting amule, so I don't see any need of this "feature".
Btw. a timestamp has usually saved data and time like 200510091106 for now, and that is much more than 4 byte, it is 12 Byte. And a source has usually save IP and port of the source, either with dots 84.171.66.85:4662 which has 17 Byte, or with 0's like 0841710660854662 which has 16 Byte. Both are much more than you say. Sure you could zip them, but I don't think that that saves much.
In both case I come for 100 source to 1712 Byte, or 1812 Byte. For 200 downloads that is 342400 Byte  (334,375 KB) and 362400Bbyte (353,90625 KB). My Temp-folder is mounted over a samba share on a 100MBit/s LAN, that would mean I have to wait 2,7 or 3,4 seconds longer for a shutdown. And I didn't calculate the Ethernet Overhead.
Logged
Homefucking is killing prostitution

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #5 on: October 09, 2005, 11:28:10 AM »

Actually saving a source is just 6 bytes (4 for the ip and 2 for the port)
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #6 on: October 09, 2005, 12:33:49 PM »

werner@Werner1:~$ du --human-readable --byte  test
18      test
werner@Werner1:~$ cat test
84.171.66.85:4662
werner@Werner1:~$
Logged
Homefucking is killing prostitution

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #7 on: October 09, 2005, 01:27:28 PM »

... we dont' store that on plain text, you know.
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #8 on: October 09, 2005, 03:00:25 PM »

How then? Even converting to hex wouldn't save that much.
Logged
Homefucking is killing prostitution

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Don't Lose Sources when aMule is Stopped and Restarted
« Reply #9 on: October 10, 2005, 03:32:16 AM »

An ip is 4 bytes. Each number is one byte. And a port is two bytes - 0 to 65535.
Logged