|  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: -
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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
16 + 6 = ?
Subscribe to this entry?

 [2015-12-07 15:47 UTC] oytuntez at gmail dot com
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.

- 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;


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jan 31 07:05:53 2023 UTC