-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase chunk transfer size for iRODS #6004
Conversation
Can one of the admins verify this patch? |
Future ways to improve this:
|
@brainstorm Thanks a lot for your contribution! Alternatively you can add a comment here where you state that this contribution is MIT licensed. |
@owncloud-bot this is okay to test |
@@ -201,7 +201,8 @@ public function readfile($path) { | |||
@ob_end_clean(); | |||
$handle = $this->fopen($path, 'rb'); | |||
if ($handle) { | |||
$chunkSize = 8192; // 8 kB chunks | |||
//$chunkSize = 8192; // 8 kB chunks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation seems off here - we use tabs -THX
Guys can I just merge this and open another issue with #6004 (comment) ? As it is now it is just embarassingly slow and quite unusable. |
definitely: NO! We are in release candidate mode and this pull request touches core mechanisms (changing block sizes). The impact is still to be analysed. 👎 sorry |
PHP has no threading concept - nothing we can do here
PAM has been implemented and tested early this year |
Regarding PAM, I was referring to a recent patch that affects iRODS 3.3 and PRODS, from the link in the tasklist above, I can incorporate/sync this one myself later on:
Regarding threading, what about this one?: http://php.net/manual/en/book.pthreads.php |
Due to the requirements as listed here I don't see this as a reasonable approach: http://www.php.net/manual/en/pthreads.requirements.php This would only make sense if it can be implemented as an option and not as a hard requirement. |
I see - THX |
if ($fh) { | ||
// override the default 8k php stream chunk | ||
// size for non-file streams. | ||
stream_set_chunk_size($fh, 1024*1024); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get the chunk file size from a stream? then we can use that size for readFile
and streamCopy
and remove the need to hardcode the new values there.
I’m closing this pull request for now as @brainstorm didn’t comment or update this in 4 months. @brainstorm you can always reopen or update the pull request. :) Improvement on this matter is very welcome, but as @DeepDiver1975 mentioned we have to properly test it before merging. |
Hello Brainstorm, I reacted on our blogpost about the owncloud - irods integration, but cannot change the spelling faults I made by accident. Is it possible to correct these? |
Hey guys, Roman just pointed me to this. I'm at the DICE group over at UNC and work on iRODS. I told Roman I could help you guys get the iRODS PHP API and streaming performance squared away. That PHP code is a little long in the tooth so I think there's headroom to make streaming i/o better on the PHP side. Cheers |
While testing the iRODS extension, I noticed that the transfer rates were suboptimal. Tracing with
strace
revealed a 8kb chunk size when transferring a2.5GB
file filled with zeros:Actual data packets being sent by process id 3009 above (with a single apache thread), those messages appear every 0.5 seconds with a payload of 8192 bytes each:
Before the patch it took around 24h to upload. After this patch, the transfer takes less than an hour.
With native iRODS
iput
commands, the transfer takes around 1minute, so there's still room for improvement.Thanks to @cansmith and @DeepDiver1975.