Can a client pre-configure servers

KeithPKeithP Member Keith PalihakkaraOrganization: Winton Capital ManagementProject: Trading System
Hello,

I have a grid node running using the following application.xml:
<icegrid>

  <application name="Session">

    <server-template id="Runner">
      <parameter name="index"/>
      <server id="Runner-${index}" exe="./runnerd" activation="always" >
	<option>${index}</option>
        <option>cfg/runner.xml</option>
        <adapter name="RunnerAdapter" endpoints="tcp">
          <allocatable identity="Runner-${index}" type="IRunner" property="Identity" />
        </adapter>
      </server>
    </server-template>

    <node name="Node1">
      <server-instance template="Runner" index="1"/>  
      <server-instance template="Runner" index="2"/>          
      <server-instance template="Runner" index="3"/>  
      <server-instance template="Runner" index="4"/>          
    </node>
  </application>

</icegrid>

The client connects and holds connections to servers open via sessions.

What I want to find out is whether the client can do the following:

1) Determine how many free servers there are at any point in time
2) Start up extra servers as and when needed (in effect to programatically add servers with index 5, 6 and so on whenever the client considers the number of free servers is running low)

Thanks for your help,
Keith

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    There are no "out-of-the box" ways to do this but you could implement this yourself:
    • you could design a facade interface that your clients would use to allocate objects.
    • this facade would provide a method that returns the number of free servers.
    • it would also provide some methods to easily instantiate new servers.

    The implementation of this facade interface can use the IceGrid::Admin interface to instantiate new servers and to figure out how many servers are currently deployed for the application. It could also actually be responsible for instantiating new servers depending on the number of clients (instead of having the clients take care of this).

    Just out of curiosity, why do you need to have one server instance per client?

    Cheers,
    Benoit.
  • KeithPKeithP Member Keith PalihakkaraOrganization: Winton Capital ManagementProject: Trading System
    Hi Benoit,

    One server instance per client primarily for failure reasons. If the handling of the client request by a particular server is behaving in an unexpected manner, then we have the capability of terminating the server via the ice grid node without affecting any other client requests.

    Thanks,
    Keith
Sign In or Register to comment.