Search found 43 matches

by akincer
Mon Oct 07, 2019 12:12 pm
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

Figured out why jobs using Invoke-Command were going out to lunch and it's embarrassingly silly. I had to do this because due to how multi-threading is achieved using runspaces, REST API requests were stepping all over each other. The performance boost for this use case using jobs instead of runspac...
by akincer
Mon Oct 07, 2019 10:53 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

I can tell it's "hung" because execution in the parent thread stops. That code stopped executing where it always does -- starting a job. This time on job 5. Using process explorer: powershell.exe parent process state: Wait:UserRequest conhost.exe parent process state: Wait:UserRequest powe...
by akincer
Fri Oct 04, 2019 2:21 pm
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

For now I've just decided to use PoshRSJob and keep it all in runspaces. I cannot seem to replicate it, but I had BLISTERING speed using Invoke-Command as a job in one test. I've got acceptable performance with PoshRSJob. Now it seems to be a matter of finding the right balance of throttling concurr...
by akincer
Fri Oct 04, 2019 12:19 pm
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

When I say "hung" I mean all execution stops. I do not know what the underlying source of suspended execution might be. Ending the child process that the parent process is clearly waiting on something before continuing causes it to pick right up where it left off. Even with extremely simpl...
by akincer
Fri Oct 04, 2019 11:46 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

I've said from the start I think it's a bug specific to Windows Server 2016 but specifically wanted to see if anyone else saw this behavior to try to figure out if it is specific to my systems. Interestingly if I use Invoke-Command to create jobs locally but treated as remote jobs this problem doesn...
by akincer
Fri Oct 04, 2019 11:28 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

The easiest way to do this is to use a Workflow that runs the task in parallel. I haven't gotten into workflows. Is that truly multi-threaded so I can saturate the cores on a machine? The code blocks I need to run varies in runtime and the scale of operations, but I need to squeeze as much out of t...
by akincer
Fri Oct 04, 2019 11:20 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

jvierra wrote: Fri Oct 04, 2019 11:06 am Use my code to understand why this is happening.
This. Is. Not. The. Issue. Sometimes it fails at job #6, sometimes at job # 100. Most of the time I can see with PSExec there is only one child Powershell process running. I've even had this fail on the very first job.
by akincer
Fri Oct 04, 2019 10:56 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

Remove the following and you will begin to see the issue. [b}-ErrorAction SilentlyContinue[/b] No. This is not the issue. To be more clear -- it's not the cleanup of completed jobs that's the issue. Powershell hangs on STARTING a job. I can literally run PSExec and see the hung instance sitting the...
by akincer
Thu Oct 03, 2019 3:11 pm
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Re: Start-Job hangs Powershell on Windows 2016

Using process explorer, I discovered that if I kill the sub-process that was spun up when it hung the parent thread takes off again. So it looks like it's happening during the spinning up of the Powershell instance it's creating. Also -- I'm not really able to recreate this on a Windows 2008 box wit...
by akincer
Wed Oct 02, 2019 8:45 am
Forum: PowerShell
Topic: Start-Job hangs Powershell on Windows 2016
Replies: 18
Views: 10731

Start-Job hangs Powershell on Windows 2016

Not sure if anyone else has seen this, but there's what must be a bug that occasionally causes the parent thread to hang when trying to run Start-Job and if you're starting a bunch of jobs on a loop you'll probably hit it for sure. If you're hitting this and are looking for a workaround, I have one ...