Memory hungry server killing named

klasje

Verified User
Joined
Jan 5, 2008
Messages
55
Hello,

Since I updated the server to php 8.* , I experience the Ubuntu server killing named every 2 days as it's running out of memory.
I keep on upgrading the vps and adding more memory to it, to a point it's becoming quite expensive.
This server is running ok for about 4 years now and never had this issue before.

Is this users that increased their php max memory setting too much or is something else wrong and how to find out the cause?
I do not see any excessive memory usage at this time and it always crashes when I'm sleeping.
Directadmin port 2222 is unresponsive as well at that time.
I suspect it's related to clamav, but I'm not sure.

The server can kill php or nginx or ... as long as it restarts it, but it doesn't seem to restart named after killing it.
Is there:
1) A way to avoid it
2) A way that if it's killed, directadmin tries to restart it?

Many thanks in advance!
 
maybe outdate of system package ?

try update the system package via "apt update" and use custombuild to rebuild the php again.

I have experiment of high memory usage from PHP process since last 2 version previous update.
 
It just crashed again, after updating everything 2 days ago. Any other suggestions?
 
No more.... maybe it need to monitor which process cause the memory leaks.

For normally I always monitor via "Resource Limits" page for users process, If something went to high usage without any reason... so it's meant something relate to users process.

If none, so it's something else that accident cause in the sametime before/after you change the PHP version.... Like your server get DDOS in some service.
 
Well, that specific server is the only server I still have on the directadmin datacenter license, so it has no resource limits page. ;-)
Only newer licenses have the resource limits option.
Can I see it using a command line?

In the service monitor page I do not see any excessive resource or memory usage during the day, but something seems to happen at night always...

Can I not tell ubuntu not to kill named when out of memory, but only nginx and php-fpm?
I always get error ns not resolved in the browser and cannot load any webpages, not even da.
Adding extra memory to a server that already has plenty feels like such a waste...
 
There are plenty of tools that will tell you which processes are using memory, such as ps and top. The kernel's OOM-killer is responsible for killing processes to avoid the whole machine going down. How it decides what to kill is a whole other topic, but I believe it tries to pick something that will free up the most memory. Why this would be named is a bit strange, specially if it happens every time, and is the only process killed. Check your system logs for information about the OOM killer, and monitor the memory usage of your processes. If named is using more than a fraction of your total memory, it's likely it has a memory leak somewhere, and it should probably be upgraded (or downgraded).
 
HI;

did you limited your bind(named) caching memory?
default value 'max-cache-size 90% of memory .maybe this using your memory.
maybe your version of Bind it has a memory leak bug.

check your in named.conf unter options if you have any setting max-cache-size
change it max-cache-size 32M;

if not add the line under option section like this
max-cache-size 32M;

(32M = 32 Megabyte)

restart named

first check if this will help you not killing named.
if yes change the value 32M; bigger values test it.
 
1) I added max-cache-size 32M; to /etc/bind/named.conf.options and restarted named.
2) Server has 8 gig memory, which should be sufficient for the few sites on it.
3)
swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 6G 1.1G -2

Many thanks, hoping to get some sleep tonight with the max-cache-size.
 
If your server uses and requests a lot of memory, it will also need it. Your server simply does not have enough memory. As soon as you add 8 gigabytes, for example, you will see that it is better distributed.
 
8GB does seem a bit low for a server running PHP web sites. And then as SQL databases grow it will need more memory to keep performing well. 16GB I would consider the minimum for this type of server, most sites have been running wordpress and it's quite memory hungry with lots of plugins. If it's a default install of linux, it's a good idea at a minimum to adjust the kernel swappiness (i normally use vm.swappiness=1 )... If the server is using a lot of swap it's going to be slow you need more ram.
 
Back
Top