claudio.piffer Posted September 22, 2021 Share Posted September 22, 2021 Hi, I'm test the HyperServer on Ubuntu Linux (I use docker) in standalone mode and Apache. There are some things I didn't understand: 1. HyperServer Apache: I installed and configured the Hyperserver Apache module and in cfg I setted parameters for my app. In Linux the Apache server opens multiple processes and this (as written in the unigui documentation) creates problems with the management of unigui's sessions. To solve the problem I set the mpm_event.conf file by setting the following parameters: StartServers 1 ServerLimit 1 In this mode only 1 process of the apache2 is permitted. With this configuration, however, Apache will be able to handle a maximum of 25 simultaneous calls. So in this mode is this going to be the limit? Even if the HyperServer and app configuration are much higher? 2. Purged node: I don't understand how nodes are handled in the purged state. I did a test and node 0 has not had active sessions for over 1 hour and despite this it remains "active" in the purged state and I have not set the flag node 0 persistent. When is the process closed? Even closing the browser with the only one active session, the node remains "alive" in the purged state and is no longer closed. What is the operating logic? In this case I am trying HyperServer in standalone mode. I haven't checked with the apache module yet. Thank you very much for your support! Best Regards Claudio Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 Hello, http://www.unigui.com/doc/online_help/configuring-apache-for-linux.htm In above link it is stated that StartServers 1 ServerLimit 1 Should be adjusted as above. https://httpd.apache.org/docs/2.4/mod/event.html To increase max connections you can change parameters showed in above link. Purged Nodes should go away in a few seconds. If they don't then there is a problem. You can check the log file for details. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 33 minutes ago, claudio.piffer said: With this configuration, however, Apache will be able to handle a maximum of 25 simultaneous calls. 25 simultaneous calls can be enough for many scenarios. Many calls are handled so fast that your max simultaneous request won't exceed 10 for many applications. Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 21 minutes ago, Farshad Mohajeri said: Ciao, http://www.unigui.com/doc/online_help/configuring-apache-for-linux.htm Nel link sopra si afferma che StartServers 1 ServerLimit 1 Dovrebbe essere regolato come sopra. https://httpd.apache.org/docs/2.4/mod/event.html Hi Farshad, If I check the status of apache, it shows me a warning saying that with the setting of ServerLimit to 1 the maximum number of simultaneous sessions is a maximum of 25. At the moment MaxRequestWorkers I set it to 150 but I think that with this setting it ignores it and works at maximum 25. The "problem" is that in production I can also have 800-1000 users and all these working more or less in the same time slots so with such a high number of accesses it is easy to reach 25 simultaneous calls. >>Purged Nodes should go away in a few seconds. If they don't then there is a problem. You check the log file for details. Yes you are right! I check the log of the HyperServer and I see this problem: hyper_server: A77FE640: 12:10:17 [TUniHyperNode.TerminateNodeProcess.WaitForSingleObject]:Node #0, Error: System error: 6B hyper_server: A77FE640: 12:10:17 [TUniHyperNode.Terminate]:Node #0 forcefully terminated. hyper_server: A77FE640: 12:10:18 [TUniHyperNode.Terminate]:Node #0 Node process is still active. Termination failed... hyper_server: A77FE640: 12:10:19 [SendCommand Error, Node: 0]:Socket Error # 111 Connection refused. Can you give me some indication on what to investigate? Thank you very much!! Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 Hi Farshad the log of the node 0 is this: sw_syncrosign_web: 58E93740: 12:39:27 []:>--------------------------------------------------------------< sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:Server First Init. sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:Start Path = /syncrosign_web/ sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:Node Id = 0 sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:Node MaxSessions = 250 sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:Starting HTTP Server on Port: 16384... sw_syncrosign_web: 58E93740: 12:39:27 [TUniServerModule]:HTTP Server Started on Port: 16384 sw_syncrosign_web: 574E5640: 12:39:52 [TUniGUIServerModule.AppHandleException-]:EAccessViolation : Access violation at address 00000000009D5BBA, accessing address 00007FB1C36354E2 : Addr: $00000000009D5BBA sw_syncrosign_web: 54CE0640: 12:40:08 []:Node-0, Terminate Started. sw_syncrosign_web: 58E93740: 12:40:08 [TUniServerModule]:Shutting Down Server. sw_syncrosign_web: 58E93740: 12:40:08 [TUniServerModule]:Stopping HTTP Server. sw_syncrosign_web: 58E93740: 12:40:08 [TUniServerModule]:HTTP Server Stopped. sw_syncrosign_web: 58E93740: 12:40:08 [TUniGUISessionManager]:Terminating Session manager. sw_syncrosign_web: 58E93740: 12:40:08 [TUniGUISessionManager]:Stopping Cache Eraser... sw_syncrosign_web: 58E93740: 12:40:08 [TUniGUISessionManager]:Cache Eraser Stopped. sw_syncrosign_web: 58E93740: 12:40:08 [TUniGUISessionManager]:Destroying Worker Threads. sw_syncrosign_web: 58E93740: 12:40:08 [TUniGUISessionManager]:Session manager terminated. sw_syncrosign_web: 58E93740: 12:40:08 [TUniServerModule]:Server Shutdown Completed. sw_syncrosign_web: 58E93740: 12:40:08 []:<--------------------------------------------------------------> sw_syncrosign_web: 58E93740: 12:40:08 [Terminated]:Exit Code: 0 there is this exception: sw_syncrosign_web: 574E5640: 12:39:52 [TUniGUIServerModule.AppHandleException-]:EAccessViolation : Access violation at address 00000000009D5BBA, accessing address 00007FB1C36354E2 : Addr: $00000000009D5BBA This exception in debug not occour! TUniGUIServerModule.AppHandleException?? and then there is the closing of the HTTP server (that's why HyeprServer can't connect right?) So, if I interpret it correctly, the process doesn't actually close but stays "hanging" right? Thank you very much! Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 Hi Farshad I just did a test with the same "executables" but with HyperServer on Apache. (with docker is simply 😉 In this case the purge node remains for a few seconds and is replaced with a new active node. I always have an access violation on my process (now I'm investigating) but despite this with Apache the system works as I expect. Could it be a problem with the standalone HyperServer version? Thank you very much Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 What is version of your uniGUI HyperServer? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 19 minutes ago, claudio.piffer said: Could it be a problem with the standalone HyperServer version? It can be if it runs under a user with not enough privileges. Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 10 minutes ago, Farshad Mohajeri said: Qual è la versione del tuo uniGUI HyperServer? Sorry, of course! The last version: 1.90.0.1551 in Delphi Sydney 10.4.2 Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 32 minutes ago, Farshad Mohajeri said: It can be if it runs under a user with not enough privileges. All process run with root privileges (I use docker) I point out the PID process 14 which is in the defunct state that is a uniGui process (node 0) that has not been closed correctly by HyperServer. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 19 minutes ago, claudio.piffer said: All process run with root privileges (I use docker) The PID 14 seems to be the answer. A <defunct> process . (A zombie process) Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 >>The PID 14 seems to be the answer. A <defunct> process . (A zombie process) I supposed! The problem that as requests increase, so do "zombie" processes. Is there any workaround or any suggestions to avoid this? I would also switch to HyperServer for Apache (where the problem is not there) but the limit of 25 concurrent calls blocks me Thank you very much Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 You can also install in service mode. Have you tried it? Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 Hi Farshad the "zombie" increase That reflect the situation of the server Among other things, node 0 and node 1 have the indication of an active session but in reality they have none Also node 8 (active) have a problem. Indicates one session that no longer exists Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 How do you run the HyperServer executable? 1 Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 19 minutes ago, claudio.piffer said: Also node 8 (active) have a problem. Indicates one session that no longer exists Session numbers maybe updated a bit late. Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 2 hours ago, Farshad Mohajeri said: How do you run the HyperServer executable? Hi Farshad In docker when you define the image you must define the "process" that docker run in container. For this in dockerfile you can use the ENTRYPOINT keyword (or CMD). It's ha two forms: 1. exec: ENTRYPOINT [ "/syncrosign_web/hyper_server" ] (recommended choice) 2. shell: ENTRYPOINT /syncrosign_web/hyper_server I used the first form (exec). The difference is the process attached to a PID 1. In exec mode the process of the PID 1 is the HyperServer In shell mode the process of the PID 1 is the shell Docker attach alway the process that keeps the container alive on the PID 1 With your question I got the doubt and I changed the ENTRYPOINT in the shell form. In shell mode everything works correctly. The processes are closed a few seconds later and the session count is correct. With this "workaround" I solved it. It would be nice if, in a future version of the HyperServer, the issue could be solved using also the exec because use of the shell mode could be problematic if I need to send any sort of POSIX signals to the container since /bin/sh won't forward signals to child processes. Thank you so much Farshad, your support was crucial!! 1 Quote Link to comment Share on other sites More sharing options...
claudio.piffer Posted September 22, 2021 Author Share Posted September 22, 2021 1 hour ago, Farshad Mohajeri said: You can also install in service mode. Have you tried it? No, because the docker container needs a process (last command) to keep running, otherwise the container will exit/stop. Therefore, the "service", cannot be used directly in the Dockerfile. There are some tricks to take advantage of a service but I don't like them a lot Thank you very much! 1 Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 22, 2021 Administrators Share Posted September 22, 2021 OK. It seems that the problem occurs when Nodes are launched and there is no shell -or- when HyperServer is launched from a shell which no longer exists. This can lead to Nodes which doesn't own a parent. These Nodes will morph into zombies when they are terminated. We will look into this problem in more depth to see if there is a solution. Thanks 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.