C
C
CrewCut2016-04-15 08:29:21
ubuntu
CrewCut, 2016-04-15 08:29:21

How to understand the reason for the high load on RAM on an Ubuntu 14 server?

There is a server on Digital Ocean, 2GB of RAM + 8GB swap. The site is not particularly heavy, there are not many visitors. I worked quietly for more than six months, suddenly wild loads on the processor began. Through top I see a stable picture that the kswapd0 process is eating up the entire processor.

As I understand it, this process is responsible for the fact that if there is not enough RAM to take it from the physical one. But how to understand why the load suddenly increased for no reason? Restarting the server/apache does not work, although sometimes it helps. The problem has been going on for two days now. Sometimes you reboot and everything is fine for a few hours, then the same thing starts again.

I really don’t understand anything about administering servers, what I’ve googled doesn’t help. How to understand which file takes over the entire RAM, what could be the matter if nothing has changed, but suddenly such a picture appears?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CrewCut, 2016-04-15
@CrewCut

Thanks for the replies, especially pcdesign . Solved the problem by reinstalling the entire system. I did not understand what was the reason, but there was no time to understand.

A
Alexander Karabanov, 2016-04-15
@karabanov

This is how I calculate who ate SWAP:

[email protected]:work$ cat get_swap.sh 
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
done

if [ $SUM != 0 ]; then
echo "PID=$PID - Swap used: $SUM - ($PROGNAME )"
let OVERALL=$OVERALL+$SUM
fi

SUM=0

done
echo "Overall swap used: $OVERALL"
[email protected]:work$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question