gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24475 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r24475 - gnunet/src/fs
Date: Tue, 23 Oct 2012 15:33:45 +0200

Author: grothoff
Date: 2012-10-23 15:33:44 +0200 (Tue, 23 Oct 2012)
New Revision: 24475

Modified:
   gnunet/src/fs/fs.conf.in
   gnunet/src/fs/gnunet-service-fs_pr.c
Log:
-make datastore queue longer, and length configurable, reduce statistics (#2594)

Modified: gnunet/src/fs/fs.conf.in
===================================================================
--- gnunet/src/fs/fs.conf.in    2012-10-23 13:33:13 UTC (rev 24474)
+++ gnunet/src/fs/fs.conf.in    2012-10-23 13:33:44 UTC (rev 24475)
@@ -12,19 +12,40 @@
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 
+# Do we introduce artificial delays? (may improve anonymity)
 DELAY = YES
+
+# Do we cache content from other nodes? (may improve anonymity)
 CONTENT_CACHING = YES
+
+# Do we send unsolicited data to other nodes if we have excess bandwidth?
+# (may improve anonymity, probably not a good idea if content_caching is NO)
 CONTENT_PUSHING = YES
 
 UNIXPATH = /tmp/gnunet-service-fs.sock
+
+# Do we require users that want to access file-sharing to run this process 
+# (usually not a good idea)
 UNIX_MATCH_UID = NO
+
+# Do we require users that want to access file-sharing to be in the 'gnunet' 
group?
 UNIX_MATCH_GID = YES
 # DEBUG = YES
+
+# Maximum number of requests this peer tracks (important for
+# memory consumption)
 MAX_PENDING_REQUESTS = 65536
+
+# How many requests do we have at most waiting in the queue towards
+# the datastore? (important for memory consumption)
+DATASTORE_QUEUE_SIZE = 1024
+
 # Maximum frequency we're allowed to poll the datastore
 # for content for migration (can be used to reduce 
 # GNUnet's disk-IO rate)
 MIN_MIGRATION_DELAY = 100 ms
+
+# For how many neighbouring peers should we allocate hash maps?
 EXPECTED_NEIGHBOUR_COUNT = 128
 
 # Enable monkey?

Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c        2012-10-23 13:33:13 UTC (rev 
24474)
+++ gnunet/src/fs/gnunet-service-fs_pr.c        2012-10-23 13:33:44 UTC (rev 
24475)
@@ -52,6 +52,11 @@
 #define MAX_RESULTS (100 * 1024)
 
 /**
+ * Collect an instane number of statistics?  May cause excessive IPC.
+ */
+#define INSANE_STATISTICS GNUNET_NO
+
+/**
  * An active request.
  */
 struct GSF_PendingRequest
@@ -283,9 +288,11 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Creating request handle for `%s' of type %d\n",
               GNUNET_h2s (query), type);
+#if INSANE_STATISTICS
   GNUNET_STATISTICS_update (GSF_stats,
                             gettext_noop ("# Pending requests created"), 1,
                             GNUNET_NO);
+#endif
   extra = 0;
   if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type)
     extra += sizeof (struct GNUNET_HashCode);
@@ -1183,10 +1190,12 @@
     pr->qe = NULL;
     if (NULL == key)
     {
+#if INSANE_STATISTICS
       GNUNET_STATISTICS_update (GSF_stats,
                                 gettext_noop
                                 ("# Datastore lookups concluded (no results)"),
                                 1, GNUNET_NO);
+#endif
     }
     if (GNUNET_NO == pr->have_first_uid)
     {
@@ -1218,12 +1227,14 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
                 "No further local responses available.\n");
+#if INSANE_STATISTICS
     if ((pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK) ||
         (pr->public_data.type == GNUNET_BLOCK_TYPE_FS_IBLOCK))
       GNUNET_STATISTICS_update (GSF_stats,
                                 gettext_noop
                                 ("# requested DBLOCK or IBLOCK not found"), 1,
                                 GNUNET_NO);
+#endif
     goto check_error_and_continue;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1434,9 +1445,11 @@
   pr->warn_task =
       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task,
                                     pr);
+#if INSANE_STATISTICS
   GNUNET_STATISTICS_update (GSF_stats,
                             gettext_noop ("# Datastore lookups initiated"), 1,
                             GNUNET_NO);
+#endif
   pr->qe =
       GNUNET_DATASTORE_get_key (GSF_dsh, pr->local_result_offset++,
                                 &pr->public_data.query,
@@ -1602,7 +1615,7 @@
 void
 GSF_pending_request_init_ ()
 {
-  unsigned long long bps;
+  unsigned long long dqs;
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (GSF_cfg, "fs",
@@ -1613,17 +1626,14 @@
                               "fs", "MAX_PENDING_REQUESTS");
   }
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_size (GSF_cfg, "ats", "WAN_QUOTA_OUT",
-                                           &bps))
+      GNUNET_CONFIGURATION_get_value_size (GSF_cfg, "fs", 
"DATASTORE_QUEUE_SIZE",
+                                           &dqs))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO,
-                              "ats", "WAN_QUOTA_OUT");
-    bps = 65536;
+                              "fs", "DATASTORE_QUEUE_SIZE");
+    dqs = 1024;
   }
-  /* queue size should be #queries we can have pending and satisfy within
-   * a carry interval: */
-  datastore_queue_size =
-      bps * GNUNET_CONSTANTS_MAX_BANDWIDTH_CARRY_S / DBLOCK_SIZE;
+  datastore_queue_size = (unsigned int) dqs;
 
   active_to_migration =
       GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "FS", "CONTENT_CACHING");




reply via email to

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