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: 2025-01-18 22:16 UTC
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: bukka (profile)
Status: Not a bug Package: Filesystem function related
PHP Version: 5.6.16 OS: Amazon Linux AMI 2015.09
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2025-01-18 22:16 UTC] bukka@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: bukka
 [2025-01-18 22:16 UTC] bukka@php.net
Apology for long silence. This might be quite hard recreate and lots of things have changed so I will close this but if this is still an issue with new PHP and GlusterFS version, please open a new GitHub issue and it should get picked up this time.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 26 09:01:30 2025 UTC