Fast, *Faster*, Fastest
Wednesday, May 9, 2007 Posted by kordless 
The site has been getting steadily busier since our release in March. This means we are doing more work serving pages, and certain portions of the site have become slower as a result. However, over the last 2 weeks, Josh has been working on optimizing our backend infrastructure to speed up things significantly.
Pages and page elements (like the tag cloud) on Zoto were taking a considerable amount of time to load due to the number of queries being done on the database server here at Zoto. The net effect was a slowdown for page load times on the site, which exasperated the problem with JavaScript load times (see post below).
To fix this problem, we have implemented a couple of new technologies for speeding up queries on the system.
The first technology is memcached, which was written by the guys at Danga Interactive for LiveJournal. We are now using memcached for caching things like user information (username, password, email address, number of messages, etc.) and storing those results in server memory for rapid access. Now when you move from page to page on Zoto, your account info is pulled from server memory, dramatically decreasing the amount of time needed to display the new page for you.
The second piece of technology we've implemented is a technique for databases called materialized views. Materialized views are 'snapshots' of data in our database that may get used on a regular basis. We index these views so that when you access particular portions of your account, like the lighbox, we can deliver things like the tag cloud to you almost instantaneously.
Both of these updates have had a positive, noticeable effect on the server loads here, and have significantly speed up the rate at which we can serve content.
We are still left with the problem of how to speed up JavaScript rendering times on the user's browser, but we have a couple of ideas on how to fix this as well. Within a few weeks we should have the majority of the speedup features implemented, and any noticeable delay (even on slower computers) in our page load times should be gone for good.


Comments