question

laggyluk avatar image
laggyluk asked

is there a way to speed up asset upload through powershell?

When creating build via web manager the asset upload is way faster compared to doing it via powershell (12Mb vs 2,5Mb stated by Task Manager) any way to speed this up?

game manager
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Could you please clarify how you monitor the asset upload time using task manager? As far as we know, the Network I/O speed displays in the task manager can’t be accurate to the certain http request. It is unsuitable for measuring the speed of uploading files. If you want to get the time every request spends, you can use the http capture tools to do the traffic capturing, then check their time info.

The assets upload essentially is using the PUT request to create the new resource. The operation that executed in the browser and PowerShell are the same. In our testing, the types of platform the request is sent from does not affect the request time. The upload speed fluctuates according to the current network speed.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

laggyluk avatar image laggyluk commented ·

I just noticed it takes way longer to upload through powershell, around 5-6 times longer. Accurate or not.

here's my experiment recorded:

https://youtu.be/HMCCDXT4nbc

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang laggyluk commented ·

Thanks for the clarification, we tested the simple uploading logic using PowerShell, the upload time would be close to the upload time when using Game Manager. The testing code could be something like this.

$uri ="[AssetUploadUrl]"
$headers = @{"x-ms-blob-type" ="BlockBlob"}
$body = Get-Content("D:\\ GameServer.zip")
Invoke-WebRequest -Uri $uri -Method Put -Headers $headers -Body $body

The long running time of "Add Asset" should be caused by other code logic. You can find the source code of MultiplayerPowershell here, and modify and recompile it in need to speed up the uploading time.

0 Likes 0 ·
laggyluk avatar image laggyluk Sarah Zhang commented ·

Ok, thanks. Didn't have a chance to test it yet.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.