Which service/process deems when to kill an ongoing AppStream session?

0

In some earlier answers, I've been told that there's an AppStream Agent running during the session. But I cannot find it in the Windows Task Manager. I've found PhotonWindowsCustomShell, PhotonAgent, and some other SSM and CloudWatch agents.

  1. Which process evaluates if the session reached Disconnect or Idle Timeout?
  2. Is there a way to communicate with that process and hinder it from killing the instance if our app is above a certain CPU utilization threshold?
질문됨 일 년 전385회 조회
3개 답변
0

You could try, if you can emulate keyboard or mouse movement to keep the session active. You can register a powershell script to be called regularly (maybe once every 10 minutes) and move the mouse by 1 point.

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)

This could be done conditionally (on high CPU-load only). That should not interfere with the user too much.

Get-WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average | Select Average

However, I am not sure, if that approach to programmatically move the mouse keeps the session alive. That would need to be tested.

답변함 일 년 전
  • Yes, we've tried that. We have a PowerShell script running and evaluating CPU utilization and when thresholds are breached we've tried both with keyboard input ($WShell.sendkeys()) and mouse movement (New-Object System.Drawing.Point()) but it's not working. We're evaluating the Idle state from Win32 API GetLastInputInfo. Any idea why Photon Agent doesn't pick up those inputs?

  • What is your use case? Is changing the timeout value to higher number not an option as mentioned in our documentation suggested by StevieStets below.

  • Okay, then one more idea. It appears, you can prevent appstream from disconnecting idle users. Quote from CLI command here: https://docs.aws.amazon.com/cli/latest/reference/appstream/create-fleet.html: --idle-disconnect-timeout-in-seconds: To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.

    Then what you could do is disable that automatic idle disconnect handling. You can then - if you need to - find some other way of deactivating an ongoing session. We are for instance using expire-session to kick out users, where their "prepaid usage-amount" has been completely consumed (this is some value managed by us). We have a shell script via cron within each client, which checks that usage amount and in case this falls below zero, this script calls expire-session for the current client (that's Linux, but it should also work in Windows clients).

  • Our client will have basically two types of users: 1st working 8-10 hours a day, 2nd uses instances for long-term calculations that can take more than 12 hours (often longer, no user activity). Our client doesn't want to differentiate customers and create an additional fleet because we already have two different stream.graphics-design fleets. So disabling Idle and setting up the Disconnect timeouts for say 18 hours will lead to unutilized resources among the first group of users. That's why we're looking for a solution that would hinder the session termination based on actual CPU usage.

0

I would not recommend trying to change the behavior of the session timers beyond what is documented. https://docs.aws.amazon.com/appstream2/latest/developerguide/set-up-stacks-fleets.html#set-up-stacks-fleets-create

AWS
전문가
답변함 일 년 전
0

Hello,

Photon Agent is responsible for communicating the session state to the backend service. You can't interfere or communicate with the process to extend the session.

The session is considered active only if there is keyboard and mouse interaction, otherwise the session is considered idle and idle timeout will trigger. CPU utilization on instance isn't considered active session. Once the idle timeout value expires, the session is disconnected. Next, the backend service evaluates the "Disconnect Timeout", if it has expired the session is terminated.

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠