Live data from Hacker News

The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

goodfil.ms

31–40 of 42 posts

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#31
We used New Relic for a while with Heroku but turned it off because of a number of performance and stability issues we seemed to be seeing with it. In particular application boot times (for the first requests anyways) seemed to be negatively affected.

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#32
post #11
post #8

Earlier quoted context omitted.

Absolutely. At theconversation.edu.au we run a content site—we publish the news, which is the same for everyone. This means we can cache the front page and all the articles as static HTML, and then annotate the page with user info for signed-in commenters, editorial controls for signed-in editors, and so on. (We have a separate cookie that is present for signed-in users, so the fronted knows whether it should fire th…

Interested in what you mean by annotating the page after caching it, do you have any more info on this?

Essentially talking about edge side includes [http://en.wikipedia.org/wiki/Edge_Side_Includes].

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#33
post #5

"We didn’t have any page caching in place at all." Cache me if you can! If you're a high-traffic site and you are not caching static content (I recommend Varnish highly), then your are throwing money or good user experience out the window.

When you say static content, do you mean actual static content, or dynamic-but-still-kind-of-static? Actual static content like CSS files and background images doesn't get any benefit from varnish. Something like the HN front page, where it is dynamic but consistent for all users at a specific point in time, is what you need to put behind varnish.

Both. Varnish defaults to caching jpg,gif,png,css,etc. but we also having it caching things that are pulled from the db and processed. So it leaves our cpu-intensive backend untouched for the vast majority of requests.

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#34

A few questions: 1. Is it possible to spin up two apps on Heroku? 2. What load balancers are available with the above? 3. Anyone have a link to a run down of how to back up your Postgres DB periodically? Thanks

It's possible to run multiple server processes of a single Rails application on a single Heroku worker to gain some additional concurrency capacity, obviously with some caveats and limitations:

http://michaelvanrooijen.com/articles/2011/06/01-more-concur...

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#35

Earlier quoted context omitted.

If you don't mind me asking, what load balancer are you using? I'm trying to setup multiple app servers on EC2 behind ELB using Redis as a session_store and I can't get sessions to persist.

I used to use ELB, but later I migrated the whole app to a self-hosted private cloud on a dedicated server. I'm using Nginx as the load balancer, and there're no session problems for me because I use the built-in secure cookie store.

Thanks for the response. I appreciate it.

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#36

Earlier quoted context omitted.

Well, it's true that database isn't horizontal-scaling-ready as described in the OP. But for many web apps, the database is not the bottleneck. Efforts should be spent on memory caching and NoSQL long before vertical scaling generates diminishing returns. Of course, it's easy to add a master-slave replication to a single database instance when the need arises, even possible without downtime. So I assume most RDBMSs t…

>But for many web apps, the database is not the bottleneck. Really? I think the database is usually the bottleneck in most web apps. That's why you cache data: to avoid hitting the database.

Writes to the DB (and more importantly replication since it is single threaded in mysql) are often the bottleneck that is hard to scale. Write through caches can scale reads up very high. It takes a long time to hit the write limit for most applications so often read slaves and memcache is sufficient.

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#37

This is almost exactly how I deployed NameTerrific ( https://www.nameterrific.com ). It automatically gets ready for any horizontal scaling in the future. In addition, I allocate the workers to their own instances so that they can grow independently. Also I use Capistrano to automate deployment. Whenever additional resources are needed, simply clone the instance and add it to the load balancer. I use 2 Nginx workers…

If you don't mind me asking, what load balancer are you using? I'm trying to setup multiple app servers on EC2 behind ELB using Redis as a session_store and I can't get sessions to persist.

This sounds like a bug in your session store code as opposed to a load balancing issue. Are they all on the same host name?

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#39
post #7

"We didn’t have any page caching in place at all." Cache me if you can! If you're a high-traffic site and you are not caching static content (I recommend Varnish highly), then your are throwing money or good user experience out the window.

The key thing I got a bit wrong was high-traffic mostly static "content", vs high-traffic "very custom" which is a) what I was used to at envato and b) what I thought we had on our hands at goodfilms. I think in a growing site with a lot of custom per-user content (like a social network) the extra complexity of a cache layer and managing expiry is more pain than it's worth while iterating the product quickly. If you'…

If you're running Ruby on Rails record cache will do it all for you (I've yet to run into any issues, the one I thought was an issue was actually a pgpool-II bug).

https://github.com/orslumen/record-cache

If you're on Django I think cache-machine does the same thing. There are some things you won't get cached this way that you could manually (functions and procedures), but I think they're both conservative enough that you won't return stale resources.

Re: The Minimum Viable Rails Stack, Now Reddit Frontpage Approved

#40
post #11

Earlier quoted context omitted.

Interested in what you mean by annotating the page after caching it, do you have any more info on this?

Essentially talking about edge side includes [ http://en.wikipedia.org/wiki/Edge_Side_Includes ].

More about ESI http://i.imgur.com/KNvg0.jpg From a slidedeck presentation here http://lanyrd.com/2012/codeigniter-conference-us/coverage/?c...
Post reply on HN