Really slow preparing while uploading many files (photos)

Im trying to upload 1GB file trought SFTP in my NextCloud panel.

It will upload, then it will start “processing” (writing file to SFTP server)
In a short time it will show this error. Maybe do i need to make bigger cache in PHP?

image
image

I have added timeout to 2400s if it wont be there, it will just tell 504 timeout

It has uploaded 229 525KB out of 927 083 KB to SFTP server

Really slow preparing when i want upload photod or files to the server trought SFTP. The upload speed is around from 100KB to 4MB, when i connect from WinSCP the upload speed is around 20MB. Plus it take 3-6sec to load the dir on the site.