name is Michael Solovyov and I’m the co-founder & CTO of a
rails-based start-up. We have built a product for other businesses
to help their users adopt their products.
built the application, delivered to a few customers and now we’ve hit
scaling and performance issues.
love your feedback on how we proceed as we try to resolve them:
These are the problems we’ve encountered:
main user dashboard takes between 7-15 seconds to load. The maximum
requests per second that we can support are 100-150.
Why we think they’re happening:
couchdb with an ORM that has our data modeled relationally. This
causes the ORM to launch an extraordinary amount of http requests to
couchdb to load all our data. The more data and users in the project,
the longer the delay. There’s also potentially inefficient code,
extra loops etc. We’re not using caching to it’s fullest extent.
What we’re using/what we’ve done:
rails ‘3.2.12’, ruby 1.9.3p374, nginx + unicorn (main server),
elasticsearch (separate server), couchdb (separate server). All on
We’ve added some
view level caching where we can get away with stale data.
We’ve tried using
higher tiered/ssd aws servers but it doesn’t look to be our main
How we plan on completing it:
We’re mostly done
a rewrite to migrate our data and data model to activerecord. We’ve
hit a snag in migrating s3 attachment code built into the couchdb ORM
that we’re using. Following the completion of the migration to
sql/activerecord we are going to do the following in an attempt to
percono mysql server.
Run tools such as bullet to analyze performance and where we might
have bad queries/lookups.
Update to latest Rails and Ruby versions.
Look into Puma and paralelization of DB access
Break apart the application into separate services.
What we don’t know right now:
to Activerecord or any of the above ideas will inherently give us any
Whether we will
have any other unexpected surprises or loss of functionality due to
switching to ActiveRecord.
How long this all
will take and whether there’s other areas that we need to focus to
get sub 1 second performance that we’re missing.
you all have any feedback/ideas/insights completing projects like
particular, I would be curious about:
How would you approach it?
Anything that’s worked for you in the past on suitable projects?
Anything to avoid doing?
Where to find good additional team members & advisors to help us
complete the project?
How long to expect it to take?
are our application rake stats: