Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AungHtetPaing__'s avatar

Should I use swap file in droplet with 1GB ram

Currently I am using basic 6$ droplet and memory usage is 78% when I ssh to droplet. It is 90% in droplet control panel memory graph. The droplet has only one laravel site which doesn't have any other user. I worried about that memory usage because I am also planning to deploy other side project to this single droplet. I created swap file by following this digitalocean article https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04. Then I found the article comment that said swap file shouldn't use in SSD.

So just want to clear should I use swap file or not? The memory usage is normal or not?

Thanks you.

0 likes
4 replies
Tray2's avatar
Tray2
Best Answer
Level 73

The SSD disks are much better now than they used to be, but before doing anything regarding swap.

  1. Analyze what is using memory?
  2. Optimize your application so that it uses less memory (Only fetch what you need)
  3. Upgrade the memory if you can afford it.

That being said, it's most likely that your application is using the memory, and can be optimized, but then again 1GB is not much memory at all.

2 likes
AungHtetPaing__'s avatar

@Tray2 Yeah I should do more research about swap before doing it. But after I created swap file, droplet memory usage is going down to 70% and I think swap file usage will be going up.

Analyze what is using memory?

I have no idea how to analyze what is using memory. This is first time I am working with droplet (first time deployment). Can you explain generally or show some article/blog about analyze memory?

Optimize your application so that it uses less memory (Only fetch what you need)

Definitely I need to optimize application.

Upgrade the memory if you can afford it.

I can afford it but don't want to upgrade for personal demo project.

Thank you for your advice.

Please or to participate in this conversation.