Scenario
A developer when deploying his application on the grid may want to pre-start the service instances instead of letting Symphony flexibly control the number of service instances.
In the case when the service instances are pre-started on the nodes it is sometimes a good idea to enforce soft service restarts between the frequent service calls, e.g. Invoke, SessionEnter, SessionLeave to clean up the environment. For example, there may be some memory leak on the service that is difficult to fix due to the complexity of the service code. To avoid the situation of running out of memory, you can simply restart the service as described in the next section.
Steps
1. Modify your application code to store reference to the ServiceContext object passed in the onCreateService callback
2. Modify your application code to set the arbitrary internal control code of the service:
C++:
ServiceContextObj->setControlCode(1)
Java:
ServiceContextObj.setControlCode(1)
.NET
ServiceContextObj.ControlCode = 1
3. Modify the application profile to handle the control codes in appropriate manner:
4. Redeploy your application package and the application profileCode:<Service name="YourGridService" description="Your Grid Service" deploymentTimeout="300"> <osTypes> <osType name="NTX86" .......... </osType> </osTypes> <Control> <ControlCode method="Invoke" code="1" action="Restart"></ControlCode> </Control> </Service>


LinkBack URL
About LinkBacks
Reply With Quote