DigitalOcean does NOT recommend swap for SSD storage

Note: Discourse requires a swap file if you are using 1 GB of RAM. Although swap is generally recommended for systems utilizing traditional spinning hard drives, using swap with SSDs can cause issues with hardware degradation over time. Due to this consideration, we do not recommend enabling swap on DigitalOcean or any other provider that utilizes SSD storage. Doing so can impact the reliability of the underlying hardware for you and your neighbors. Hence, we recommend a minimum of 2 GB of RAM to run Discourse on a DigitalOcean Droplet. Refer to How To Add Swap Space on Ubuntu 16.04 for details on using swap.

Any thoughts on this?

For small forums like mine’s (100K posts and 5K users but currently low activity) increasing from my shared hosting (100 USD/year) to DigitalOcean 2GB RAM plan (240 USD/year) is not an option. 1GB is more than enough IMO.

1 Like

Someone in the link above published this when trying to install Discourse on 2GB without swap:

WARNING: Discourse requires at least 2GB of swap when running with 2GB of RAM
or less. This system does not appear to have sufficient swap space.

This l tutorial was made by @techAPJ from our team.

Digital Ocean doesn’t want you using swap indeed, is bad for then.

We, as a platform that works everywhere, let you choose using more ram or ram plus swap.

so can I safely buy their 1GB RAM plan for my forum and configure the swap file as per Discourse guidelines?

1 Like

You can always follow our official guide. Our discourse script even sets swap automatically for you if necessary.

3 Likes

Hello , I have this information while installing . Should i create a swap file ? How to do it ?

If you follow the official guide discourse/INSTALL.md at master · discourse/discourse · GitHub you don’t need to create a swap manually.

To create a swap partition manually follow this guide instead:

3 Likes

Yes i follow this guide . I have one gb ram but i have must uncomment one line with “exit” to go next step
Then i need a swap file and i have information that i have to wait 5 sec to create swap file… but nothink is doing.
So i go create manual a swap file like here: Create a swapfile for your Linux server
My Q is:
Can i create a more Gb for SWAP file ? Why not ? (i have ssd premium disk)
Aftere this instruction i must reboot a system ?

I have 4 g in sdb1 (free 3,6 gb) so why dont to create a 3gb swap file ?It would be “drug” my instance or not really ?:slight_smile:

You can enlarge the swap partition as much as you want, but consider that if you have 4 giga of ram and your forum does not have a lot of traffic the swap does not help you at all.
It’s an emergency measure, 1 giga is more than enough.
Have you ever checked how busy the ram is?
On my forum (4 giga of ram + 1 of swap) the occupied ram never exceeds 2 giga.

4 Likes

I have got only 1gb ram on my ubuntu. Thats why i wanna create a swap file like 3gb or more. Im not sure about pros when do that

You must create a swap partition, if you have only 1 gb of ram.

However, consider that the swap is much slower than the ram. If your forum has normal/high traffic you will notice delays when the pages are loaded.
In this case you should think about increasing the ram rather than the swap.

2 Likes

Yes i know. Bit i decided to run forum like that. I want to look how it will work. When the comunnity will grow i will do a backup and i will change server and i think domain too. As i read and as i hope there will be easy to migrate (or i am on the wrong way - if that pls tell me …)

Btw
I want now to choose lest encrypt email , When i visit certbon i must to set what of software did i use . Hmn what shhould i choose? Nginx, hproxy or none of this above , im not sure?

If you need more than 2 GB of swap you’re in trouble. If you are starting a new site, you do not need more than 2GB of swap.

If you want to create swap yourself, you can find instructions here and elsewhere for creating swap.

Run discourse-setup again and enter some email address when it asks for Let’s Encrypt address. You do not need to run certbon yourself.

2 Likes

YY swap is already done. But im not sure why once a guide from bloggers / websites is working but sometimes tutorials of them dont work, Need to search and search… Doesnt matter…

Ok good to to know. So i dont need to install certbot like it Certbot ? Really it is so easy ?

1 Like

and this ssl cert will be auto-reneval ?

I don’t quite understand what you mean. Tutorials that have to do with blogs and not Discourse will be very different, as DIscourse uses a different set of tools.

Yes. It really is so easy.

Yes. It will auto-renew.

Yes, you can edit a post rather than replying to yourself to add another sentence.

2 Likes

OK ,i know . I was think the post after post will automatic connect together

1 Like