-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable large file support (on 32bit systems) #839
Conversation
I tried to find some reference to actual "large file" support in PHP, and the best I found was https://bugs.php.net/bug.php?id=45942, wherein https://bugs.php.net/bug.php?id=45942#1220036600 especially makes me worried about enabling this:
I'm not sure where to look for further details on this (especially curious is the "it is known" bit -- known where and to whom? the upstream developers in general?) 😕 😞 |
The last comment says:
I did not notice any performance losses. As far as I understand _FILE_OFFSET_BITS, it is more like a "hack" with some edge cases. |
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.
LGTM
This comment has been minimized.
This comment has been minimized.
This is not a general solution to the problem, and it is actively discouraged by PHP maintainers. As such, I'm closing this PR. Thanks for the contribution and the constructive dialogue/research, @tristanlins! If you find a better solution the PHP developers aren't opposed to, please let us know. 👍 |
I'm okay with this. It is a limitation of 32bit architecture. |
@tianon It was last one chance for all Raspberry Pi and other boards. My nextcloud on Odroid HC2 still can not share files over 2Gb 😢 |
Since the Raspberry 2 Mod. B v1.2 an ARMv8 64bit CPU is installed. |
Yes and no. Modern Raspberry Pi boards have 64-bit CPU, but still 32-bit OS.
And now here is no stable 64-bit OS for Raspberry in case of proprietary CPU. |
As I said, it should be able. |
@tianon from official PHP documentation:
https://www.php.net/manual/en/intro.filesystem.php Please, review. We need it! |
That's a positive sign for sure, although this comment still worries me: https://bugs.php.net/bug.php?id=45942#1323467326
|
I can not confirm that setting the option leads to a fundamental slowdown. But for certain commands, e.g. file access is likely to lead to a slowdown. Whether it is really consistently 50%, but I think that is questionable. |
@tianon @tristanlins it does not affect performance. |
I run into some problems, with nextcloud on my odroid xu4 (arm32v7) and storing large files (more then 7gb) in the cloud. PHP failed with "failed to open stream: Value too large for defined data type" errors. There are some people out there, having similar problems (like nextcloud/server#1707 or nextcloud/docker#613).
When PHP is compiled with
CFLAGS="-D_FILE_OFFSET_BITS=64"
(Documentation) it is able to open large files on 32bit systems.I tested it successfully with the stretch variant (build the official nextcloud image against a modified version of the php 7.3 stretch image). My nextcloud is now able to sync and deliver files larger than 4gb.
There are still a lot of 32bit systems out there.
Especially SoC board like raspberry pi (up to model 2) or odroid xu4.
The patch is fully forward compatible, since the FILE_OFFSET_BITS does not have any effects on 64bit systems: