Number of threads per ICE server/client

in Help Center
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();
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();
0
Comments
We are developing video transcoder, each transcoding job is isolated in a separate process, being an Ice client. When such a client starts, it register itself on an Ice server as "worker" with a callback interface, something like :
interface worker {
void start_transcoding(...
void stop_transcoding(...
...
etc
The problem is what we will run thousands of such workers on the same machine and want to minimize their system resources usage.
It would be much easier to use a thread-per-transcoder model instead of process-per-transcoder. But it is a question of fault-tolerance. Video encoders/decoders are too complex to be bug-free, and we don't want to let the seg. fault in one transcoding job crash the whole server. That is why we want to have each xcoding job in a separate process.
Anyway, I'm afraid I can't offer you any advice beyond what I wrote already. I do not believe you will be able to have an efficient system with so many processes, regardless of whether you use Ice or not.
Thank you for your answers! I think we will manage it one way or another.