diff options
-rw-r--r-- | src/fs/fs.conf.in | 21 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 28 |
2 files changed, 40 insertions, 9 deletions
diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in index cac59e5cb..cb1c80c70 100644 --- a/src/fs/fs.conf.in +++ b/src/fs/fs.conf.in | |||
@@ -12,19 +12,40 @@ BINARY = gnunet-service-fs | |||
12 | ACCEPT_FROM = 127.0.0.1; | 12 | ACCEPT_FROM = 127.0.0.1; |
13 | ACCEPT_FROM6 = ::1; | 13 | ACCEPT_FROM6 = ::1; |
14 | 14 | ||
15 | # Do we introduce artificial delays? (may improve anonymity) | ||
15 | DELAY = YES | 16 | DELAY = YES |
17 | |||
18 | # Do we cache content from other nodes? (may improve anonymity) | ||
16 | CONTENT_CACHING = YES | 19 | CONTENT_CACHING = YES |
20 | |||
21 | # Do we send unsolicited data to other nodes if we have excess bandwidth? | ||
22 | # (may improve anonymity, probably not a good idea if content_caching is NO) | ||
17 | CONTENT_PUSHING = YES | 23 | CONTENT_PUSHING = YES |
18 | 24 | ||
19 | UNIXPATH = /tmp/gnunet-service-fs.sock | 25 | UNIXPATH = /tmp/gnunet-service-fs.sock |
26 | |||
27 | # Do we require users that want to access file-sharing to run this process | ||
28 | # (usually not a good idea) | ||
20 | UNIX_MATCH_UID = NO | 29 | UNIX_MATCH_UID = NO |
30 | |||
31 | # Do we require users that want to access file-sharing to be in the 'gnunet' group? | ||
21 | UNIX_MATCH_GID = YES | 32 | UNIX_MATCH_GID = YES |
22 | # DEBUG = YES | 33 | # DEBUG = YES |
34 | |||
35 | # Maximum number of requests this peer tracks (important for | ||
36 | # memory consumption) | ||
23 | MAX_PENDING_REQUESTS = 65536 | 37 | MAX_PENDING_REQUESTS = 65536 |
38 | |||
39 | # How many requests do we have at most waiting in the queue towards | ||
40 | # the datastore? (important for memory consumption) | ||
41 | DATASTORE_QUEUE_SIZE = 1024 | ||
42 | |||
24 | # Maximum frequency we're allowed to poll the datastore | 43 | # Maximum frequency we're allowed to poll the datastore |
25 | # for content for migration (can be used to reduce | 44 | # for content for migration (can be used to reduce |
26 | # GNUnet's disk-IO rate) | 45 | # GNUnet's disk-IO rate) |
27 | MIN_MIGRATION_DELAY = 100 ms | 46 | MIN_MIGRATION_DELAY = 100 ms |
47 | |||
48 | # For how many neighbouring peers should we allocate hash maps? | ||
28 | EXPECTED_NEIGHBOUR_COUNT = 128 | 49 | EXPECTED_NEIGHBOUR_COUNT = 128 |
29 | 50 | ||
30 | # Enable monkey? | 51 | # Enable monkey? |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index cfab966bc..4f94518df 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -52,6 +52,11 @@ | |||
52 | #define MAX_RESULTS (100 * 1024) | 52 | #define MAX_RESULTS (100 * 1024) |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Collect an instane number of statistics? May cause excessive IPC. | ||
56 | */ | ||
57 | #define INSANE_STATISTICS GNUNET_NO | ||
58 | |||
59 | /** | ||
55 | * An active request. | 60 | * An active request. |
56 | */ | 61 | */ |
57 | struct GSF_PendingRequest | 62 | struct GSF_PendingRequest |
@@ -283,9 +288,11 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
283 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 288 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
284 | "Creating request handle for `%s' of type %d\n", | 289 | "Creating request handle for `%s' of type %d\n", |
285 | GNUNET_h2s (query), type); | 290 | GNUNET_h2s (query), type); |
291 | #if INSANE_STATISTICS | ||
286 | GNUNET_STATISTICS_update (GSF_stats, | 292 | GNUNET_STATISTICS_update (GSF_stats, |
287 | gettext_noop ("# Pending requests created"), 1, | 293 | gettext_noop ("# Pending requests created"), 1, |
288 | GNUNET_NO); | 294 | GNUNET_NO); |
295 | #endif | ||
289 | extra = 0; | 296 | extra = 0; |
290 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type) | 297 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type) |
291 | extra += sizeof (struct GNUNET_HashCode); | 298 | extra += sizeof (struct GNUNET_HashCode); |
@@ -1183,10 +1190,12 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size, | |||
1183 | pr->qe = NULL; | 1190 | pr->qe = NULL; |
1184 | if (NULL == key) | 1191 | if (NULL == key) |
1185 | { | 1192 | { |
1193 | #if INSANE_STATISTICS | ||
1186 | GNUNET_STATISTICS_update (GSF_stats, | 1194 | GNUNET_STATISTICS_update (GSF_stats, |
1187 | gettext_noop | 1195 | gettext_noop |
1188 | ("# Datastore lookups concluded (no results)"), | 1196 | ("# Datastore lookups concluded (no results)"), |
1189 | 1, GNUNET_NO); | 1197 | 1, GNUNET_NO); |
1198 | #endif | ||
1190 | } | 1199 | } |
1191 | if (GNUNET_NO == pr->have_first_uid) | 1200 | if (GNUNET_NO == pr->have_first_uid) |
1192 | { | 1201 | { |
@@ -1218,12 +1227,14 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size, | |||
1218 | { | 1227 | { |
1219 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 1228 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
1220 | "No further local responses available.\n"); | 1229 | "No further local responses available.\n"); |
1230 | #if INSANE_STATISTICS | ||
1221 | if ((pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK) || | 1231 | if ((pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK) || |
1222 | (pr->public_data.type == GNUNET_BLOCK_TYPE_FS_IBLOCK)) | 1232 | (pr->public_data.type == GNUNET_BLOCK_TYPE_FS_IBLOCK)) |
1223 | GNUNET_STATISTICS_update (GSF_stats, | 1233 | GNUNET_STATISTICS_update (GSF_stats, |
1224 | gettext_noop | 1234 | gettext_noop |
1225 | ("# requested DBLOCK or IBLOCK not found"), 1, | 1235 | ("# requested DBLOCK or IBLOCK not found"), 1, |
1226 | GNUNET_NO); | 1236 | GNUNET_NO); |
1237 | #endif | ||
1227 | goto check_error_and_continue; | 1238 | goto check_error_and_continue; |
1228 | } | 1239 | } |
1229 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1240 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1434,9 +1445,11 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
1434 | pr->warn_task = | 1445 | pr->warn_task = |
1435 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, | 1446 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, |
1436 | pr); | 1447 | pr); |
1448 | #if INSANE_STATISTICS | ||
1437 | GNUNET_STATISTICS_update (GSF_stats, | 1449 | GNUNET_STATISTICS_update (GSF_stats, |
1438 | gettext_noop ("# Datastore lookups initiated"), 1, | 1450 | gettext_noop ("# Datastore lookups initiated"), 1, |
1439 | GNUNET_NO); | 1451 | GNUNET_NO); |
1452 | #endif | ||
1440 | pr->qe = | 1453 | pr->qe = |
1441 | GNUNET_DATASTORE_get_key (GSF_dsh, pr->local_result_offset++, | 1454 | GNUNET_DATASTORE_get_key (GSF_dsh, pr->local_result_offset++, |
1442 | &pr->public_data.query, | 1455 | &pr->public_data.query, |
@@ -1602,7 +1615,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1602 | void | 1615 | void |
1603 | GSF_pending_request_init_ () | 1616 | GSF_pending_request_init_ () |
1604 | { | 1617 | { |
1605 | unsigned long long bps; | 1618 | unsigned long long dqs; |
1606 | 1619 | ||
1607 | if (GNUNET_OK != | 1620 | if (GNUNET_OK != |
1608 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, "fs", | 1621 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, "fs", |
@@ -1613,17 +1626,14 @@ GSF_pending_request_init_ () | |||
1613 | "fs", "MAX_PENDING_REQUESTS"); | 1626 | "fs", "MAX_PENDING_REQUESTS"); |
1614 | } | 1627 | } |
1615 | if (GNUNET_OK != | 1628 | if (GNUNET_OK != |
1616 | GNUNET_CONFIGURATION_get_value_size (GSF_cfg, "ats", "WAN_QUOTA_OUT", | 1629 | GNUNET_CONFIGURATION_get_value_size (GSF_cfg, "fs", "DATASTORE_QUEUE_SIZE", |
1617 | &bps)) | 1630 | &dqs)) |
1618 | { | 1631 | { |
1619 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO, | 1632 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO, |
1620 | "ats", "WAN_QUOTA_OUT"); | 1633 | "fs", "DATASTORE_QUEUE_SIZE"); |
1621 | bps = 65536; | 1634 | dqs = 1024; |
1622 | } | 1635 | } |
1623 | /* queue size should be #queries we can have pending and satisfy within | 1636 | datastore_queue_size = (unsigned int) dqs; |
1624 | * a carry interval: */ | ||
1625 | datastore_queue_size = | ||
1626 | bps * GNUNET_CONSTANTS_MAX_BANDWIDTH_CARRY_S / DBLOCK_SIZE; | ||
1627 | 1637 | ||
1628 | active_to_migration = | 1638 | active_to_migration = |
1629 | GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "FS", "CONTENT_CACHING"); | 1639 | GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "FS", "CONTENT_CACHING"); |