Archived
This forum has been archived. Please start a new discussion on GitHub.
multiple threads, single connection problem
i have read the documentation and verified the codes that though we have multiple threads, we only have estabished one single connection to the server, that eventually multiple threads will block on this synchroize block in the following method:
<code>
ConnectionI.sendRequest
</code>
i want to seek for verification of my understanding and any suggestion if appropriate
this is our current setup:
mutiple ice servers are setup with different IPs, but clients will connect to these servers by another single IP, and that IP will forward to either one of the actual ice server ip by our load balancer
(this was a historical setup...)
now, the situation is
once our client is connected to one of the ice server, it never change to other servers (this is expected after i read the documentation and verify that by code)
but we also find that only one single connection is created, even we have multiple client threads are created to serve the requests
the question is
- even we have multiple threads, eventually all those threads will be serialized to wait for the single connection ?
- if it is so, is there any mean to have multiple connections per single proxy? (without using the IceGrid for clustering/failure over/load balancing)
<code>
ConnectionI.sendRequest
</code>
i want to seek for verification of my understanding and any suggestion if appropriate
this is our current setup:
mutiple ice servers are setup with different IPs, but clients will connect to these servers by another single IP, and that IP will forward to either one of the actual ice server ip by our load balancer
(this was a historical setup...)
now, the situation is
once our client is connected to one of the ice server, it never change to other servers (this is expected after i read the documentation and verify that by code)
but we also find that only one single connection is created, even we have multiple client threads are created to serve the requests
the question is
- even we have multiple threads, eventually all those threads will be serialized to wait for the single connection ?
- if it is so, is there any mean to have multiple connections per single proxy? (without using the IceGrid for clustering/failure over/load balancing)
0
Comments
-
Welcome to the forum!
You can force a proxy to use a different connection by assigning it a unique "connection id" (see this this section of the manual). You can use this however you like; for example, you can give each proxy a different id, in which case each proxy creates its own connection. Another option is to create a pool of ids if you are concerned about creating too many connections.
Here's a code sample:// Java Ice.ObjectPrx proxy = ... Ice.ObjectPrx proxy1 = proxy.ice_connectionId("id1");
Cheers,
Mark0 -
I forgot to respond to this question:even we have multiple threads, eventually all those threads will be serialized to wait for the single connection ?
Let us know if you need more information.
Mark0 -
something doubtful is found
we find that the server has warning message on the thread pool:
Size=10, SizeMax=10, SizeWarn=10
warning: thread pool `Ice.ThreadPool.Server' is running low on threads
and try to read the thread dump, and it also shows that multiple threads are running to serve the request
so that means we still can serve for multiple requests even we have one single connection?0 -
Welcome to the forum!
You can force a proxy to use a different connection by assigning it a unique "connection id" (see this this section of the manual). You can use this however you like; for example, you can give each proxy a different id, in which case each proxy creates its own connection. Another option is to create a pool of ids if you are concerned about creating too many connections.
Here's a code sample:// Java Ice.ObjectPrx proxy = ... Ice.ObjectPrx proxy1 = proxy.ice_connectionId("id1");
Cheers,
Mark
thanks for the quick response,
does that mean we need to create multiple proxies? i.e. we need to pick up one from the list of created proxies when needed?0 -
does that mean we need to create multiple proxies? i.e. we need to pick up one from the list of created proxies when needed?
Cheers,
Mark0