summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2011-04-10 16:14:36 -0700
committerdormando <dormando@rydia.net>2011-04-10 16:14:36 -0700
commiteb5603df1819d5cf0cf55c7008f43ed10ecfaed1 (patch)
tree04c0f7e22184c715a49d66ad93b289730358bbbc
parent4af6fc95dc49604e4f9f184f42c8dca6ff49b0e6 (diff)
downloadmemcached-eb5603df1819d5cf0cf55c7008f43ed10ecfaed1.tar.gz
fix tests and warnings under the maxconns change
After some idle thought it seems clear enough to just kick the maxconns deafult down to 1000. It was never 1024 before due to pipes/conns consuming fds anyway. Also repairs some tests which were looking for that 1024 number, and some subtle wording changes to the warnings.
-rw-r--r--daemon/memcached.c10
-rwxr-xr-xt/binary.t2
-rwxr-xr-xt/stats.t2
3 files changed, 7 insertions, 7 deletions
diff --git a/daemon/memcached.c b/daemon/memcached.c
index 6f22066..99ece9a 100644
--- a/daemon/memcached.c
+++ b/daemon/memcached.c
@@ -256,7 +256,7 @@ static void settings_init(void) {
/* By default this string should be NULL for getaddrinfo() */
settings.inter = NULL;
settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */
- settings.maxconns = 1024; /* to limit connections-related memory to about 5MB */
+ settings.maxconns = 1000; /* to limit connections-related memory to about 5MB */
settings.verbose = 0;
settings.oldest_live = 0;
settings.evict_to_free = 1; /* push old items out of cache when memory runs out */
@@ -6042,7 +6042,7 @@ static void usage(void) {
"-u <username> assume identity of <username> (only when run as root)\n"
"-m <num> max memory to use for items in megabytes (default: 64 MB)\n"
"-M return error on memory exhausted (rather than removing items)\n"
- "-c <num> max simultaneous connections (default: 1024)\n"
+ "-c <num> max simultaneous connections (default: 1000)\n"
"-k lock down all paged memory. Note that there is a\n"
" limit on how much memory you may lock. Trying to\n"
" allocate more than that would fail, so be sure you\n"
@@ -7249,16 +7249,16 @@ int main (int argc, char **argv) {
}
if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) {
const char *fmt;
- fmt = "WARNING: memcached cannot use (%d) connections due to "
+ fmt = "WARNING: maxconns cannot be set to (%d) connections due to "
"system\nresouce restrictions. Increase the number of file "
- "descriptors allowed\nto the memcached user process or run "
+ "descriptors allowed\nto the memcached user process or start "
"memcached as root (remember\nto use the -u parameter).\n"
"The maximum number of connections is set to %d.\n";
int req = settings.maxconns;
settings.maxconns = syslimit - (3 * (settings.num_threads + 2));
if (settings.maxconns < 0) {
settings.extensions.logger->log(EXTENSION_LOG_WARNING, NULL,
- "failed to set rlimit for open files. Try running as"
+ "failed to set rlimit for open files. Try starting as"
" root or requesting smaller maxconns value.\n");
exit(EX_OSERR);
}
diff --git a/t/binary.t b/t/binary.t
index 64c7a29..865f0c9 100755
--- a/t/binary.t
+++ b/t/binary.t
@@ -369,7 +369,7 @@ $mc->silent_mutation(::CMD_ADDQ, 'silentadd', 'silentaddval');
{
my %stats = $mc->stats('settings');
- is(1024, $stats{'maxconns'});
+ is(1000, $stats{'maxconns'});
is('NULL', $stats{'domain_socket'});
is('on', $stats{'evictions'});
is('yes', $stats{'cas_enabled'});
diff --git a/t/stats.t b/t/stats.t
index 1faf063..b3c9f6f 100755
--- a/t/stats.t
+++ b/t/stats.t
@@ -169,7 +169,7 @@ my ($newid, $v) = mem_gets($sock, 'c');
is('z', $v, 'got the expected value');
my $settings = mem_stats($sock, ' settings');
-is(1024, $settings->{'maxconns'});
+is(1000, $settings->{'maxconns'});
is('NULL', $settings->{'domain_socket'});
is('on', $settings->{'evictions'});
is('yes', $settings->{'cas_enabled'});