Archived

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

IceGrid Using server-instance in "application.xml" don't work

i config my application.xml as bellow:
<icegrid>

<application name="Simple">
<server-template id="SimpleServer">
<parameter name="index"/>
<server id="SimpleServer-${index}" exe="./Server" activation="always">
<adapter name="EngineExecutor" endpoints="tcp" replica-group="ReplicatedWorkAdapter"/>
<property name="Identity" value="hello"/>
</server>
</server-template>

<replica-group id="ReplicatedWorkAdapter">
<load-balancing type="random"/>
<object identity="hello" type="::CNode::Work"/>
</replica-group>

<node name="node6">
<server-instance template="SimpleServer" index="1"/>
<server-instance template="SimpleServer" index="2"/>
</node>

</application>

</icegrid>

The problom is: when i set Ice.ThreadPool.Client.Size=2 in the client side and when i do more than one task at the same time, the server do those tasks one by one, which i hope the server can do 2 tasks at one time.

Can someone help me about my configuration? Or is there any other things i have to do? Thanks a lot!

Comments

  • benoit
    benoit Rennes, France
    Hi,

    You need to set Ice.ThreadPool.Server.Size=2 in the server configuration if you want the server to have 2 threads to dispatch invocations from the clients. See Thread Pools in the Ice manual for more information. You can add this property setting in the XML SimpleServer server template descriptor.

    Cheers,
    Benoit.
  • Thanks, Benoit, This problem is solved, I debug my client side and found out it is stepped when i destroy the communicator, so i put this destroy work in a new thread, so it works fine now.
    Actually, I have another question to ask you, I am using AMD_Work_doTask, i send many tasks to the server side for one time and when the server finish one task ,it callback to the client, so my question is can i cancel those undoing tasks?

    benoit wrote: »
    Hi,

    You need to set Ice.ThreadPool.Server.Size=2 in the server configuration if you want the server to have 2 threads to dispatch invocations from the clients. See Thread Pools in the Ice manual for more information. You can add this property setting in the XML SimpleServer server template descriptor.

    Cheers,
    Benoit.
  • benoit
    benoit Rennes, France
    Hi,

    No, there's no way to cancel a two-way task even if it's dispatched with AMD. You'll have to add some logic in your application if you want to support some form of cancellation (you could for example throw and return an exception if the task is canceled).

    Cheers,
    Benoit.