Re: [Tiki-devel] Tiki memory limit for console commands
Victor Emanouilov via TikiWiki-devel <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks Jonny. I committed a fix to allow cli commands to run without a
limit if these are the system settings.
Regards,
Victor
On 1/20/21 6:39 PM, Jonny Bradley via TikiWiki-devel wrote:
> Hi Victor
>
> That does sound wrong/odd, but looks like it was always like - i would have thought it should be something more like:
>
> $memory_limiter = new Tiki_MemoryLimit(ini_get('memory_limit'));
>
> It arrived with the rest of the memory limit stuff by LPH in 2012 in this commit https://gitlab.com/tikiwiki/tiki/-/commit/dfa3fc40 when i guess 128M seemed like a reasonable size (and is actually what i still run all may tikis on, by the way). The global $memory_limiter is never used as far as i can see anyway...
>
> Anyone else know better?
>
> jonny
>
>
>
>
>> On 19 Jan 2021, at 14:28, Victor Emanouilov via TikiWiki-devel <[email protected]> wrote:
>>
>> Hi all!
>>
>> Does anybody know why tiki-setup_base.php imposes memory limit of 128MB by default:
>>
>> $memory_limiter = new Tiki_MemoryLimit('128M'); // Keep in variable to hold scope
>>
>> even for console commands where default PHP memory limit is -1 (i.e. no limit)? Seems like an error in Tiki_MemoryLimit class:
>>
>> if (self::toBytes($this->initialLimit) < self::toBytes($target)) {
>>
>> This is always true when current php memory limit is -1 and thus enforcing for all console commands. We have some options for specific memory limits for index rebuilding but this is not scalable - now I need an option for machine learning model training...
>>
>> so, one way to fix is keep the default memory limit for console commands UNLESS anybody knows a good reason why we limit it now. Hard-coding a limit like this also prevents us to run console commands with specific limit on the command line, e.g. `php -d memory_limit=256M console.php ...`
>>
>> The other way to fix is make a generic option for memory limit for console commands but honestly, I hate adding even more options to the enormous control panel.
>>
>> What do you think?
>>
>> Regards,
>> Victor
>>
>>
>>
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>
>
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel