IceGrid Performance

in Help Center
Hi again!
First i have changed Hello World app so server calculate sqrt and returning result to client. I set Ice.ThreadPool.Server.SizeMax to 10 on server and wrote for loop (i.e. from 1 to 100000), which is calling my sqrt function. I measure the time from start to end a loop.
Then i have changed IceGrid/replication demo that it did the same - calculate sqrt. But when i craeted the same for loop IceGrid app needs almost twice as much time. But in this demo are 4 serwers, so why it is much slower? I added to config.master
and i deleted in every config file
Ice.StdErr=db/node1/stderr.txt
Ice.StdOut=db/node1/stdout.txt
and every tracing, but it did not help... Why 4 serwers (with 10 threads for each of them) are slower than one (with 10 threads)?
Thanks for help.
EDIT: have forgotten to wrote that on the beggining i did not change config files, like adding ThreadPool parameters or deleting tracing.
First i have changed Hello World app so server calculate sqrt and returning result to client. I set Ice.ThreadPool.Server.SizeMax to 10 on server and wrote for loop (i.e. from 1 to 100000), which is calling my sqrt function. I measure the time from start to end a loop.
Then i have changed IceGrid/replication demo that it did the same - calculate sqrt. But when i craeted the same for loop IceGrid app needs almost twice as much time. But in this demo are 4 serwers, so why it is much slower? I added to config.master
IceGrid.Registry.Client.ThreadPool.Size=1 IceGrid.Registry.Client.ThreadPool.SizeMax=10 IceGrid.Registry.Internal.ThreadPool.Size=1 IceGrid.Registry.Internal.ThreadPool.SizeMax=10
and i deleted in every config file
Ice.StdErr=db/node1/stderr.txt
Ice.StdOut=db/node1/stdout.txt
and every tracing, but it did not help... Why 4 serwers (with 10 threads for each of them) are slower than one (with 10 threads)?
Thanks for help.
EDIT: have forgotten to wrote that on the beggining i did not change config files, like adding ThreadPool parameters or deleting tracing.
0
Comments
Why did you modify the IceGrid thread pool configuration? You shouldn't have to modify the IceGrid thread pool configuration, it should work with the default configuration.
It isn't clear to me how exactly is written your test and what kind of load balancing you are using. You would need to detail this, eventually providing your test case.
In any case, few comments:
So if your servers just do a single "sqrt" computation and then return and if you use IceGrid per-request load balancing in your client, I'm not surprised the performances are worst when using 4 servers. In this case, using a single server (with a number of threads equal to the number of cores) and no per-request load balancing will be faster.
On the opposite, if your server implementation makes long running computations for each Ice invocation (e.g.: one Ice invocation results in 100000 sqrt calls), if you have 4 servers running on different machines where each server is configured with a number of threads equal to the number of cores of the machine and if your client uses per-request load balancing... then I would expect such a scenario to perform better with 4 servers than a single server.
Cheers,
Benoit.
Actually i am exaggerating with threads, but for my defense i tell you that i did that later.
So, i don't understand exactly what is load balancing. I cut delay option from Client.cpp and i thought that everything is alright.
I attached project. Meybe it's okay, but i don't understand IceGrid...
FILE
Now i will try run two nodes on each machine, will see how it works then
Could you detail what you don't understand and what performance numbers you are looking for?
IceGrid load balancing allows to spread the load of Ice invocations on different servers. As explained above, increasing the number of threads or the number of servers doesn't automatically improves the performances.
If I understand your test case, you run a client which calls N times on one of the load balanced servers. The server servant implementation just does a simple sqrt computation. What do you expect to measure with this test?
As explained earlier, the load balancing has a small cost as it implies making an additional invocation on the IceGrid locator for each invocation (with the configuration used by your test). In general this cost is insignificant compared to the time taken by the call to complete.
Cheers,
Benoit.
And one more questions. If i run element A on different machine that element B both has to listening opposite ip? So A has to listen B ip, and B has to listen A ip?
Thanks for your help
If you use round-robin for the load balancing, the calls will be equally spread on all the replicas. I believe I already answered your question regarding replication
As for your last question, in general if an Ice server needs to dispatch requests from clients, it needs to listen on a IP address and port. If both A and B expose Ice objects with servants, both will need to listen on an IP address and port.
There is also the possibility of using bi-directional connections so that only one process listens on an IP/port but this only works in some specific use cases where an Ice client always establishes a connection the Ice server first (and the server can call back the Ice client through this same Ice connection). For more information I recommend going through the Ice manual and the Ice demos.
Cheers,
Benoit.
someIP is IP of server machine, do i nedd to modify config files of master, replicas and nodes? In situation when i don't modified them and in other situation when i do (adding -h someIP in Default.Locator and IceGrid registry configuration in every file) when i run client i get:
benoit, thanks again for help!