You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey
I do have a NAS (from Hitachi) where I started to suffering about the slow writings. Single line into the text file could take seconds to get completed. After some troubleshooting efforts I found a way to test this in more control way.
If I run the command: 1..3000 | % { Add-Content -Value "abcdefghijklmn0123456" -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }
And then on another PS session do: 1..20 | % { $time = Measure-Command -Expression { Get-ChildItem x:\temp\d* }; write-host "$($time.seconds)s $($time.Milliseconds)ms" ; Start-Sleep -Seconds 1 }
Add-content is the method what I have been using. But then I tested alternatives: 1..3000 | % { "abcdefghijklmn0123456" | Out-File -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }
And 1..3000 | % {Remove-Item -Path x:\temp\DebugSlow.txt ; Add-Content -Value "abcdefghijklmn0123456" -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }
I found out that with these, there were no slowness on the get-childitem.
I have also tested this with windows share as well, and that did not had similar slowness.
The “remove-item” test came from my colleague, as he thought this could have something to do with the seek till EOF on the add-content. If I delete the file, then there is no seek required.
To get better understanding how the PS is working, I would like to ask if anybody in here might know what might be causing the slowness on the add-content when accessing UNC share on NAS?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey
I do have a NAS (from Hitachi) where I started to suffering about the slow writings. Single line into the text file could take seconds to get completed. After some troubleshooting efforts I found a way to test this in more control way.
If I run the command:
1..3000 | % { Add-Content -Value "abcdefghijklmn0123456" -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }And then on another PS session do:
1..20 | % { $time = Measure-Command -Expression { Get-ChildItem x:\temp\d* }; write-host "$($time.seconds)s $($time.Milliseconds)ms" ; Start-Sleep -Seconds 1 }I was able to get times like:
Add-content is the method what I have been using. But then I tested alternatives:
1..3000 | % { "abcdefghijklmn0123456" | Out-File -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }And
1..3000 | % {Remove-Item -Path x:\temp\DebugSlow.txt ; Add-Content -Value "abcdefghijklmn0123456" -Path x:\temp\DebugSlow.txt; Start-Sleep -Milliseconds 300 }I found out that with these, there were no slowness on the get-childitem.
I have also tested this with windows share as well, and that did not had similar slowness.
The “remove-item” test came from my colleague, as he thought this could have something to do with the seek till EOF on the add-content. If I delete the file, then there is no seek required.
To get better understanding how the PS is working, I would like to ask if anybody in here might know what might be causing the slowness on the add-content when accessing UNC share on NAS?
Beta Was this translation helpful? Give feedback.
All reactions