0

I have a LAMP server hosted by Digital Ocean that has been running for more than 3 years. I use the server to run an ERP page where users have to log in to do what they need to do.

Up until recently people could enter the ERP without a problem and do what they needed to do. However, it has been a common occurrence that trying to log in the ERP presents the user with the log in page without any error messages.

I tried looking into it by logging into the server using putty and seeing what the problem was and I was presented with a message saying there wasn't any memory left.

I read online that doing sudo apt-get clean fixes the issue, so I tried that and it did fix it.... for a couple of days until I had to do it again for the same reason. I have been doing this repeatedly for weeks and I want to see if there's a way to avoid that.

What do I need to do for the server to have enough memory? I tried archiving old files and removing them from the server to see if that could help but as far as I can see it only made a small dent.

Can you please help me? Thanks!

Edit, someone asked me to run df -h and df -i on PuTTy. Here are the results:

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            992M     0  992M   0% /dev
tmpfs           201M   21M  180M  11% /run
/dev/vda1        49G   49G   65M 100% /
tmpfs          1001M     0 1001M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1001M     0 1001M   0% /sys/fs/cgroup
/dev/vda15      105M  3.4M  102M   4% /boot/efi
tmpfs           201M     0  201M   0% /run/user/0

df -i
Filesystem      Inodes   IUsed   IFree IUse% Mounted on
udev            253701     378  253323    1% /dev
tmpfs           256014     529  255485    1% /run
/dev/vda1      6451200 1033830 5417370   17% /
tmpfs           256014       1  256013    1% /dev/shm
tmpfs           256014       6  256008    1% /run/lock
tmpfs           256014      16  255998    1% /sys/fs/cgroup
/dev/vda15           0       0       0     - /boot/efi

Julio Garcia
  • 103
  • 5
  • 2
    You should back up and address the memory issue. Whatever you read directing you to run apt-get clean. At best what you're doing is a bandaid on a broken bone. More likely, it's doing nothing. Repeatedly 'fixing' an issue isn't fixing it, you should right-size your application and server accordingly. –  Feb 15 '20 at 21:05
  • @yoonix thank you for your comment. Question: by 'you should right-size your application and server accordingly.' I am assuming you mean 'If you need more memory, upgrade it,' am I correct or did I misunderstood? – Julio Garcia Feb 15 '20 at 21:08
  • Does this help? https://askubuntu.com/questions/389728/how-can-i-configure-apt-get-to-clean-automatically-after-every-install – Eduardo Trápani Feb 15 '20 at 21:16
  • @EduardoTrápani Thank you for your comment. It does help me, but I need it to work without necessarily having to do an apt-get install. I don't do those often – Julio Garcia Feb 15 '20 at 21:19
  • 1
    Are you sure the error is about the memory? With apt-get clean you remove the repository cache from the host which is using the disk space and not the memory.. What return "df -h" and "df -i" when the issue occur? – DarkVex Feb 15 '20 at 21:43
  • @DarkVex Running df -h gives me this: df -h Filesystem Size Used Avail Use% Mounted on udev 992M 0 992M 0% /dev tmpfs 201M 21M 180M 11% /run /dev/vda1 49G 49G 65M 100% / tmpfs 1001M 0 1001M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 1001M 0 1001M 0% /sys/fs/cgroup /dev/vda15 105M 3.4M 102M 4% /boot/efi tmpfs 201M 0 201M 0% /run/user/0 – Julio Garcia Feb 15 '20 at 21:49
  • @JulioGarcia the command "df -h" is useful for checking if there is enough disk space available on the system. In my opinion your problem is that there isn't enough disk space on the system, that's why "apt-get clean" temporary resolve it. That's the reason why I asked you to check the disk space with "df -h" once you have the issue. – DarkVex Feb 15 '20 at 21:54
  • @DarkVex Editted my question with df stats – Julio Garcia Feb 15 '20 at 21:54
  • @JulioGarcia Noticed right now that you have posted the output of df -h :) as you can see the / partition is almost full (only 95MB left), you need to increase the HDD space of the VM – DarkVex Feb 15 '20 at 21:56
  • @DarkVex Does that mean I have to increase my server's rom memory? – Julio Garcia Feb 15 '20 at 21:57
  • @JulioGarcia the hard disk or sdd space I don't know what kind of storage Digitalocean offer for their VM – DarkVex Feb 15 '20 at 22:01
  • @DarkVex I am assuming it's SSD. When I click on an option to resize my droplet the options are listed with the following columns: Type CPU, Type vCPUs, Memory, SSD, Transfer – Julio Garcia Feb 15 '20 at 22:04
  • OK, so you can resize the entire VM/Droplet and not only a single resource. I assume that currently you have the following "2 GB 1 vCPU 2 TB 50 GB" I would suggest to resize to "4 GB 2 vCPUs 4 TB 80 GB" – DarkVex Feb 15 '20 at 22:12
  • @DarkVex you're assuming correctly. I also don't see any 80 GB disk when I select 'Resize Droplet' all of them are 50 GB. Edit: never mind, now I see them – Julio Garcia Feb 15 '20 at 22:20

0 Answers0