gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: optimize queue-full case, r


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: optimize queue-full case, reduce max queue size due to O(n) operation
Date: Thu, 23 Feb 2017 15:32:07 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 427b846c6 optimize queue-full case, reduce max queue size due to O(n) 
operation
427b846c6 is described below

commit 427b846c6c52194e5246bc913c65ac632f54f604
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Feb 23 15:32:06 2017 +0100

    optimize queue-full case, reduce max queue size due to O(n) operation
---
 src/datastore/datastore_api.c | 11 +++++++++++
 src/fs/fs.conf.in             |  2 +-
 src/fs/gnunet-service-fs.c    |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index 311a61283..b2fc18947 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -498,6 +498,17 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h,
   struct GNUNET_DATASTORE_QueueEntry *pos;
   unsigned int c;
 
+  if ( (h->queue_size == max_queue_size) &&
+       (h->queue_tail->priority >= queue_priority) )
+  {
+    GNUNET_STATISTICS_update (h->stats,
+                              gettext_noop ("# queue overflows"),
+                              1,
+                              GNUNET_NO);
+    GNUNET_MQ_discard (env);
+    return NULL;
+  }
+
   c = 0;
   pos = h->queue_head;
   while ( (NULL != pos) &&
diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in
index 3534378ae..d46de387f 100644
--- a/src/fs/fs.conf.in
+++ b/src/fs/fs.conf.in
@@ -36,7 +36,7 @@ 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
+DATASTORE_QUEUE_SIZE = 32
 
 # Maximum frequency we're allowed to poll the datastore
 # for content for migration (can be used to reduce
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 8c605c6a2..256d0c2b8 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -1349,7 +1349,7 @@ run (void *cls,
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO,
                               "fs",
                                "DATASTORE_QUEUE_SIZE");
-    dqs = 1024;
+    dqs = 32;
   }
   GSF_datastore_queue_size = (unsigned int) dqs;
   GSF_enable_randomized_delays =

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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