php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71052 Improvement: file operations 3 times slower than Linux on GlusterFS mount
Submitted: 2015-12-07 15:47 UTC Modified: -
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: oytuntez at gmail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.6.16 OS: Amazon Linux AMI 2015.09
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: oytuntez at gmail dot com
New email:
PHP Version: OS:

 

 [2015-12-07 15:47 UTC] oytuntez at gmail dot com
Description:
------------
Purpose: move a file from local mount to a GlusterFS mount.
File: 16MB XML.

Vanilla PHP operation: use `rename()` to move the file.
Linux command: shell_exec("mv '$sourcePath' '$targetPath'")

Note: My glusterFS mount has a terrible performance at the moment, writes usually around 2MB/s, so it is making a good testing environment for read/write operations.

Result:
- PHP rename() takes about 56.2257 seconds to move the file.
- Linux command via shell_exec takes 15.8680s.


The latter takes 3.5433 less time than PHP's rename().

Test script:
---------------
$path1 = '/tmp/1220631606.xliff';
$path2 = '/gluster_mount/'.rand();

$start = microtime(true);
rename($path1, $path2);
$end = microtime(true);

echo 'rename time: '.($end-$start).PHP_EOL;

$start = microtime(true);
shell_exec("mv '".$path1."' '".$path2."'");
$end = microtime(true);

echo 'shell_exec time: '.($end-$start).PHP_EOL;


Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 09:01:29 2024 UTC