Testmybrain.org

Rob Wilkinson
Oddball
Published in
2 min readJan 5, 2017

--

The challenge

Testmybrain.org is a not-for-profit initiative dedicated to collaborating with citizen scientists throughout the world by providing measurement tools that allow people to engage in science and learn about themselves. It allows users to take interesting tests to discover their brain profile.

Testmybrain was running on Rackspace infrastructure and was anticipating beginning a project that would involve HIPAA data. HIPAA data requires a certain set of protections and failsafes that are not available in rackspace. They were looking to move to a hosting provider that would not only provide the protection they need, but also allow them to grow and scale over time. Additionally, they were looking for an overhaul and advice on their current php infrastructure. The site had been running in production for 8 years and the size of the codebase and DB combined was around 30GB.

The solution

Transfer their infrastructure to AWS. We decided to give them a performance upgrade as well by moving their DB into its own container using Amazon’s RDS.

Infrastructure:

  • RDS Mysql
  • EC2 Web server

The process

  1. Spin up an ec2 instance to run the code on
  2. Add ssh key into the rackspace server
  3. Transfer the codebase from rackspace to ec2 instance using rsync
  4. Install PHP dependencies: dig into php.ini file, find out currently installed extensions, try pecl installing them, debug and repeat. This is hard to get too detailed into, as much of it was digging into old docs, and trying to find old plugins that worked with php 5.3
  5. Copy nginx conf from old server, make sure it still works. This was a matter of changing paths
  6. Transfer new DB onto RDS, using mysqldump, mysqlimport and setting the RDS to be a DB follower
  7. Change PHP DB connection variable
  8. Set up a git system using a bare repo and post-update hooks to manage the deploy and permission issues they were having before
  9. Load test & QA

Results

Their infrastructure has been load tested to 1,000 concurrent requests and reaches 5% cpu on server and no pressure on DB memory.

--

--

Engineer who focuses on helping businesses and entrepreneurs achieve their goals through the power of technology.