The biggest thing we did this year was to strengthen the Infusionsoft application infrastructure by deploying what we internally called the “17” release. In 17, we refactored significant areas of the underlying code to become a true “multi-tenant” architecture.
Multi-tenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple applications (tenants). Contrast this approach with our old “multi-instance” architecture where separate software instances were set up for each running application.
Another way to describe multi-tenancy is to think of a large, high-rise apartment building with hundreds, if not thousands of tenants living inside. This is analogous to a single instance (one building) with multiple tenants (many apartments and people), in which all the tenants share the same building and infrastructure. Now imagine a suburban subdivision with row after row of single-tenant, single-family homes. This latter example is analogous to the multi-instance architecture where all of the homes are set up separately and don’t share any infrastructure.
Why does this matter?
Well, there are few important advantages in being a multi-tenant software application. Just like an apartment building can comfortably house many, many more people for the same square foot of real estate than a single-family home, multi-tenant software applications can host many, many more applications per server than a single-instance software application can. This translates into much higher application density on our servers. This lowers costs by allowing us to utilize our existing server infrastructure more efficiently. In addition, it reduces the overall number of servers that we have to maintain and manage. Think mega-scalability! It virtually eliminates application crashes due to running out of memory. Also, and perhaps most significantly, it increases application performance… a lot!
Geek Warning – The following section describes our testing of performance with these changes. We wanted to cash our proverbial check and measure the results of our recent enhancements. You’ve been warned. ;-)
To do the before and after testing, we set up our load-testing environment with the following parameters:
– We simulated 4 users per application;
– We start with 30 applications per block (our old production configuration);
– We added increments of 15 applications per block until the performance degraded;
– We measured memory usage and application response times at each interval.
You can see that in our pre-17 code, 30 applications with 4 users each used almost 400MB of memory. It wasn’t bad, but wasn’t nearly as efficient as we desired. After the 17 release, the same 30 applications with 4 users each used a mere 81MB of memory! Better yet, as we increase the number of applications, the memory usage stays roughly the same. Scalability, anyone?
The application response times are even more impressive:
Even with tripling our application density from 30 to 90 apps, we still maintain acceptable sub-second response times. As you can see, there are substantial benefits for performance as well as efficiency by using a multi-tenancy environment.
Something to note in the graph above — don’t be fooled by the third bar showing the pre-17 code with 60 applications that appear to decrease in response time over the same code with 45 applications. With a load of 60 applications in the pre-17 code we had multiple crashes that skewed our numbers for the reporting.
Eric Martineau, one of the Infusionsoft founders and our Chief Software Architect, started this initiative back in 2008. He enlisted the skills of one of Infusionsoft’s first employees, Sr. Engineer Jeremy Gurr. Jeremy branched our codebase and did the lion’s share of the refactoring work for more than six months in early 2009. “In July 2009, we dedicated our entire engineering group to polishing up the work Jeremy did and to testing the software like crazy to make sure we were rock solid in our work
We began a four-phased deployment of the 17 release starting on August 18th and completed the last phase of the roll-out on September 1st. Since then, all Infusionsoft users have have benefited from the new multi-tenant architecture! We’ve more than tripled the application per server density while maintaining (improving) sub-second response times.
Another benefit is our systems team is able to deploy application releases 33 percent faster than before. The new multi-tenancy architecture has reduced overhead memory by at least 500 percent! Finally, we’ve had virtually no memory crashes since the 17 release!
Bottom line: we’ve been able to achieve better scalability, better performance and better reliability.