locked
Powershell Server Wake-Up Delay RRS feed

  • Question

  • Hello everyone!

    At my company we have build a Powershell client-server solution for specific Active Directory interactions.

    The Server component basically listens for incoming clients using the function AcceptTcpClient from the .Net object System.Net.Sockets.TcpListener.

    The system generally performs well for our purpose, but there is one problem: When no clients have been active for 5-10 minutes or so, the Server script kind of falls asleep. The first request after such pause experiences a long wait time (5 seconds or more). After that, responses are swift again...

    Is there anything we can do to prevent the Server script from entering this sleep mode?

    BR / Poul

    Monday, February 26, 2018 12:52 PM

All replies

  • The only direct ways to prevent a process from sleeping is to send a "keepalive" message or to run the process as a service. Any process may be allowed to go dormant and can tke 5 seconds or longer to respond in a busy system.

    Generally speaking scripts do not make good responsive servers.


    \_(ツ)_/

    Monday, February 26, 2018 2:05 PM