aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-10-20 13:55:28 +0000
committerChristian Grothoff <christian@grothoff.org>2010-10-20 13:55:28 +0000
commit1b1a570e19e1436618088ea8a1cccd0cec9f181a (patch)
tree6c6566c9b1ba4b23179d2a4909d142ce861421fc /src/fs/gnunet-service-fs.c
parent87dfec2d1ab5b212840906fead33a50ea3a6a95e (diff)
downloadgnunet-1b1a570e19e1436618088ea8a1cccd0cec9f181a.tar.gz
gnunet-1b1a570e19e1436618088ea8a1cccd0cec9f181a.zip
finding causes
Diffstat (limited to 'src/fs/gnunet-service-fs.c')
-rw-r--r--src/fs/gnunet-service-fs.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 95b000778..add1814b4 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -47,8 +47,15 @@
47 * Should we introduce random latency in processing? Required for proper 47 * Should we introduce random latency in processing? Required for proper
48 * implementation of GAP, but can be disabled for performance evaluation of 48 * implementation of GAP, but can be disabled for performance evaluation of
49 * the basic routing algorithm. 49 * the basic routing algorithm.
50 *
51 * Note that with delays enabled, performance can be significantly lower
52 * (several orders of magnitude in 2-peer test runs); if you want to
53 * measure throughput of other components, set this to NO. Also, you
54 * might want to consider changing 'RETRY_PROBABILITY_INV' to 1 for
55 * a rather wasteful mode of operation (that might still get the highest
56 * throughput overall).
50 */ 57 */
51#define SUPPORT_DELAYS GNUNET_NO 58#define SUPPORT_DELAYS GNUNET_YES
52 59
53/** 60/**
54 * Size for the hash map for DHT requests from the FS 61 * Size for the hash map for DHT requests from the FS
@@ -73,6 +80,15 @@
73 * repeatedly recently, the probability is multiplied by the inverse 80 * repeatedly recently, the probability is multiplied by the inverse
74 * of this number each time. Note that we only try about every TTL_DECREMENT/2 81 * of this number each time. Note that we only try about every TTL_DECREMENT/2
75 * plus MAX_CORK_DELAY (so roughly every 3.5s). 82 * plus MAX_CORK_DELAY (so roughly every 3.5s).
83 *
84 * Note that this factor is a key influence to performance in small
85 * networks (especially test networks of 2 peers) because if there is
86 * only a single peer with the data, this value will determine how
87 * soon we might re-try. For example, a value of 3 can result in
88 * 1.7 MB/s transfer rates for a 10 MB file when a value of 1 would
89 * give us 5 MB/s. OTOH, obviously re-trying the same peer can be
90 * rather inefficient in larger networks, hence picking 1 is in
91 * general not the best choice.
76 */ 92 */
77#define RETRY_PROBABILITY_INV 3 93#define RETRY_PROBABILITY_INV 3
78 94
@@ -86,8 +102,9 @@
86#define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45) 102#define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45)
87 103
88/** 104/**
89 * Maximum number of requests (from other peers) that we're 105 * Maximum number of requests (from other peers, overall) that we're
90 * willing to have pending at any given point in time. 106 * willing to have pending at any given point in time. Can be changed
107 * via the configuration file (32k is just the default).
91 */ 108 */
92static unsigned long long max_pending_requests = (32 * 1024); 109static unsigned long long max_pending_requests = (32 * 1024);
93 110
@@ -3704,7 +3721,11 @@ process_local_reply (void *cls,
3704 return; 3721 return;
3705 } 3722 }
3706 } 3723 }
3707 3724 if (pr->local_only == GNUNET_YES)
3725 {
3726 destroy_pending_request (pr);
3727 return;
3728 }
3708 /* no more results */ 3729 /* no more results */
3709 if (pr->task == GNUNET_SCHEDULER_NO_TASK) 3730 if (pr->task == GNUNET_SCHEDULER_NO_TASK)
3710 pr->task = GNUNET_SCHEDULER_add_now (sched, 3731 pr->task = GNUNET_SCHEDULER_add_now (sched,
@@ -3775,6 +3796,7 @@ process_local_reply (void *cls,
3775 return; /* done here */ 3796 return; /* done here */
3776 if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST) 3797 if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST)
3777 { 3798 {
3799 pr->local_only = GNUNET_YES; /* do not forward */
3778 GNUNET_DATASTORE_get_next (dsh, GNUNET_NO); 3800 GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
3779 return; 3801 return;
3780 } 3802 }
@@ -3790,8 +3812,12 @@ process_local_reply (void *cls,
3790 gettext_noop ("# processing result set cut short due to load"), 3812 gettext_noop ("# processing result set cut short due to load"),
3791 1, 3813 1,
3792 GNUNET_NO); 3814 GNUNET_NO);
3815 /* FIXME: if this is activated, we might stall large downloads
3816 indefinitely since (presumably) the load can never go down again! */
3817#if 0
3793 GNUNET_DATASTORE_get_next (dsh, GNUNET_NO); 3818 GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
3794 return; 3819 return;
3820#endif
3795 } 3821 }
3796 GNUNET_DATASTORE_get_next (dsh, GNUNET_YES); 3822 GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
3797} 3823}
@@ -4015,7 +4041,10 @@ handle_p2p_get (void *cls,
4015 /* don't have BW to send to peer, or would likely take longer than we have for it, 4041 /* don't have BW to send to peer, or would likely take longer than we have for it,
4016 so at best indirect the query */ 4042 so at best indirect the query */
4017 priority = 0; 4043 priority = 0;
4018 pr->forward_only = GNUNET_YES; 4044 /* FIXME: if this line is enabled, the 'perf' test for larger files simply "hangs";
4045 the cause seems to be that the load goes up (to the point where we do this)
4046 and then never goes down again... (outch) */
4047 // pr->forward_only = GNUNET_YES;
4019 } 4048 }
4020 pr->type = type; 4049 pr->type = type;
4021 pr->mingle = ntohl (gm->filter_mutator); 4050 pr->mingle = ntohl (gm->filter_mutator);
@@ -4166,7 +4195,13 @@ handle_p2p_get (void *cls,
4166 case GNUNET_BLOCK_TYPE_FS_IBLOCK: 4195 case GNUNET_BLOCK_TYPE_FS_IBLOCK:
4167 /* only one result, wait for datastore */ 4196 /* only one result, wait for datastore */
4168 if (GNUNET_YES != pr->forward_only) 4197 if (GNUNET_YES != pr->forward_only)
4169 break; 4198 {
4199 GNUNET_STATISTICS_update (stats,
4200 gettext_noop ("# requests not instantly forwarded (waiting for datastore)"),
4201 1,
4202 GNUNET_NO);
4203 break;
4204 }
4170 default: 4205 default:
4171 if (pr->task == GNUNET_SCHEDULER_NO_TASK) 4206 if (pr->task == GNUNET_SCHEDULER_NO_TASK)
4172 pr->task = GNUNET_SCHEDULER_add_now (sched, 4207 pr->task = GNUNET_SCHEDULER_add_now (sched,