-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Remove memory and upload PHP settings #13990
Conversation
@J0WI: Would like you to take a peek as well, since this relates to nextcloud/docker#568 |
I just noticed that the issue does not exist when changing the upload limit. After some research I found this: server/lib/private/IntegrityCheck/Checker.php Lines 183 to 227 in 72e745b
I think it's worth to add an exclusion for |
Seems like a lot of coding/work when those values could just be eliminated from the configuration files to begin with. Would be interested in knowing why it is so important for them to be there, versus expecting a properly configured PHP before running Nextcloud? |
@rullzer I wonder if the integrity check for this file is still useful if any value can be overwritten on the very end of the |
I think the best way to cope with this is a config-setting. the priority seems rather low, but big instances might want to use more than 512 mb ram and want to be bleeding-edge, so you always have to rewrite this after some minor update every month and there is always a chance that you forget about it. something like this: nextcloudStandardServerParameters -> true; = leave the settings as nextcloud says Thinking again about this issue, it's 512 mb per session and not for the whole server, the only thing I think off a user would need more than this is writing a .pdf that has 100 pages or more. I guess onlyoffice uses other config-settings so this part of the issue seems to be easily tolerable. |
I apologize for repeating myself, but for my own educational benefit could someone address my last question? This seemingly simple issue seems to be more complex than it appears, and I'm assuming there's a good reason for that. |
I stuck with the same question in #8207 (comment). |
It's just another approach to solve the problem, I personally don't think it's a good approach and far from best practice, but not everything can have a valueable design from the start on, and it's easy to judge now. I guess it seemed a good idea to some people when it was implemented. In this case I'd like to reference to: "Computers will never need to have more than 640kb or ram. |
Thanks for explaining. I'm honestly not too concerned with the history of it, I realize software changes and code rots. The main thing I wanted to make sure of is that it didn't have any importance in today's code. Sounds like it's not critical. This is important to understand, because so far it feels like a lot of effort is being put into keeping the settings and working around them. To me, this is just contributing to the original issue (code rot). I prefer the straightforward approach: Remove them. The biggest harm I can think of that this causes is that users that do not currently have a Given the discussion up to this point, and the simplicity of the issue, I still feel that my current pull request represents the desired changes from my point of view. Unless there are serious concerns, I'd like us to merge the changes I have without changing (specifically: over-complicating) the solution/strategy. Making this change would enable the Nextcloud Docker project to proceed with changes enabling us to more directly control the PHP configuration settings of the instance without modifying files in the working directory. There's just no other reasonable workaround IMHO. Since I'm still pretty unfamiliar with the project, could someone let me know which individuals are key for approval to get this merged? I'd like to get discussion going so we can come to a consensus. Really hoping we keep this simple, though. Thanks! |
Best guess ;-) owncloud/core#10992
Shipping a sane default is not a bad in general but i agree with you at this point. There should be a setup check (or better a check before the setup) like "you are running nextcloud with insufficient php/webserver settings. things will not work". Lines 627 to 637 in 0bb55f4
Here is another issue with a similar topic #10082. |
@danielkesselberg Looks like we replied within seconds of each other :-) Bearing in mind I prefer an iterative approach (address the issue in small chunks of work), what would you recommend in terms of getting this merged? Basically, I don't want to dive too much into coding PHP for this. I agree it is a good idea to have the start up checks, but they don't seem mandatory to me. This might be due to my inexperience with the project and PHP in general, but to me the PHP settings are just part of the environment. And when I think of installing a piece of server software, I always assume some manual configuration of the environment is necessary. Things like setting proxy settings, memory limits, max upload sizes, etc. Making Nextcloud set these up for you or warn about them seems more supplementary: It's a defensive mechanism. Again, I'm most likely naive here, but that's my thought. Regardless, if you are OK with it, I'd like to merge this first and then open another issue to discuss potential changes to start up checks to either proactively set defaults or warn about configuration issues, assuming you are suggesting those additions are desired. I honestly feel like getting rid of these settings is an easy decision, while making start up more robust in their absence something that will require a more complex strategy and more discussion. On top of that, there are LOT of open issues and pull requests, so you guys are obviously spread thin. Keeping PRs small and manageable will greatly help here. Let me know if I'm off track. Thanks again. |
👍
I would vote for a setup check (look at this as a start #12824).
|
i got another suggestion that the code could nearly stay the same, is it possible to use config-settings in user.ini and .htaccess? That way you could keep the standard settings and just deactivate them with the config. Another possible way is to write a bash- or occ-script that you use after each update. Still the config-setting-way would be the smartest to respect all opinions if it's possible. |
I haven't read fully through this ticket, but want to leave a not first, before coming back to this ticket later: The limits are in here to make them available on as many systems as possible out of the box. IMO they still make sense for many instances, but as you described they could also unintentionally overwrite system settings that are there for a specific reason. One way would be to check for the current values and only set them in the .htaccess if they are not on a useful value. This then would be added here: Lines 491 to 502 in b9f2ce2
Maybe also this dynamic setting can be turned off in config.php. But this would only be a last resort if the automatic way is completely impossible. |
Yeah add even more complexity! |
What is the strategy for trying to make environment configuration as automatic as possible? This, as seen so far, has mixed results. The whole idea of things being environment-specific is that it's very unlikely for any two environments to be 100% identical. Different network specifications, different hardware, different geographical locations. There's so many parts that interleave and play together to make this kind of automation self-defeating. I think it's worth balancing turn-key features with the costs and benefits. In this case, requiring users to configure PHP (which AFAIK most PHP applications already require) with a few basic settings is less of a burden than complex defensive mechanisms written in software that only work for a few select range of environment types. I realize I'm the newbie here so I apologize for being so opinionated. I by no measure feel like I have enough experience with Nextcloud to say all of this with complete confidence. But my driving philosophy as an engineer is to keep it simple, and in this case I just don't see the benefits for the cost in this case. Of course, even having said all of that, I'm willing to do whatever (within reason) to get us past the issue. If you guys want to over-engineer this, I might have to hand off the task to someone with more experience. My original intent was to minimize change and complexity. If we're all in agreement, I'll go ahead and amend my PR with the start up checks suggested by @danielkesselberg. Is this acceptable @MorrisJobke? I'd like your buy off before I do work that ends up getting rejected. Let me know. Thanks for the quick turnaround in the discussion guys, I really appreciate it. |
I fully get this. The idea is to have as few as possible need for manual configuration as possible. But as you said: the PHP memory limit and the upload size is tricky due to the many moving parts. Then also I had another idea: we should make it a setup check and realized (due to not reading all of this before) that @danielkesselberg already proposed it:
I'm fine with dropping those values and at the same time add a setup check that gives a warning in the admin settings that the memory limit or upload size is potential low together with a hint how to fix it. |
If we advice people to adjust the limits in |
in Line 491 in b9f2ce2
The reason why the values are in there, is that you can modify them via this method: server/lib/private/legacy/files.php Lines 381 to 461 in 79d9841
The UI is still there in All things taken into account, I would propose:
|
Which is also not needed anymore because we support chunking on all platforms (except native WebDAV coming from Windows/macOS, but there is very little we can do here anyways).. |
And yes - the 4 steps that @nickvergessen described are the way to go and should come in one PR IMO. |
Because memory & file size limitation settings are specified in the local configs, they override any values in the global `php.ini` on the system. Because of this, it's impossible to, for example, increase the memory limit of Nextcloud without touching its own configuration/source files. These settings are removed in favor of the `php.ini` settings. The justification for not having these settings specified strictly by Nextcloud is that they are variant. In other words, their values are environment-dependent, and especially dependent on the content hosted by Nextcloud itself. For example, hosting lots of images and thumbnails frequently causes memory issues. Signed-off-by: Robert Dailey <rcdailey@gmail.com>
18d5a96
to
a4ec27c
Compare
Thanks for all the guidance. I'm temporarily rebasing to |
Can I get some advice on how to test and run the server on Windows for development? All I really do is use VS Code to edit the source, but I really don't want to have to muck with my home Nextcloud server for testing. Can I easily run the PHP server on my Windows 10 machine somehow for debugging and testing? Do you have a developer guide somewhere? I'm not a PHP developer, so I'm sure there's some basics I'm not aware of. Greatly appreciate any time you guys can take to help point me in the right direction. |
I'd use docker, its an easy way to get started quick, depending on what you want to do choose a nginx (needs less performance) or apache 2.4 (can be configured better and can easy use gssapi). I'd look for an image with seperated postgres or mariadb. The splitted php-fpm isnt necessary for local testing. I wonder what you want to do without knowledge of php, php is no rocket science, still you should know a bit about webcoding before you start. Maybe lookup onlineblogs of ppl customizing joomla or nextcloud modules to get started. |
Thanks for the tips! By the way I never said I didn't know about web development, I just haven't used PHP tech before. I have done web servers in Java & C++ before though. So I have a general idea of the topography/structure. Just needed some PHP-tech-specific advice. |
Sorry for the troubles @rcdailey |
Only reason I'm really offering to do the work instead of your team is because it seemed apparent to me that either 1) this isn't a high priority in your list or 2) you don't have the resources to work on it Obviously, if your team did the work, it would be done most optimally since you know the code base better than I do. However, I'd rather it get done than sit in open status for a long time, so I'm working through the learning curve. If you have the bandwidth to work on this, obviously I'd be very grateful to have your help. However, if not, I'll do my best to contribute what I can. I know I'm already taking up a lot of your time for the guidance. I'll try docker containers on Windows to see if I can test this. It will take a while to set up, but I think I can get it to work. Let me know if you want to take this over in the next week or two. If so, I'll let you do the work. Otherwise, if either of the 2 points above apply, I'm happy to pitch in. Thanks! |
The main reason I'm asking is that 22nd february (upcoming friday) marks the feature freeze for Nextcloud 16, so if it is not in by then, it will have to wait until Nextcloud 17: |
Oh, sadly since I'm working on this with whatever little free time I have, I won't be done by then :-( If you can go ahead and take this over and get it done before then, that'd be excellent. Is that possible for you? So far I started down the rabbit trail of removing |
Maybe I look into this until then. |
@MorrisJobke How are things going? Did we miss the release train? |
Just noticed that this is against 15 - we first need it in master and then decide on if this is back ported. Do you mind to do a PR against master? For 15 the freeze was already over 1 week ago, so it would be anyways. |
@MorrisJobke 15 only because that's what I'm running. Given the scope of change currently proposed, I wouldn't suspect this is appropriate as a "hotfix" to an otherwise stable release. I'm OK with this being in version 16, I can upgrade to that when it comes out. At the end of the day it's up to you how you want to manage the release of this. I'll follow whatever you decide. I only rebased this to |
Superseeded by #14430 |
Because memory & file size limitation settings are specified in the local configs, they override any
values in the global
php.ini
on the system. Because of this, it's impossible to, for example,increase the memory limit of Nextcloud without touching its own configuration/source files.
These settings are removed in favor of the
php.ini
settings. The justification for not havingthese settings specified strictly by Nextcloud is that they are variant. In other words, their
values are environment-dependent, and especially dependent on the content hosted by Nextcloud
itself. For example, hosting lots of images and thumbnails frequently causes memory issues.