Hello!
Our solution is supposed to have many ( > 1000) small Ice servers as separate processes working on the same machine. So we are interested in lowering system resource consuption as much as possible.
I noticed what simple server with source code listed below spawns 6 threads.
As far as I understand they are:
1. main thread
2. 1 thread in client thread pool
3. 1 thread in server thread pool
4. host resolver thread
5. selector thread
6. ?
My question is: is it possible to lower the number of threads spawned? Is it possible to terminate resolver thread after the resolving is done? Is it possible to use "main" thread as selector thread? It would be ideal to have only one thread waiting on "epoll_wait"
Best regards,
Alexander Ivanenko
Simple server code:
communicator = Ice::initialize(argc, argv);
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("client", "tcp");
WorkerPtr w = new WorkerI();
WorkerPrx prx = WorkerPrx::checkedCast(adapter->add(w, communicator->stringToIdentity(lexical_cast<string>(getpid()))) );
adapter->activate();
HostPrx host = HostPrx::checkedCast(communicator->stringToProxy("xcoder:tcp -p 10000"));
host->registerWorker(prx);
communicator->waitForShutdown();
communicator->destroy();


Reply With Quote
