#include "gnunet_constants.h"
#include "gnunet_datastore_service.h"
+#include "gnunet_dht_service.h"
#include "gnunet_fs_service.h"
#include "gnunet_block_lib.h"
#include "block_fs.h"
+
+/**
+ * Maximum number of outgoing messages we queue per peer.
+ *
+ * Performance measurements for 2 peer setup for 50 MB file
+ * (with MAX_DATASTORE_QUEUE = 1 and RETRY_PROBABILITY_INV = 1):
+ *
+ * 2: 1700 kb/s, 1372 kb/s
+ * 8: 2117 kb/s, 1284 kb/s, 1112 kb/s
+ * 16: 3500 kb/s, 3200 kb/s, 3388 kb/s
+ * 32: 3441 kb/s, 3163 kb/s, 3277 kb/s
+ * 128: 1700 kb/s; 2010 kb/s, 3383 kb/s, 1156 kb/s
+ *
+ * Conclusion: 16 seems to be a pretty good value (stable
+ * and high performance, no excessive memory use).
+ */
+#define MAX_QUEUE_PER_PEER 16
+
/**
* Maximum size of the datastore queue for P2P operations.
+ * Needs to be large enough to queue MAX_QUEUE_PER_PEER
+ * operations for roughly the number of active (connected)
+ * peers.
*/
-#define MAX_DATASTORE_QUEUE 16
+#define MAX_DATASTORE_QUEUE (16 * MAX_QUEUE_PER_PEER)
/**
* Maximum number of blocks we keep in memory for migration.
* be more efficient but will be more disruptive
* as far as the scheduler is concerned.
*/
-#define HASHING_BLOCKSIZE (1024 * 1024)
+#define HASHING_BLOCKSIZE (1024 * 128)
/**
* Number of bits we set per entry in the bloomfilter.
* Do not change!
*/
-#define BLOOMFILTER_K 16
+#define BLOOMFILTER_K GNUNET_DHT_GET_BLOOMFILTER_K
/**
* Number of availability trials we perform per search result.
*/
#define AVAILABILITY_TRIALS_MAX 8
-/**
- * By how much (in ms) do we decrement the TTL
- * at each hop?
- */
-#define TTL_DECREMENT 5000
-
/**
* Length of the P2P success tracker. Note that
* having a very long list can also hurt performance.
*/
struct GNUNET_FS_Handle
{
- /**
- * Scheduler.
- */
- struct GNUNET_SCHEDULER_Handle *sched;
-
/**
* Configuration to use.
*/
};
+/**
+ * Message send by a peer that wants to be excluded
+ * from migration for a while.
+ */
+struct MigrationStopMessage
+{
+ /**
+ * Message type will be
+ * GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP.
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Always zero.
+ */
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * How long should the block last?
+ */
+ struct GNUNET_TIME_RelativeNBO duration;
+
+};
+
+
+
#endif
/* end of fs.h */