summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h.in11
-rwxr-xr-xconfigure30
-rw-r--r--configure.ac22
-rw-r--r--src/conf.c3
-rw-r--r--src/hash.c8
5 files changed, 46 insertions, 28 deletions
diff --git a/config.h.in b/config.h.in
index 1ac7001..54b35b8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -237,12 +237,21 @@
/* Size of the dns mempool chunk. */
#undef MP_CHUNK_SIZE_DNS
+/* Size of the ip_entry mempool chunk. */
+#undef MP_CHUNK_SIZE_IP_ENTRY
+
/* Size of the local client mempool chunk. */
#undef MP_CHUNK_SIZE_LCLIENT
-/* Size of the channel mempool chunk. */
+/* Size of the channel-member mempool chunk. */
#undef MP_CHUNK_SIZE_MEMBER
+/* Size of the namehost mempool chunk. */
+#undef MP_CHUNK_SIZE_NAMEHOST
+
+/* Size of the userhost mempool chunk. */
+#undef MP_CHUNK_SIZE_USERHOST
+
/* Size of the watch mempool chunk. */
#undef MP_CHUNK_SIZE_WATCH
diff --git a/configure b/configure
index 3ae2992..ec48e87 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Id: configure.ac 1920 2013-04-30 14:51:30Z michael .
+# From configure.ac Id: configure.ac 1947 2013-05-05 10:23:03Z michael .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ircd-hybrid 8.1beta3.
#
@@ -13942,34 +13942,44 @@ fi
$as_echo "#define NICKNAMEHISTORYLENGTH 32768" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_CHANNEL 64*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_CHANNEL 1024*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_MEMBER 32*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_MEMBER 2048*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_BAN 16*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_BAN 1024*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_CLIENT 256*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_CLIENT 1024*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_LCLIENT 128*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_LCLIENT 512*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_DNODE 8*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_DNODE 32*1024" >>confdefs.h
$as_echo "#define MP_CHUNK_SIZE_DBUF 512*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_AUTH 32*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_AUTH 128*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_DNS 16*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_DNS 64*1024" >>confdefs.h
-$as_echo "#define MP_CHUNK_SIZE_WATCH 4*1024" >>confdefs.h
+$as_echo "#define MP_CHUNK_SIZE_WATCH 8*1024" >>confdefs.h
+
+
+$as_echo "#define MP_CHUNK_SIZE_NAMEHOST 64*1024" >>confdefs.h
+
+
+$as_echo "#define MP_CHUNK_SIZE_USERHOST 128*1024" >>confdefs.h
+
+
+$as_echo "#define MP_CHUNK_SIZE_IP_ENTRY 128*1024" >>confdefs.h
+
# Argument processing.
diff --git a/configure.ac b/configure.ac
index 344d6b9..1e863a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,16 +148,20 @@ AS_IF([test "$assert" = "no"],
AC_DEFINE([NICKNAMEHISTORYLENGTH], 32768, [Size of the WHOWAS array.])
-AC_DEFINE([MP_CHUNK_SIZE_CHANNEL], 64*1024, [Size of the channel mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_MEMBER], 32*1024, [Size of the channel mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_BAN], 16*1024, [Size of the ban mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_CLIENT], 256*1024, [Size of the client mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_LCLIENT], 128*1024, [Size of the local client mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_DNODE], 8*1024, [Size of the dlink_node mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_CHANNEL], 1024*1024, [Size of the channel mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_MEMBER], 2048*1024, [Size of the channel-member mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_BAN], 1024*1024, [Size of the ban mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_CLIENT], 1024*1024, [Size of the client mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_LCLIENT], 512*1024, [Size of the local client mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_DNODE], 32*1024, [Size of the dlink_node mempool chunk.])
AC_DEFINE([MP_CHUNK_SIZE_DBUF], 512*1024, [Size of the dbuf mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_AUTH], 32*1024, [Size of the auth mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_DNS], 16*1024, [Size of the dns mempool chunk.])
-AC_DEFINE([MP_CHUNK_SIZE_WATCH], 4*1024, [Size of the watch mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_AUTH], 128*1024, [Size of the auth mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_DNS], 64*1024, [Size of the dns mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_WATCH], 8*1024, [Size of the watch mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_NAMEHOST], 64*1024, [Size of the namehost mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_USERHOST], 128*1024, [Size of the userhost mempool chunk.])
+AC_DEFINE([MP_CHUNK_SIZE_IP_ENTRY], 128*1024, [Size of the ip_entry mempool chunk.])
+
# Argument processing.
AX_ARG_ENABLE_IOLOOP_MECHANISM
diff --git a/src/conf.c b/src/conf.c
index b7f6eef..378cb9a 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -432,8 +432,7 @@ attach_iline(struct Client *client_p, struct MaskItem *conf)
void
init_ip_hash_table(void)
{
- ip_entry_pool = mp_pool_new(sizeof(struct ip_entry),
- 2 * hard_fdlimit);
+ ip_entry_pool = mp_pool_new(sizeof(struct ip_entry), MP_CHUNK_SIZE_IP_ENTRY);
memset(ip_hash_table, 0, sizeof(ip_hash_table));
}
diff --git a/src/hash.c b/src/hash.c
index 4dad3c7..206d593 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -69,12 +69,8 @@ static struct UserHost *userhostTable[HASHSIZE];
void
hash_init(void)
{
- /* Default the userhost/namehost sizes to CLIENT_HEAP_SIZE for now,
- * should be a good close approximation anyway
- * - Dianora
- */
- userhost_pool = mp_pool_new(sizeof(struct UserHost), MP_CHUNK_SIZE_CLIENT);
- namehost_pool = mp_pool_new(sizeof(struct NameHost), MP_CHUNK_SIZE_CLIENT);
+ userhost_pool = mp_pool_new(sizeof(struct UserHost), MP_CHUNK_SIZE_USERHOST);
+ namehost_pool = mp_pool_new(sizeof(struct NameHost), MP_CHUNK_SIZE_NAMEHOST);
hashf_xor_key = genrand_int32() % 256; /* better than nothing --adx */
}