2

I just set up 5 Windows Server 2012 R2 Standard servers running Remote Desktop Services in a Session Collection.

The latest server I put on has 96GB of RAM and hosts 80 - 160 users. All users are simply getting web access with Firefox for the most part.

Every day since putting this on, I have had from one to three users' firefox instances balloon up to a maximum of 30GB(!!!!!) of memory consumed each day. On inspecting their traffic, it was usually either:

  • YouTube
  • Music Streaming
  • Any flash content

Most users only had 1 or 2 tabs open. It appears that Flash is the culprit.

I have Flash fully updated to the latest version, and Firefox is running on the latest version. All OS updates have been done as well.

Why is this happening / how can I curb this? I can't have 3 users take up all of the server's resources.

1

I put together a temporary "handling" for the problem that is not a handling at all. I am still absolutely looking for the actual source of the problem.


Temporary Handling

I built a Powershell script that runs on chron, which finds all firefox instances running up excessive amounts of memory, messages the user and then kills the process.

foreach ($comp in $args) {
  $size = 4000000000
  $owners = Get-WmiObject -ComputerName $comp -Query "Select * from Win32_Process where WorkingSetSize > $size and name = 'firefox.exe'" | Select @{Label='Owner';Expression={$_.GetOwner().User}}
  foreach ($i in $owners) {
    $is = $i.Owner
    $msg = 'AUTOMATED MESSAGE: Your web browser was using an excessive amount of memory and has been closed to prevent it from overloading the server. You can open it again right after this.'
    $cmd = "msg.exe $is /SERVER:$comp '$msg' "
    Invoke-Expression $cmd
  }
  Invoke-Command -ComputerName $comp {Get-Process | Where {($_.Name -eq "firefox") -and ($_.WorkingSet64 -gt 4000000000)} | Stop-Process -Force }
}

To invoke:

.\kill.ps1 ts1 ts2 ts3 ts4 ts5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.