I would like to know how to set the number of running unicorns. I need it to adjust the RAM consumption and failed to find any specific information about it on this forum and on the net.
I am looking for information such as the location of the correct file, the name of the line to change, if there is some precaution to take, etc.
I suppose that after the changes, it is necessary to restart/rebuild the software. How to do it properly?
## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override
UNICORN_WORKERS: 8
I’m not an expert in this area but you might want to check the lines ~30 to reduce the number:
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
db_shared_buffers: "2048MB"
Save the file (CTRL+X then Y usually), then you indeed have to rebuild discourse to use the new settings, using:
./launcher rebuild app
Your forum will be offline around 10 minutes during the process
I think, but I haven’t tested, that the UNICORN_WORKERS is set in an env and not in any config file, so you don’t need to rebuild but can just
./launcher destroy app;./launcher start app
I’m pretty sure (but haven’t looked) that changes to db_shared_buffers to require a rebuild (or you could go an edit the corresponding settings file inside the container and then restart it).
I’m self-hosting my Discourse forum on Yunohost, and I ran into an issue with the SMTP email configuration. After scouring the meta.discourse documentation, I couldn’t find any information on Yunohost’s specific operations or save locations. I uninstalled and reinstalled Discourse, copied the log file, and finally located the configuration file that contained the SMTP information.
If you’re also using Yunohost and need to configure your Discourse SMTP settings, you can find the file you’re going to modify at
/var/www/discourse/config/discourse.conf.
Open that file, configure the SMTP settings, save and exit, and then restart Discourse with the command “systemctl restart discourse”.
And if it helps anyone else, because also, I couldn’t find information -
To configure Discourse with your Office365 you’ve got to do the following:
Go to your Microsoft 365 admin center
Click on Settings then Domains
Click on Add Domain
Follow the instructions on the screen to add your forum’s URL
Once you’ve completed the above steps and the DNS is verified, you’re now able to create an inbox using that subdomain
Click on Users and then Active users
Click on Add a user
Create the mailbox for your forum (example: noreply@forum.yourlinks.com) mailbox domain must match the hostname from where the forum runs
Click on Licenses & Apps
Assign this mailbox an Exchange Online (Plan 1) license (10,000 messages daily 30msg/min throttle) It is required to have a license attached to the mailbox for the purpose of direct-delivery. At the time of writing, the cost is $4.00USD/mo or $5.10/CAD | Should you require a higher limit or a shorter throttle, there are other plans available
Click on Mail and then Manage email apps
Enable “Authenticated SMTP”
Click Save changes
Go to your Azure portal
Browse to your active directory
Select Properties in the left sidebar, right under User settings
Select Manage security defaults
Set Security defaults to “disabled”
Click save
Go back to Users > Active users
Click on Multi-factor authentication
Disable MFA on the mailbox being used
Now as far as Office365/Microsoft365 is concerned, your newly created mailbox is now ready to direct send on behalf of your Discourse instance.
Settings to use the Office365 mailbox: modify these lines in /var/www/discourse/config/discourse.conf
# hostname running the forum
hostname = "forum.yourlinks.com"
# backup hostname mainly for cdn use
backup_hostname =
# address of smtp server used to send emails
smtp_address = smtp.office365.com
# port of smtp server used to send emails
smtp_port = 587
# domain passed to smtp server
smtp_domain = forum.yourlinks.com
# username for smtp server
smtp_user_name = noreply@forum.yourlinks.com
# password for smtp server
smtp_password = YourLinksPassWordHere
# smtp authentication mechanism
smtp_authentication = login
# enable TLS encryption for smtp connections
smtp_enable_start_tls = true
# mode for verifying smtp server certificates
# to disable, set to 'none'
smtp_openssl_verify_mode =
# force implicit TLS as per RFC 8314 3.3
smtp_force_tls = false
# load MiniProfiler in production, to be used by developers
load_mini_profiler = false
# hostname running the forum
hostname = "forum.yourlinks.com"