]> git.sur5r.net Git - openldap/commitdiff
warn if "excessive" thread number is set (ITS#4249)
authorPierangelo Masarati <ando@openldap.org>
Wed, 7 Dec 2005 09:58:54 +0000 (09:58 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 7 Dec 2005 09:58:54 +0000 (09:58 +0000)
servers/slapd/bconfig.c

index 4c9499792067f35d80074e22674da7a790f572b8..8c13563ca51f10cb3e915475ca1e9d90f460fa96 100644 (file)
@@ -1069,6 +1069,13 @@ config_generic(ConfigArgs *c) {
                        break;
 
                case CFG_THREADS:
+                       if ( c->value_int > 2 * SLAP_MAX_WORKER_THREADS ) {
+                               snprintf( c->msg, sizeof( c->msg ),
+                                       "warning, threads=%d larger than twice the default (2*%d=%d); YMMV",
+                                       c->value_int, SLAP_MAX_WORKER_THREADS, 2 * SLAP_MAX_WORKER_THREADS );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s.\n",
+                                       c->log, c->msg, 0 );
+                       }
                        if ( slapMode & SLAP_SERVER_MODE )
                                ldap_pvt_thread_pool_maxthreads(&connection_pool, c->value_int);
                        connection_pool_max = c->value_int;     /* save for reference */