Archived

This forum has been archived. Please start a new discussion on GitHub.

Competition for server thread for sync and async invocation

Hi there,

I am experimenting on basic performance for message passing.

I have implemented a queueing framework, where ice server receives messages from clients and forwards to workers.

Clients use put (AMI and AMD) operation to put messages onto the server to be forwarded to any workers.

Workers invoke get (synchronous invocation) operation on server to get first in message.

I am using multiple threads for clients(10) and workers(10) to make it look close to real world scenarios. I am also using server thread pool (50).

Now my problem is, clients put_async invocation consume all my server threads very quickly and very few get invocation gets processed while put_async finishes. So, if I am sending 100,000 messages of 1024 bytes untill clients finishes their send, workers are deprived of server threads. Once clients finish, workers get all the messages very quickly.

And my question is, can we reserve few server threads dedicated for sync method invocation and rest for async if invoked.

I hope, i defined my problem precisely.

I am using Freebsd OS for client/worker/ice server. Language used is C++ for server and client/worker in python.

Please advice.

Thanks.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Your server could create 2 object adapters with their own dedicated thread pool. This way, requests from workers would be dispatched with threads from one thread pool and requests from clients would be dispatched with threads from another thread pool (see the documentation for the adapter ThreadPool properties for more information on how to configure a dedicated thread pool for an object adapter).

    That being said, if your server is just a queuing system, why does it need 50 threads? Do these threads perform IO operations which might block, wait to acquire some resources or perform Ice synchronous invocations? If your server only performs operations that can't block, few threads should be enough (e.g.: 1 thread per processor).

    Cheers,
    Benoit.