diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-04-05 12:54:15 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-04-05 12:54:15 +0000 |
commit | 872fd9e5dfb743a648c64bf774f6c9a76a45b651 (patch) | |
tree | c071c5dc5bd1177c0913e82cb8a3233f0da50ea6 /cpp/src/IceGrid/IceGridNode.cpp | |
parent | adding timeout test (diff) | |
download | ice-872fd9e5dfb743a648c64bf774f6c9a76a45b651.tar.bz2 ice-872fd9e5dfb743a648c64bf774f6c9a76a45b651.tar.xz ice-872fd9e5dfb743a648c64bf774f6c9a76a45b651.zip |
- Added support for observing adapters and objects.
- Lots of cleanup in the IceGrid registry initilization method.
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 9d84cc3899f..72aa45694f0 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -246,17 +246,33 @@ NodeService::start(int argc, char* argv[]) // termination listener instead? // properties->setProperty("Ice.ServerIdleTime", "0"); - if(properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.Size", 10) <= 10) + + // + // Warn the user that setting Ice.ThreadPool.Server isn't useful. + // + if(properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.Size", 0) > 0) { - properties->setProperty("Ice.ThreadPool.Server.Size", "10"); + Warning out(communicator()->getLogger()); + out << "setting `Ice.ThreadPool.Server.Size' is not useful,\n"; + out << "you should set individual adapter thread pools instead."; } - if(properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.SizeWarn", 80) <= 80) + + int size = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.Size", 0); + if(size <= 0) { - properties->setProperty("Ice.ThreadPool.Server.SizeWarn", "80"); + properties->setProperty("IceGrid.Node.ThreadPool.Size", "1"); } - if(properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.SizeMax", 100) <= 100) + int sizeMax = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeMax", 0); + if(sizeMax <= 0) { - properties->setProperty("Ice.ThreadPool.Server.SizeMax", "100"); + if(size >= sizeMax) + { + sizeMax = size * 10; + } + + ostringstream os; + os << sizeMax; + properties->setProperty("IceGrid.Node.ThreadPool.SizeMax", os.str()); } @@ -271,22 +287,6 @@ NodeService::start(int argc, char* argv[]) // if(properties->getPropertyAsInt("IceGrid.Node.CollocateRegistry") > 0) { - // - // The node needs a different thread pool. - // - if(properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.Size", 5) <= 0) - { - properties->setProperty("IceGrid.Node.ThreadPool.Size", "5"); - } - if(properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeWarn", 80) <= 80) - { - properties->setProperty("IceGrid.Node.ThreadPool.SizeWarn", "80"); - } - if(properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeMax", 100) <= 100) - { - properties->setProperty("IceGrid.Node.ThreadPool.SizeMax", "100"); - } - _registry = new CollocatedRegistry(communicator(), _activator); if(!_registry->start(nowarn)) { @@ -586,9 +586,11 @@ NodeService::initializeCommunicator(int& argc, char* argv[]) PropertiesPtr defaultProperties = getDefaultProperties(argc, argv); // - // Make sure that IceGridNode doesn't use thread-per-connection. + // Make sure that IceGridNode doesn't use thread-per-connection or + // collocation optimization // defaultProperties->setProperty("Ice.ThreadPerConnection", ""); + defaultProperties->setProperty("Ice.Default.CollocationOptimization", "0"); return Service::initializeCommunicator(argc, argv); } |