Skip to content
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

PHP memory should be unlimited in scripts that need more memory than the default #2712

Closed
YongBoLiu opened this issue May 29, 2019 · 2 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@YongBoLiu
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

The hard code of set memory_limit need to be removed. The hard code make user can't change the memory limit value in /etc/php.ini. And lead to errors as below,

ERROR PHP ERROR: Allowed memory size of 536870912 bytes exhausted

To Reproduce
Steps to reproduce the behavior:

  1. Monitoring a large number of devices with more 354k graphs.
  2. Check the Clog.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
The hard code is not good solution, and make the value in /etc/php.ini not work. The lines of below, need to be removed.

[yboliu@oc8636837557 cacti]$ grep -R ini_set.*memory_limit . |grep -Ev plugin|grep -Ev '\-1'|grep -Ev read_config_option |grep memory_limit
./poller_commands.php:ini_set('memory_limit', '800M');
./install/cli_check.php:ini_set('memory_limit','256M');
./poller_spikekill.php:ini_set('memory_limit', '512M');
./include/vendor/phpsnmp/mib_parser.php:		ini_set('memory_limit', '256M');
./cmd.php:ini_set('memory_limit', '512M');
./poller.php:ini_set('memory_limit', '512M');
./lib/import.php:		ini_set('memory_limit', '384M');
@cigamit cigamit added bug Undesired behaviour resolved A fixed issue labels May 30, 2019
cigamit added a commit that referenced this issue May 30, 2019
The hard code of set memory_limit need to be removed
@netniV
Copy link
Member

netniV commented Jun 2, 2019

My only concern with this is that it will allow PHP to consume all available memory which means that the CMD.PHP and POLLER.PHP could both invoke a bad user script that eats the resources.

@netniV netniV changed the title The hard code of set memory_limit need to be removed PHP memory should be unlimited in scripts that need more memory than the default Jun 2, 2019
@rprofijt
Copy link

rprofijt commented Jun 3, 2019

We have this patched locally because we have a plug-in that exceeds the amount in poller.php, this was very confusing because in my opinion the limit should be set in php.ini, I'm glad with this change :)

@cigamit cigamit closed this as completed Jun 8, 2019
@netniV netniV added this to the v1.2.4 milestone Jun 8, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants