To scale your Rails Application do the following:
In detail this looks like this: After you developed your app, it needs to make sure that each resource that is usually returned right to the requestor, is also stored in the cache. It can do this with the help of the Scales API that is pretty straight forward.
Finally, you need to make sure that the scales framework initially knows what to put in the cache. This is done using a scaleup file that simply calls all urls that exist, exactly once:
That's all there is to do!
Scales consists of three modules: The Server, the Cache and the Worker. You just set up the Rails application the worker uses, now you need to do the following:
Scales is using redis, so make sure to have on running.
After the installation of the gem you have a scales-server executable. Just start it with:
scales-server -p 80
Every request that needs to hit the application because it's not a pure reading request is redirected to a worker. To start your worker with the previously prepared rails app do the following:
cd railsproject scalify . scales-worker
This starts a worker using the rails application
Finally you're ready to use a full Scales system for the first time. The last step you have to do now is to initially fill the cache with the help of the scaleup file:
cd railsproject scale up