Why does Discourse need 1 GB of RAM?

Most forum software don’t need any where as much RAM as this. I was wondering what Discourse uses this RAM for? Is it doing a powerful amount of caching or what?

You can’t fit that much awesome into 512mb

20 Likes

You can’t fit that much awesome into 512mb

…using Ruby. :wink:

14 Likes

RUBY - RAM Usage Beyond Y-axis

14 Likes

Maybe this is the reason, perhaps?

https://blog.engineyard.com/2009/thats-not-a-memory-leak-its-bloat

Could it be ActiveRecord that is wasting all this memory?

I would not use blog entries from 4 years ago as representative of the way things are today in the world of programming and technology.

Memory requirements will be a bit higher on some stacks than others. Remember that Discourse, as we say many times on http://www.discourse.org is built for the next decade of the Internet. We’re 1 year into a 10 year plan. We want to make decisions that might seem aggressive now, but are still smart 5 years from now. Maybe even prescient!

That said, memory is cheap and getting cheaper every day. For example in 2009 our Stack Overflow web tier servers had 8GB RAM. The ones we built for Discourse in late 2012 had 32GB RAM (and dual 512gb SSDs). That is a 4x increase in 4 years.

9 Likes

While that’s all true, cloud hosting is generally ram limited. They charge for ram pretty much linearly so doubling the memory footprint doubles the costs if you’re on the cloud like I am.

Since your plan is to get into the hosting business for discourse this might affect you someday.

2 Likes

“Need” is not the correct word i’d say. I’ve successfully installed and ran it on an 512MB VPS from DO(1GB RAM and 3GB swap was NOT needed, atleast not for me).
The issues would probably arise when you have more people on the forums.

2 Likes

While I understand the whole “preparing for the next decade of the Internet” thing, 1 GB of RAM minimum is still a pretty aggressive and expensive requirement, especially for smaller forums. It may be $10 a month on DO but that’s twice what I pay now for a 512MB setup with 3 php-based forums on it that are barely breaking even with hosting and domain costs.

You could argue that the requirement keeps a lot of crappy forums being prevalent like it is with most free forum software though.

3 Likes

I agree with @lukelarris. Especially for small forums/discourse instances with less than 100 users, this is a very hard requirement. It’s clear that discourse is build to scale up to a huge userbase, but it would be helpful for spreading this great technology if it would require less RAM for very small instances.

@ArmedGuy How many active users do you have?

2 Likes

10 at max.
On idle the whole package lies around 272MB(the whole stack with sidekiq, unicorn, redis and postgre, checked on a 1GB box) and I doubt it would rise by much if you have 50-60 users on there.

The only time ive seen the use of 1GB(or close to it) is when its installing.

FYI: My PHP-MySQL setup with 5 php-fpm workers take up 291MB on Idle.
(But that one can be used for multiple forums, yes).

1 Like

I don’t think that hosting Discourse on the cloud is the best option you have. To start playing with it, perhaps, but a discussion forum should be up 100% of the time, so hosting individually seems to be the better option here. And 1 GB is not that much, anyway.