0

I'm using the Flysystem mount manager to create a sync strategie.

My code is based on the example on the website. But I've made a little change, I use

$manager->put(
    'local_process://my_big_file',
    $manager->readStream('distant://my_big_file') //Notice the stream
);

And tried to sync a files of 1Go. It's working fine but take up to nearly 200 seconds to sync the file.

My question here is: Is it possible to optimize my server configuration (or code?) to reduce the amount of time needed to sync this file?

I've read this article and based on the Nagle's algorithm, I've tried to increase my output_buffering in my php.ini config. But 4096, 8192, 16384 or even true (my memory limit is 126M) does not make any difference.

Should I try something else, or is it just the best that I can have with PHP?

Atnaize
  • 1,766
  • 5
  • 25
  • 54
  • To write streams you should use `$manager->putStream`. It could also be a result of the underlying adapter, which one are you using? – Frank de Jonge Sep 11 '18 at 07:29
  • I'm using this between a `LocalAdapter` and a `SftpAdapter`. And yes since I use `putStream` the result is better – Atnaize Sep 12 '18 at 08:14

0 Answers0