Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Slow reponse from UNC paths.

Reply
 
Old 09-15-2006   #1 (permalink)
Marty List


 
 

Slow reponse from UNC paths.


I've noticed that sometimes PowerShell takes almost a minute to access some UNC
paths, while other tools like cmd.exe and explorer.exe take 1 or 2 seconds.
It's not all UNC paths, some are fast and some are slow.

These machines are on the same subnet and this happens quite often, it's not
just a slow machine or a network problem. I also tested access times to the
same machine with another .NET 2.0 executable that I wrote, it was about 2
seconds.

Take a look at the time differences between powershell.exe and cmd.exe:


PS C:\Tmp> get-date

Friday, September 15, 2006 5:45:21 PM


PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*

Directory:
Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32

Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 09/15/2006 5:30 PM CCM
d---- 09/15/2006 5:30 PM ccmsetup
-a--- 02/09/2006 1:50 AM 334560 ccmcore.dll


PS C:\Tmp> get-date

Friday, September 15, 2006 5:46:14 PM


PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
Volume Serial Number is E030-3171

Directory of \\IT-TEST-MARTY07\Admin$\System32

09/15/2006 05:30 PM <DIR> CCM
09/15/2006 05:30 PM <DIR> ccmsetup
02/09/2006 02:50 AM 334,560 ccmcore.dll
1 File(s) 334,560 bytes
2 Dir(s) 14,756,823,040 bytes free

PS C:\Tmp> get-date

Friday, September 15, 2006 5:46:16 PM


PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*

Directory:
Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32

Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 09/15/2006 5:30 PM CCM
d---- 09/15/2006 5:30 PM ccmsetup
-a--- 02/09/2006 1:50 AM 334560 ccmcore.dll


PS C:\Tmp> get-date

Friday, September 15, 2006 5:47:12 PM


PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
Volume Serial Number is E030-3171

Directory of \\IT-TEST-MARTY07\Admin$\System32

09/15/2006 05:30 PM <DIR> CCM
09/15/2006 05:30 PM <DIR> ccmsetup
02/09/2006 02:50 AM 334,560 ccmcore.dll
1 File(s) 334,560 bytes
2 Dir(s) 14,756,823,040 bytes free

PS C:\Tmp> get-date

Friday, September 15, 2006 5:47:14 PM




My System SpecsSystem Spec
Old 09-16-2006   #2 (permalink)
Jeffrey Snover


 
 

Re: Slow reponse from UNC paths.

I don't know what would cause that - please file a bug and we'll
investigate.

Jeffrey Snover [MSFT]
Windows PowerShell/Aspen Architect
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scr.../hubs/msh.mspx

My System SpecsSystem Spec
Old 09-16-2006   #3 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Re: Slow reponse from UNC paths.

Marty,

I'm guessing that this is due to a timeout in attempting to find the path by
various means. You might want to try the following variations as tests (and
of course, response may be affected by caching at various times):

(1) Try the fully-qualified PSPath and see how response compares:

Get-ChildItem FileSystem::\\IT-TEST-MARTY07\Admin$\System32\ccm*

(2) To make testing the important aspects easier, try using Measure-Command
(which returns a TimeSpan):
(Measure-Command {gci ...}).TotalSeconds


"Marty List" <usenet@optimumx.com> wrote in message
news:%23$fWcKS2GHA.4924@TK2MSFTNGP05.phx.gbl...
>
> I've noticed that sometimes PowerShell takes almost a minute to access
> some UNC paths, while other tools like cmd.exe and explorer.exe take 1 or
> 2 seconds. It's not all UNC paths, some are fast and some are slow.
>
> These machines are on the same subnet and this happens quite often, it's
> not just a slow machine or a network problem. I also tested access times
> to the same machine with another .NET 2.0 executable that I wrote, it was
> about 2 seconds.
>
> Take a look at the time differences between powershell.exe and cmd.exe:
>
>
> PS C:\Tmp> get-date
>
> Friday, September 15, 2006 5:45:21 PM
>
>
> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>
> Directory:
> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> d---- 09/15/2006 5:30 PM CCM
> d---- 09/15/2006 5:30 PM ccmsetup
> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>
>
> PS C:\Tmp> get-date
>
> Friday, September 15, 2006 5:46:14 PM
>
>
> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
> Volume Serial Number is E030-3171
>
> Directory of \\IT-TEST-MARTY07\Admin$\System32
>
> 09/15/2006 05:30 PM <DIR> CCM
> 09/15/2006 05:30 PM <DIR> ccmsetup
> 02/09/2006 02:50 AM 334,560 ccmcore.dll
> 1 File(s) 334,560 bytes
> 2 Dir(s) 14,756,823,040 bytes free
>
> PS C:\Tmp> get-date
>
> Friday, September 15, 2006 5:46:16 PM
>
>
> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>
> Directory:
> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> d---- 09/15/2006 5:30 PM CCM
> d---- 09/15/2006 5:30 PM ccmsetup
> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>
>
> PS C:\Tmp> get-date
>
> Friday, September 15, 2006 5:47:12 PM
>
>
> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
> Volume Serial Number is E030-3171
>
> Directory of \\IT-TEST-MARTY07\Admin$\System32
>
> 09/15/2006 05:30 PM <DIR> CCM
> 09/15/2006 05:30 PM <DIR> ccmsetup
> 02/09/2006 02:50 AM 334,560 ccmcore.dll
> 1 File(s) 334,560 bytes
> 2 Dir(s) 14,756,823,040 bytes free
>
> PS C:\Tmp> get-date
>
> Friday, September 15, 2006 5:47:14 PM
>
>
>



My System SpecsSystem Spec
Old 09-22-2006   #4 (permalink)
=?Utf-8?B?SmFrZURBSFM=?=


 
 

Re: Slow reponse from UNC paths.

Is it possible in powershell to made it almost "bandwidth aware". Running
powershell on a unc path over a slow connection it's quite pleasant but
usable. I had tried before and I may be wrong, but when doing a dir, you
receive the same amount of data over the link as you would for a dir | fl *
to receive all the properties. It would be nice to have the option to
receive just teh partiticular properties for when working over these types of
links.

Either way powershell still rocks!

Jake



"Jeffrey Snover" wrote:

> I don't know what would cause that - please file a bug and we'll
> investigate.
>
> Jeffrey Snover [MSFT]
> Windows PowerShell/Aspen Architect
> Visit the Windows PowerShell Team blog at:
> http://blogs.msdn.com/PowerShell
> Visit the Windows PowerShell ScriptCenter at:
> http://www.microsoft.com/technet/scr.../hubs/msh.mspx
>

My System SpecsSystem Spec
Old 09-22-2006   #5 (permalink)
Marty List


 
 

Re: Slow reponse from UNC paths.


This seems to be happening more and more often. I filed a bug report, Feedback
ID 209412.

Thanks Alex for the suggestions. When I specify FileSystem:: it doesn't speed
it up at all. Using the IP address is just as slow as the name.

PS C:\> (Measure-Command {gci \\IT-07\Admin$\System32\CCM*}).TotalSeconds
47.9764379
PS C:\> (Measure-Command {Cmd.exe /c Dir
\\IT-07\Admin$\System32\CCM*}).TotalSeconds
0.1430669
PS C:\> (Measure-Command {gci \\IT-07\Admin$\System32\CCM*}).TotalSeconds
49.1268716
PS C:\> (Measure-Command {Cmd.exe /c Dir
\\IT-07\Admin$\System32\CCM*}).TotalSeconds
0.12824
PS C:\> (Measure-Command {gci
FileSystem::\\IT-07\Admin$\System32\CCM*}).TotalSeconds
48.9660212
PS C:\> (Measure-Command {Cmd.exe /c Dir
\\IT-07\Admin$\System32\CCM*}).TotalSeconds
0.1247816
PS C:\> ping.exe IT-07
Pinging IT-07.corp.net [10.199.3.36] with 32 bytes of data:
Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
Reply from 10.199.3.36: bytes=32 time<1ms TTL=124
Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
Ping statistics for 10.199.3.36:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
PS C:\> (Measure-Command {Cmd.exe /c Dir
\\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
0.2054981
PS C:\> (Measure-Command {gci \\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
49.1253122
PS C:\> (Measure-Command {Cmd.exe /c Dir
\\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
0.1636716
PS C:\> (Measure-Command {gci
FileSystem::\\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
51.3673883



"Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
news:%23mnhXDd2GHA.4476@TK2MSFTNGP02.phx.gbl...
> Marty,
>
> I'm guessing that this is due to a timeout in attempting to find the path by
> various means. You might want to try the following variations as tests (and of
> course, response may be affected by caching at various times):
>
> (1) Try the fully-qualified PSPath and see how response compares:
>
> Get-ChildItem FileSystem::\\IT-TEST-MARTY07\Admin$\System32\ccm*
>
> (2) To make testing the important aspects easier, try using Measure-Command
> (which returns a TimeSpan):
> (Measure-Command {gci ...}).TotalSeconds
>
>
> "Marty List" <usenet@optimumx.com> wrote in message
> news:%23$fWcKS2GHA.4924@TK2MSFTNGP05.phx.gbl...
>>
>> I've noticed that sometimes PowerShell takes almost a minute to access some
>> UNC paths, while other tools like cmd.exe and explorer.exe take 1 or 2
>> seconds. It's not all UNC paths, some are fast and some are slow.
>>
>> These machines are on the same subnet and this happens quite often, it's not
>> just a slow machine or a network problem. I also tested access times to the
>> same machine with another .NET 2.0 executable that I wrote, it was about 2
>> seconds.
>>
>> Take a look at the time differences between powershell.exe and cmd.exe:
>>
>>
>> PS C:\Tmp> get-date
>>
>> Friday, September 15, 2006 5:45:21 PM
>>
>>
>> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>
>> Directory:
>> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>>
>> Mode LastWriteTime Length Name
>> ---- ------------- ------ ----
>> d---- 09/15/2006 5:30 PM CCM
>> d---- 09/15/2006 5:30 PM ccmsetup
>> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>>
>>
>> PS C:\Tmp> get-date
>>
>> Friday, September 15, 2006 5:46:14 PM
>>
>>
>> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
>> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
>> Volume Serial Number is E030-3171
>>
>> Directory of \\IT-TEST-MARTY07\Admin$\System32
>>
>> 09/15/2006 05:30 PM <DIR> CCM
>> 09/15/2006 05:30 PM <DIR> ccmsetup
>> 02/09/2006 02:50 AM 334,560 ccmcore.dll
>> 1 File(s) 334,560 bytes
>> 2 Dir(s) 14,756,823,040 bytes free
>>
>> PS C:\Tmp> get-date
>>
>> Friday, September 15, 2006 5:46:16 PM
>>
>>
>> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>
>> Directory:
>> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>>
>> Mode LastWriteTime Length Name
>> ---- ------------- ------ ----
>> d---- 09/15/2006 5:30 PM CCM
>> d---- 09/15/2006 5:30 PM ccmsetup
>> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>>
>>
>> PS C:\Tmp> get-date
>>
>> Friday, September 15, 2006 5:47:12 PM
>>
>>
>> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
>> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
>> Volume Serial Number is E030-3171
>>
>> Directory of \\IT-TEST-MARTY07\Admin$\System32
>>
>> 09/15/2006 05:30 PM <DIR> CCM
>> 09/15/2006 05:30 PM <DIR> ccmsetup
>> 02/09/2006 02:50 AM 334,560 ccmcore.dll
>> 1 File(s) 334,560 bytes
>> 2 Dir(s) 14,756,823,040 bytes free
>>
>> PS C:\Tmp> get-date
>>
>> Friday, September 15, 2006 5:47:14 PM
>>
>>



My System SpecsSystem Spec
Old 09-25-2006   #6 (permalink)
Lee Holmes [MSFT]


 
 

Re: Slow reponse from UNC paths.

This is an issue that we are aware of, and will be trying to work around in
the future. It has a lot to do with the amount of detail that the .Net
Framework retrieves when you access the file.

This is the basic algorithm... you can see how the slow part is creating the
FileInfo to represent all of the data on the file:

$server = "\\IT-07\Admin$\System32\"
$all = [IO.Directory]::GetFiles($server) +
[IO.Directory]::GetDirectories($server)
$all | % { new-object System.IO.FileInfo $_ }


--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Marty List" <usenet@optimumx.com> wrote in message
news:OCuoXDq3GHA.1252@TK2MSFTNGP04.phx.gbl...
>
> This seems to be happening more and more often. I filed a bug report,
> Feedback ID 209412.
>
> Thanks Alex for the suggestions. When I specify FileSystem:: it doesn't
> speed it up at all. Using the IP address is just as slow as the name.
>
> PS C:\> (Measure-Command {gci \\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 47.9764379
> PS C:\> (Measure-Command {Cmd.exe /c Dir
> \\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 0.1430669
> PS C:\> (Measure-Command {gci \\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 49.1268716
> PS C:\> (Measure-Command {Cmd.exe /c Dir
> \\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 0.12824
> PS C:\> (Measure-Command {gci
> FileSystem::\\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 48.9660212
> PS C:\> (Measure-Command {Cmd.exe /c Dir
> \\IT-07\Admin$\System32\CCM*}).TotalSeconds
> 0.1247816
> PS C:\> ping.exe IT-07
> Pinging IT-07.corp.net [10.199.3.36] with 32 bytes of data:
> Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
> Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
> Reply from 10.199.3.36: bytes=32 time<1ms TTL=124
> Reply from 10.199.3.36: bytes=32 time=1ms TTL=124
> Ping statistics for 10.199.3.36:
> Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
> Approximate round trip times in milli-seconds:
> Minimum = 0ms, Maximum = 1ms, Average = 0ms
> PS C:\> (Measure-Command {Cmd.exe /c Dir
> \\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
> 0.2054981
> PS C:\> (Measure-Command {gci
> \\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
> 49.1253122
> PS C:\> (Measure-Command {Cmd.exe /c Dir
> \\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
> 0.1636716
> PS C:\> (Measure-Command {gci
> FileSystem::\\10.199.3.36\Admin$\System32\CCM*}).TotalSeconds
> 51.3673883
>
>
>
> "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
> news:%23mnhXDd2GHA.4476@TK2MSFTNGP02.phx.gbl...
>> Marty,
>>
>> I'm guessing that this is due to a timeout in attempting to find the path
>> by various means. You might want to try the following variations as tests
>> (and of course, response may be affected by caching at various times):
>>
>> (1) Try the fully-qualified PSPath and see how response compares:
>>
>> Get-ChildItem FileSystem::\\IT-TEST-MARTY07\Admin$\System32\ccm*
>>
>> (2) To make testing the important aspects easier, try using
>> Measure-Command (which returns a TimeSpan):
>> (Measure-Command {gci ...}).TotalSeconds
>>
>>
>> "Marty List" <usenet@optimumx.com> wrote in message
>> news:%23$fWcKS2GHA.4924@TK2MSFTNGP05.phx.gbl...
>>>
>>> I've noticed that sometimes PowerShell takes almost a minute to access
>>> some UNC paths, while other tools like cmd.exe and explorer.exe take 1
>>> or 2 seconds. It's not all UNC paths, some are fast and some are slow.
>>>
>>> These machines are on the same subnet and this happens quite often, it's
>>> not just a slow machine or a network problem. I also tested access
>>> times to the same machine with another .NET 2.0 executable that I wrote,
>>> it was about 2 seconds.
>>>
>>> Take a look at the time differences between powershell.exe and cmd.exe:
>>>
>>>
>>> PS C:\Tmp> get-date
>>>
>>> Friday, September 15, 2006 5:45:21 PM
>>>
>>>
>>> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>>
>>> Directory:
>>> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>>>
>>> Mode LastWriteTime Length Name
>>> ---- ------------- ------ ----
>>> d---- 09/15/2006 5:30 PM CCM
>>> d---- 09/15/2006 5:30 PM ccmsetup
>>> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>>>
>>>
>>> PS C:\Tmp> get-date
>>>
>>> Friday, September 15, 2006 5:46:14 PM
>>>
>>>
>>> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
>>> Volume Serial Number is E030-3171
>>>
>>> Directory of \\IT-TEST-MARTY07\Admin$\System32
>>>
>>> 09/15/2006 05:30 PM <DIR> CCM
>>> 09/15/2006 05:30 PM <DIR> ccmsetup
>>> 02/09/2006 02:50 AM 334,560 ccmcore.dll
>>> 1 File(s) 334,560 bytes
>>> 2 Dir(s) 14,756,823,040 bytes free
>>>
>>> PS C:\Tmp> get-date
>>>
>>> Friday, September 15, 2006 5:46:16 PM
>>>
>>>
>>> PS C:\Tmp> gci \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>>
>>> Directory:
>>> Microsoft.PowerShell.Core\FileSystem::\\IT-TEST-MARTY07\Admin$\System32
>>>
>>> Mode LastWriteTime Length Name
>>> ---- ------------- ------ ----
>>> d---- 09/15/2006 5:30 PM CCM
>>> d---- 09/15/2006 5:30 PM ccmsetup
>>> -a--- 02/09/2006 1:50 AM 334560 ccmcore.dll
>>>
>>>
>>> PS C:\Tmp> get-date
>>>
>>> Friday, September 15, 2006 5:47:12 PM
>>>
>>>
>>> PS C:\Tmp> Cmd /c Dir \\IT-TEST-MARTY07\Admin$\System32\CCM*
>>> Volume in drive \\IT-TEST-MARTY07\Admin$ has no label.
>>> Volume Serial Number is E030-3171
>>>
>>> Directory of \\IT-TEST-MARTY07\Admin$\System32
>>>
>>> 09/15/2006 05:30 PM <DIR> CCM
>>> 09/15/2006 05:30 PM <DIR> ccmsetup
>>> 02/09/2006 02:50 AM 334,560 ccmcore.dll
>>> 1 File(s) 334,560 bytes
>>> 2 Dir(s) 14,756,823,040 bytes free
>>>
>>> PS C:\Tmp> get-date
>>>
>>> Friday, September 15, 2006 5:47:14 PM
>>>
>>>

>
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
script to POST and open reponse in new window VB Script
Long paths VB Script
How do I put a saveto name from a reponse object .net .NET General
Looking for function to resolve VirtualStore paths to physical paths Vista file management
Looking for function to resolve VirtualStore paths to physical paths Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46