mldonkey-users
[Top][All Lists]
Advanced

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

[Mldonkey-users] bandwith control, bandwith wasteage, querying twice


From: Goswin Brederlow
Subject: [Mldonkey-users] bandwith control, bandwith wasteage, querying twice
Date: 26 Aug 2002 05:43:51 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

Hi,

I had a huge problem getting mldonkey to honor its bandwith limits and
download anything.

The problem was worse the more files I had in the list.

So I tracked it down a found the following:

1. downloadClient.ml: 208: let query_files c sock for_files =  

This is called when connecting to a client. The function queries a
client for all files in "for_files" and all files in "!!files".

Now the more file one downloads the more queries this generates.
Files with state FilePaused will be queried without need.
File in "for_files" are also present in "!!files" causing duplicate
queries.

I added

      if file.file_state != FilePaused then
        if not (List.mem file for_files) then

and paused most files and the problem went away.

I would like to limit the number of queries sent to a
client. Something like the older X files or X random files.

Also the queries should be droppable if the bandwith is maxed out. I
didn't see any bandwith checks there but maybe direct_client_send will
do them.


2. downloadClient.ml: 245: let client_has_chunks c file chunks =

This is called whenever a client reports back that he has some chunks
of a file.

This is called for paused files to (only due to the queries for paused
file above?) which seems to be a waste.

The function does some paperwork and then starts the download for that
client (if not running). But what if the client only has chunks I
already have? That seems to be completly ignored. When the download of
a file is started it looks to me like all chunks present on a client
are then requested, including the once I already have. (or just their
md4 sums? still wasted)

I marked all chunks I already have as not present on the client but
that decreases the Available collumn on the gui too.


3. downloadClient.ml: 726:   | M.QueryFileReplyReq t ->

This got called a lot for paused files and in turn calls
client_has_chunks for small files or generates a QueryChunksReq.

For paused files I don't realy need to know what chunks a client
has. Seems a waste of time, so I checked for FilePaused there too.



Comments on them and on solving them welcome.


Some more thoughts:

Should packets send to a socket get a priority? That way higher
priority packets could be send first and lower priority packets (like
queries for paused files) be queued or droped.

Should there be several buckets of bandwith for different packets?
The idea would be to limit queries to e.g. 1 Kb/s, sending of sources
to other mldonkey peers to 2 Kb/s and give all the rest to
up/downloads. That way one could tune the bandwith usedfor searching
and downloading finer.

Should friends be prepared when looking for a client to upload too?

MfG
        Goswin




reply via email to

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