- world->collections= collection;
-
- world->_create= (test_callback_create_fn*)world_create;
- world->_destroy= (test_callback_destroy_fn*)world_destroy;
+ if (getenv("LIBMEMCACHED_SERVER_NUMBER"))
+ {
+ unsigned long int set_count= strtoul(getenv("LIBMEMCACHED_SERVER_NUMBER"), (char **) NULL, 10);
+ fatal_assert(set_count >= 1);
+ world->servers().set_servers_to_run(set_count);
+ }
+ else
+ {
+ // Assume a minimum of 3, and a maximum of 8
+ world->servers().set_servers_to_run((libtest::number_of_cpus() > 3) ?
+ std::min(libtest::number_of_cpus(), size_t(8)) : 3);
+ }