Closed synctext closed 5 years ago
The simplest 1 seeder 1 swarm experiment is working well. However, things don't go well when extending it to 10 torrents in a same channel. The design should allow user to specify a max number of torrent being seeded at the same time. There are multiple logical mistake in the code causing this problem:
Additionally, there are 2 sets of default configurations for credit_mining. One set in global default configuration file, the other in the initialization of BoostingSettings class. These are of different values, making it a bit confusing.
Bugs are fixed and now it works well in 1 channel 10 swarms test with random policy and maximum 5 active swarms.
The scrape_tracker function is disabled for now. It is basically calling Torrent_Checker to check the swarm size by requesting the tracker. However in the implementation of Torrent_Checker, it tries to create a new task in the libtorrent session, which will cause an unhandled error when this torrent is already added to download. Also, the function of this tracker scraping action is not clear to me. We have already got pre_download function to determine the swarm size(however it is also either buggy or not reliable), why we still need to scrape the track after the torrent is already being downloaded? And it should not be working on DHT. Both pre_download and scrape_track are making Credit Mining over complex. Ideally it should directly take the swarm size information from Tribler core instead of registering a lot of callback chains and looping calls to get it by itself. Let's Mr. Ma's swarm size function is quite a savior for making Credit Mining great again.
Assume: just as popular as Bitcoin mining and as much talked about as FileCoin.
Next meeting: what are the thesis experiments (Kodi-to-Kodi, credit mining servers, or superior policies)?
Current issues with the code:
Log 24/10/2017: I just had a discussion on seeding polices with @synctext . @synctest suggested that we should try to download and seed several pieces for all the torrents, and pick the best performing ones. With no measurement on the real performance as for this policy, by impression, I would say it is not good idea. It will take extremely long time to user, especially a private user to get a full traversal through all the torrents. Even for the "enterprise users", since the "testing time" for each torrent need to be quite short, the result will have much noise caused by connection problems. Also, since a single traversal will take so long time, it will not be timeliness. Also having a long swarm selection interval is against Mihai's experiment result.
My idea of implementing the new policy is that, we do more measurements offline, without adding more trouble to the users and Tribler code itself. My plan of getting the policy is as follows:
OK. Please focus on a realistic and simple credit mining setting: manage a channel with 1000 swarms.
Please focus on maximizing the upload for 1000 swarms and not think at all about 10k swarm channels in this thesis work. One new policy to evaluate first: no-model-policy. Test for 24 hours for performance. Approach:
Methodology: estimate 3 good values for parameters X,Y, Z. Test performance for each parameter in an separate experiment.
Other policies to compare:
New related work to describe: Orchid: a new surveillance-free layer on top of the existing Internet
First implementation ready of no-model-policy, still randomly crashes. Working with @xoriole for dedicated Jenkins task to execute the test from the credit-mining Git branch. Create own channel, fill with 1000 random swarms. Possible approach: first do single measurement, then code cleanup and do thesis measurements. Problem: we can remove ineffective policies and cleaner code with a single policy.
ToDo: post seeding in time of 10 hand-picked swarms using no-model-policy from laptop
Has spent a week on getting a test channel of 2000 torrent files (not merely magnet links). Might do extensive cleanup of all policies which pollute the architecture with pre-downloading and other unneeded complexity? Would be easier to fix and get stable? ToDo:
Progress update: works! downloading many GBytes and uploading few MBytes. Please push your latest branch today...
Try out a new branch with even more extreme idea then no-model-policy called "zero-thinking-policy". It leaves everything to Libtorrent. Key scientific challenge is doing performance analysis with the wealth of possible parameter settings. All tested in the wild. Try with 250 swarms at first. Understand dead-swarm problem. Try to preserve start_download() of Tribler API, trivial to add anonymous downloads.
seeding a million torrents with bittorrent
libtorrent supports setting separate limits for different announce methods. That is, making the x top
torrents announce to trackers, the y top torrents announce to the DHT, the z top torrents announce to
local peer discovery. Using this feature, all torrents could always be running, just not necessarily
announce.
Instead of scraping torrents to find their rank, just announce to them instead.
This would mean all torrents always allows peer connections. All torrents are not necessarily announcing
to their trackers every 30 minutes, but do announce every now and then, round-robin with all the other
torrents that aren’t announcing regularly.
Never stopping a torrent might significantly improve availability and longevity of content in bittorrent
networks.
plus the default simple seeding rotation setting
Auto managed seeding torrents are rotated, so that all of them are allocated a fair amount of seeding.
Torrents with fewer completed seed cycles are prioritized for seeding. A seed cycle is completed when a
torrent meets either the share ratio limit (uploaded bytes / downloaded bytes), the share time ratio (time
seeding / time downloaing) or seed time limit (time seeded).
The relevant settings to control these limits are share_ratio_limit, seed_time_ratio_limit and
seed_time_limit in session_settings.
After this thesis project: disk management (download to max, selectively replace)
The new code pushed. https://github.com/EinNarr/tribler/tree/CreditMining_operation
Main change log: Removed the scoring policy. Removed the pre-download function Better OOP code style Simplified callback chains. Replace the "looping registered looping calls" with a state callback Replace the mysterious torrent dictionary with a dictionary of torrent objects Change the way policy is defined to make it more modular
@egbertbouman @devos50 Could you please help me a bit review the code when you are free?
What is not yet done with the code: The code is not 100% bug free and there is still debugging loggers within. The unit test seriously outdated The policy is not yet efficient If time is enough, a simple graphic indicator for CM and a flag to differ and protect the mining task with normal download task.
Concern: Tribler session reports upload/download speed with the "raw total speed" instead of only payload speed. Would payload speed be more accurate in the cases?
good to see your progress! please focus on the 3 thesis experiments and stability of the code.
Tested with top 100 torrents (99 actually). The test lasted around 1260 seconds, with 48 MB payload upload and 38.5 GB download. 127.5 MB upload and 39.7 GB upload in total. The problem of the popular torrents is that nearly all of them are seriously overseeded (times more seeders than leechers). Hardly any torrent is offering a good potential. I did 2 tests during the new year vacation on the 2000 "random"(all torrents from a certain period of time) torrents I used before. It uploaded 246.8 MB payload in 2220 seconds with 39 GB download. Which is not sweet enough, but at least better. Seems not obvious difference from popular torrents. The performance is better than the previous test. It might thank to the "directly discard non-active torrent" feature is now implemented.
Please finish your simple first 2 experiments first and create several pages of your thesis chapter "experiments and performance analysis" Simple local experiments without external wild swarms. Simple validation experiments to show the reader that such simple experiments have the easy to understand outcome. Moderate experiment: create a channel with 10-ish swarms. Still simple low and high seeders (1 or 2). Selects underseeded and then eventually all 10 swarms. Concrete final experiment: channel with 25 only underseeded swarms in a single channel and plot the upload effectiveness.
what is a good experiment to validate credit mining? current status: worked on wild-swarm experiment. Stable for 5 days, then stopped logging, error reporting, and general functioning.
Micro-economy publications, presented recently at the Delft Blockchain Launch event:
Next meeting: guaranteed upload-in-time graphs; posted to this issue.
25 hand-picked wild swarms experiment completed for several hours. log file: timestamp, up/down amount. Please stop all coding! Make upload/performance graphs, write thesis.
Thesis: https://www.overleaf.com/11564983rgtdjxxkzxjk#/43740667/ Still under construction, far from complete.
Some figures from the experiment: CPU usage, always 0.0% Memory usage, keeps increasing, probably because of increasing tasks: Upload vs payload upload, looks good on popular torrents: download vs upload, still not satisfying, around 1:1.
Great progress with the graphs!
https://en.wikipedia.org/wiki/Tragedy_of_the_commons First chapter possible storyline: freeriding prevention by creating a token system, full token economy. This thesis present a key building block. Please do not fill your thesis with CMS everywhere, just call it credit mining (will not cost 1 extra page, but really boost readability). Please polish your thesis, focus on experiments sections, and present the simple validation experiments... Leave the final experiment data open, you now have graphs. My advise is to really focus on finishing all 3 simple experiments and have 6-ish polished thesis pages in Experiments chapter.
We run this experiment on the test machine for roughly 53 hours.
Just show a plot where there are 0 seeders, 1 seeder, added to channel at time X, start credit mine, becomes 2 seeders after Z seconds. Plot the 5+ events in time (X-axis) and number of seeders, (Y-axis). Total experiment should only be a few seconds. No wild swarm! Do a hard-coded add_peer()
if needed. Timeline picture example (with lot of colors):
We fetched 7 different torrents from a tracker on the Internet, of them 3 are newly uploaded and under-seeded torrents, others are either balanced or over-seeded.
Please create a clean and simple 2nd experiment. No wild swarms, see descriptions of 18 Jan and others. Just seed local libtorrent instance, for instance, and hard-code IPv4.
Experiment: testing the upload and active leechers in credit mining policy. Evaluation period is currently 5 minutes. Again we have 10 swarms in a channel. Each are seeded only by 1 seeder (Libtorrent trick). Experiment starts, introduces leechers which download merely 10MByte. Half of the swarms are downloaded by nobody, half of the swarms are downloaded. Show that unpopular swarms are kicked by your policy. Problem: there is a seeder+credit mining seeder; leecher should download something from credit miner.
Other: dead swarm and wild swarm experiments. Again, please ignore the total performance of credit mining in wild swarm.
Experiments:
Your thesis work is nearly complete, how to get the graphs quickly...
You are very much invited to take shortcuts for the validation experiments, like setting bandwidth limits. Another one is showing a different policy. If you're policy is not suitable for them, you can simply implement a trivial policy of preferring big swarms. Reacting to total swarm size. Then in experiment 4, you intoduce your more complex policy and compare them both. We can talk more on Monday.
conducted experiment:
connect_peer()
does not seem to function.The curve and bar chart of times each swarm is joined by Credit Mining during the 30 minutes test(71 minutes in fact, since the result is too ideal, to better show the curve, I cut out the first 30 minutes) The curve and bar chart of times each swarm is selected by Credit Mining.
These experiments are done with 100KB/s upload speed limit and 200KB/s download speed limit on the fake seeder/leecher side.
swarm_1-2: 3 seeders 3 leechers swarm_3-5: 3 seeders 1 leecher swarm_6-8: 1 seeder 3 leechers swarm_9-10:0 seeder 3 leecher
Remarks:
settings_pack::allow_multiple_connections_per_ip
As simple as possible: create 1 random swarm, seed, create channel with that single swarm, start credit mining, now 2 seeders, happy!
.
Thesis_65%.pdf This is the half finished thesis with most of the problem description, system design explanation. Half of the experiment. and leak of introduction.
Next step, please focus fully on experiment description of your final thesis chapter.
Simple experiments with 1 leecher, for instance, which explain your mechanism.
Thesis update. Thesis_0614.pdf
For an interesting intro perspective what if Bittorrent had a token?
We talked a lot about the concept of simplicity. Both experiments and algorithms need to be simple, otherwise it's impossible to get a Youtube-level service operational for 2 billion people. I'm not aware of any theoretical grounding for the need for simplicity. However, complexity often does not scale, it breaks. Thus the best-practice in the field of self-organising systems is: simplicity.
Simple experiments in a thesis can be easily understood and should scale. Meaning, it should even work with the insane usage-level of Youtube-like service: 2 billion monthly active users. </rant>
Figure 9: Differences in propagation speed in an overlay consisting of 1000 nodes.
Demers 1 and 11 show the theoretical performance of a random overlay based on
epidemic theory, Emulation 1 and 11 show the actual performance of our overlay.
Dispersy bundle synchronisation for the spreading speed of broadcasts by an epidemic protocol (Figure 9).
Please add the trivial validation experiment we talked about. It has such ridiculous simplicity it's difficult to make a graph out of it. Validation experiment. Shows (a) create 1 channel with two swarms; with 1 seeder each and (b) credit mining is started and a random swam is joined, resulting in 1 swarm with 2 seeders
The second experiment: moderate experiment: create 1 channel with 10-ish swarms. Each swarm has either 1 seeder or 2 seeders. Thus still a most-trivial-possible experiment with simple low and high seeders (1 or 2). Five swarms with one seeder and five swarms with two seeders. The policy should invest the credit mining disk space into underseeded swarms.
Discussing of your policy Likewise, we select a certain of amount of swarms to investigate according their prior performance and several other swarms randomly to constantly keep the vitality of Credit Mining.
Just be more direct and to the point: our vitality policy is based on very simple principle of a feedback loop driven by income earning ability of a swarm (e.g. upload performance). The vitality policy: randomly selects a number of swarms (parameter X), monitor the income from this swarm for a limited amount of time, periodically evaluate and compare the income earned from each swarm, remove the lowest earning swarms (if not credit mining maximum amount of swarms yet, parameter Y), and repeats this cycle endlessly.
@EinNarr Just talked to Johan about your experiments, and you're very much invited to compare multiple policies in your thesis. The torrents in your experiment can just be synthetic. No need to use wild swarms. This avoids your problems with many overseeded swarms.
Explore different parameter settings & experiments:
One of the Gumby scenario files: https://github.com/ardhipoetra/gumby/blob/0f860dcad94a59324b1a80d946977b4344731fb3/experiments/tribler/channel_download.scenario
You can check out this PR: https://github.com/Tribler/gumby/pull/282
Roadmap to graduation still remains unclear. Starting from refining the test frame work which had already been used in the 10 torrents 1 channel experiment.
Experiments done outside Tribler till now.
Some thoughts about the 4th policy. This is the share ratio vs. number of torrents graph The X-axis is upload/download ratio, Y-axis is number of torrents. The curve is the number of torrents have same or better ratio than its X-coordinate. Bar chart is the number of torrent have upload/download ratio no worse than its X-coordinate, but worse than the next ratio on the X-axis. The blue bar is for all the torrent, and the orange is for the "promoted(limit to 250MB) torrents. There should have been a three color on bar chart for “super promoted(limit to 1GB)", but as far as I observed, there is no torrent with more than 120MB download.
It could be that no torrent is ever super-promoted, or only small torrents less than 120MB are super-promoted. Details will be determined after the newest data is revealed tomorrow.
Very impressive thesis material!
Please focus on your thesis writing and storyline now. Stop working on graphs and data processing. Proposed storyline.
We present in this chapter the experiments we conducted around credit mining investments with the following scientific topics:
Another latest version of PDF and an interesting percentage change of total download of each category. credit-mining.pdf
Plus this remark: "the link to his code added to the thesis (in the spirit of reproducibility)."
Thesis is not in good shape yet sadly. Detailed remarks:
Summary of suggested changes after a discussion between Przemyslaw Pawelczak and Bohao Zhang on 28 September 2018, 10:30 TU Delft
Related work on Delft University credit mining:
A live screenshot of token mining running multi-level policy
After years of effort, we finally have an operational credit mining strategy. Now it actually generates tokens as well 😃
Get a working performance analysis environment. Goal: ability to make pretty graphs locally with both credit mining and multichain (two different branches). Task: make an Ubuntu channel or other large validated legal collection, with actual "from the wild" downloads. This environment will be expanded over coming months.
part of #23. ToDo: read "tragedy of the commons" paper, 1968 problem.
Strategy: Till end of Feb focus on credit mining, then include relaying bandwidth to avoid too much complexity at the start. Next sprint: co-investor detection?