How to setup Docassemble with less than 4GBs of RAM

SembleHost provides evergreen docassemble hosting. We write articles about making docassemble hosting better. If you don't want to be bothered with the hassle of keeping your docassemble instance fresh, try one of our hosting plans.

Here is how we prepare a server with less than 4GBs of RAM so that it can run Docassemble.

Step 1 - Generate and activate your swapfile

sudo fallocate -l 3G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Step 2 - Ensure that the new swap file is used after a reboot

Edit your /etc/fstab file and add this line:

/swapfile swap swap defaults 0 0

Step 3 - Adjust your system swappiness

A lower swappiness setting means that your system will only "reach" for the swap less often.

sudo sysctl vm.swappiness=10

Step 3 - Ensure that the swappiness settings persist after a reboot

Edit your /etc/sysctl.conf file and add this line:


Docassemble tends to use less than 1GB of RAM most of the time, however, during an update it can consume more RAM. Having the extra swap file ensures that it can operate without issue during those updates.

Don't miss these stories: