DirectAdmin + OpenLiteSpeed. PHP running out of memory
Hello.
I'm getting this errors despite I've increased PHP's memory_limit:
PHP Fatal error: Out of memory (allocated 10485760) (tried to allocate 40960 bytes) in...
Server has enough memory.
I'm running DA + OLS + PHP 7.4 + MariaDB. Wordpress with OLS Cache.
I've read about soft and hard memory limit, but documentation says panel is read-only.
Tagged:
Comments
When you say you've increased the memory limit, have you confirmed it's being reflected at a website level? I've had cases of this before where it was meant to have changed but the end site was still seeing the old value?
Often there is one service that wasn't restarted or failed to reload the configuration when this kind of problem happens after a configuration change.
https://clients.mrvm.net
Maybe same issue/bug we discovered, @MikePT ?
Got that error despite having lots of free mem ...
What version of OLS are you running?
Ok this is crazy. I thought the setting was being applied but no.
memory_limit is:
I can't see any .htaccess or .user.ini making changes for the directory of the domain. php_info() confirms I'm editing the correct file.
reload php?
https://clients.mrvm.net
From the DA control panel you can change the php.ini setting and it will rewrite the domain OLS config file
Already done that.
I can't find that section in DA.
I saw an update for PHP under CustomBuild and I did it. New memory_limit has been applied correctly.
Strange.
[STDERR] PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 20480 bytes)
Errors not fixed yet
I don't know about OLS but on my DA server as an end user it's under Extra Features > Select PHP version then within the PHP selector there's an "Options" tab which has the memory limit value in there. This may well be limited by reseller/admin values.
I don't have that option. That PHP selector sounds like CloudLinux. I'm using CentOS 7.
To reload php.ini I have to rebuild PHP :O Whhyyy?
How do you know this? (Just to make sure there is memory available.)
Anyways, there is a php.ini setting under custom build > edit config.
You can also check if you get the same error with another php version or rebuild php.
And there were some issues with PHP 7.3+ and OLS on DA since 8.0 was added iirc.
Even with memory_limit = 512MB I can see OOM logs.
Just a general view from htop.
Nothing. I can edit the php.ini via terminal but new config takes effect only after I rebuild PHP.
Is it not under update software configuration?
"Update PHP configuration files: Updates php.ini configuration files used by PHP. WARNING: Any customizations done will be lost."
Michael
That's for restoring default config.
do you have a pm.max_children="xx" some where?
edit: alright maybe unrelated
I bench YABS 24/7/365 unless it's a leap year.
It applies for php-fpm. OLS uses lsphp
Yes, I was telling @Mr_Tom
Michael
I've checked another server (without DA) and it looks like lsphp is running in detached mode by default. So reloading OLS won't restart lsphp, I have to do it manually. I will have to change that config on the DA server too.
It does not explain the OOM though.
If you want to increase the hard and soft memory limits, you will need to make the changes in the httpd-phplimits.conf file. Follow these commands to make a carbon copy of the file in the custom folder.
Then you will need to edit the memSoftLimit and memHardLimit to your choosing. For example, you can change the default from 2047M to 3047M.
Once you have made the changes rebuild the vhost config files using the ./build rewrite_confs command. Once you have rebuilt the vhosts, log into your OLS dashboard and select Server Configuration > External Applications. Now check lsphpwebapps, lsphp74 and they will have changed to 3047M for the memSoftLimit and memHardLimit.
What version of OLS are you using 1.7 or 1.6?
I am assuming that you have already adjusted the domains php.ini settings under Account Manager > PHP Settings? Note: this option isn't available from the admin dashboard only the user (domain) dashboard
Thank you very much. Let's see in a few hours if the change prevents the OOM logs.
Sorry I missed your question earlier. I'm running OpenLiteSpeed (DirectAdmin Edition) 1.7.9
I don't have any override here, yet. Didn't know about this section.
There was an memory issue with caching on OLS v1.7.8 that might have been the issue.
Have you had any issues since?
I can't see OOM logs anymore. Not sure if memSoftLimit/memHardLimit or updating fixed the issue.
But it works fine now.
Good news. If you have anymore issues with OLS or need to customise the OLS config files give me a shout. Happy to help out if possible.