Jump to content

Questions about Hyperserver


estrify

Recommended Posts

Dear UniGUI team:

I would be pleased if you could replay following questions because I just upgrade to use this feature (Hyperserver) and I need to be sure about some basics:

  • Hyperserver can create, recycle and destroy nodes, so it can move active sessions from one node to another. The sessionId actually has something like the node where it is created at the beginning of the string, has it?. So, when a session is moved from one node to another, it will maintain its whole session Id indicating on which node it was created, is this true?
  • Is there a way for a session or its application to know on which node is running now?. This feature would be desirable,  in addition to events in UniMainModule to signal leaving and entering node. This could help a lot when globally managing sessions.
  • When Hyperserver moves sessions from one node to another, does it move each session individually, grouping them or all of them at the same time, in a kind of transaction?
  • If the session to be moved has thrown a thread, will the thread be accessed correctly after the movement?
  • Assuming that the Hyperserver installer was installed once in the deployed machine and restarted, when upgrading the version of unigui, is it necessary to use again the hyperserver installer on deployed machine or it is enough distributing the exe or the dll of the hyperserver?

Thank you in advance,

Regards,

Link to comment
Share on other sites

Quote

Hyperserver can create, recycle and destroy nodes, so it can move active sessions from one node to another. The sessionId actually has something like the node where it is created at the beginning of the string, has it?. So, when a session is moved from one node to another, it will maintain its whole session Id indicating on which node it was created, is this true?

No, Hyperserver never move a session from a node to another. If you open web browser, your session will be created in a node and it will stay there until destroy.

Quote

Is there a way for a session or its application to know on which node is running now?. This feature would be desirable,  in addition to events in UniMainModule to signal leaving and entering node. This could help a lot when globally managing sessions.

You can see sessionID starts with 1_ or 2_ it means the node id.

Quote

When Hyperserver moves sessions from one node to another, does it move each session individually, grouping them or all of them at the same time, in a kind of transaction?

As above we are not moving sessions between nodes.

 
 
 
 
Quote

If the session to be moved has thrown a thread, will the thread be accessed correctly after the movement?

As above we are not moving sessions between nodes.

Quote

 Assuming that the Hyperserver installer was installed once in the deployed machine and restarted, when upgrading the version of unigui, is it necessary to use again the hyperserver installer on deployed machine or it is enough distributing the exe or the dll of the hyperserver?

you need to install again because hyperserver build number must match with your build number.

Link to comment
Share on other sites

Thank you very much for the answers!!!. Now I have it much clearer... Only one additional question:

Quote

you need to install again because hyperserver build number must match with your build number.

Is it necessary the restarting of the server after each installation?

Link to comment
Share on other sites

1 hour ago, estrify said:

Is it necessary the restarting of the server after each installation?

Hello,

imho, No.

Just :

1. Stop old service Hyperserver,

2. install the newer

3. Restart the newer.

you can use something like this :

http://forums.unigui.com/index.php?/topic/12503-recommendations-for-hosting/&do=findComment&comment=67145

 

That works fine for me.

Regards

Link to comment
Share on other sites

Thanks a lot for your answer and recommendation, I will try...

As you do, I also think restarting server is only necessary first time to adjust OS parameters. Once done, it is enough stopping, uninstalling, installing and starting. But as this is the first time I will use it in production, I needed to be sure about it.

Link to comment
Share on other sites

  • 3 weeks later...

Dear Hayri,

I have one more question: I have one application that manages several tasks in background with threads periodically launched from ServerModule (those tasks do not interact with GUI, only perform tasks in  database, network drives and interact with other applications).

I suppose that I can use "Persistent Node Zero" feature to ensure the control of my threads but, what does "it will be occasionally recycled like any other Node" mean exaclty?. How can I ensure that this recyclement is done when there are no threads in execution?

Thanks in advance and regards,

 

Link to comment
Share on other sites

  • Administrators
19 minutes ago, estrify said:

Dear Hayri,

I have one more question: I have one application that manages several tasks in background with threads periodically launched from ServerModule (those tasks do not interact with GUI, only perform tasks in  database, network drives and interact with other applications).

I suppose that I can use "Persistent Node Zero" feature to ensure the control of my threads but, what does "it will be occasionally recycled like any other Node" mean exaclty?. How can I ensure that this recyclement is done when there are no threads in execution?

Thanks in advance and regards,

 

You need to perform a cleanup task in Node's ServerModule OnDestroy event.

You need to wait there until all threads are finished with their tasks. It is safe to wait there for a few seconds, but not more.

Link to comment
Share on other sites

24 minutes ago, Farshad Mohajeri said:

To be more clear. Delphi normally waits for threads to complete their tasks before destroying them. If you use TUniThreadTimers same is true.

However, it is better for you to follow your threads and active tasks and wait for them to finish in OnDestroy event..

This is exactly what I do, i.e. to exit the application., But some times, some threads could need several minutes to finish (I.e. making a dump and compression could take about 4 minutes, synchronize with external system could take from 1 to 10-15 minutes, depending on the volume of data to synchronize). So the recycling process will wail or will force killing the process?

Link to comment
Share on other sites

Or not to use Hyperserver everywhere :rolleyes:, because in this type of applications, the concurrency is very low since here UniGUI acts only as management interface. This type of application is extremely portable because it only needs the unigui runtime installed on the machine.

Perhaps a property like "force kill" could be useful in Hyperserver configuration, or a "timeout to kill" property. Please keep it in mind if you have time to think about it and doesn't take much effort to implement it.

Another mechanism that could be useful is to deploy a new binary using a ServerModule method (with a path to the new binary as an argument), in addition to the current manual procedure. This can be used to update the app automatically when it receives a message to do so.

Thank you very much for clarifying how this mechanism works. I like it very much, and I am looking forward to Server Farm feature. It can be just amazing.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...