Fotolog

Delivering quality service to eleven million users with MySQL, InnoDB, and the Solaris 10 Operating System
TM

Customer Success Story

Highlights Challenges
• Scale to support eleven million members and more than 100 million page views a day • Increase performance without increase in database hardware

Solution
• MySQL database software • InnoDB transactional storage engine for MySQL • Solaris™ 10 Operating System • Sun V440 and V210

Results
• Support for four times as many users with no additional hardware • Higher percentage of working dataset in the memory with efficient schemas • Four times the number of concurrent threads without adding servers • Anticipated ability to double current number of threads

As the 18th most trafficked site on the Internet and growing, Fotolog needs to be able to reliably scale up to processing increasingly large transaction volumes – without requiring a cost-prohibitive investment in additional server hardware. The company is meeting this challenge by running MySQL database software and the InnoDB storage engine for MySQL on the Solaris 10 Operating System.
The combination of MySQL, InnoDB, and Solaris 10 enables Fotolog to efficiently process ever-larger numbers of transactions by simply optimizing schema for data access patterns and increasing the number of concurrent threads—or the number of transactions that can be run at one time—without increasing the number of servers. So far, the company has scaled from 8 to 32 and then to 64 threads, and it expects to increase that number to 96 next. Fotolog scaled specifically by increasing thread concurrency in MySQL under Solaris 10, using InnoDB efficiently, and porting its PHP application to Java™. The Java port allowed Fotolog to actually decrease the number of speakers serving the site.

The advantages of Solaris 10 as a platform for scalability
Fotolog could have chosen to build the data storage and processing architecture for its Web site on Linux; it is, after all, an open platform that supports a wide variety of hardware and applications, just as Solaris 10 does. The difference for Fotolog was in their ability to support multiple concurrent threads. Apparently, the higher the number of concurrent threads running, the higher the risk of failure and thread thrashing with Linux. And because Fotolog had decided to pursue a concurrent-thread strategy for scaling the solution, the company elected to go with Solaris 10, which it believed to be a more thread-friendly solution—and therefore more

07-727_Sun_Fotolog-3.indd 1

12/13/07 11:04:20 AM

Fotolog

sun.com/solaris

likely to deliver the scalable performance necessary to reliably deliver website content to its members quickly and efficiently.

continue to support peak performance at peak times, Fotolog further tuned the solution by taking advantage of the “clustered index” feature on InnoDB. This feature changes the way the system responds to requests for data needed to create Fotolog pages, making it possible to perform to call up a page and all the guestbook comments associated with it using the minimal amount of disk seeks— instead of having to perform a separate disk seek for every single comment. This eliminates a significant potential for disk-based bottlenecks and slowdowns, dramatically increasing performance.

than eleven million member accounts from more than 200 countries have shared more than 300 million photos since its inception in 2002. Fotolog provides a platform for members to share experiences and connect with others across the globe by bringing together the power of digital photography, social networking, and blogging to attract and entertain in a unique and captive user experience. Fotolog recently agreed to be acquired by Hi Media, a French publicly traded company. A unique hybrid of photo sharing, social net-

Choosing the right storage engine— and tuning it for scalability
Of the data storage engines available for use with MySQL, InnoDB is the one that is known for allowing multiple pieces of data to be inserted into the database at one time. However, Fotolog found that concurrent threading alone was not enough to guard against processing slowdowns and poor service at peak times. To do that, the storage engine would have to be tuned to allow it to run more than eight concurrent threads. In addition, the schema will need to be optimized to take advantage of the storage engine offerings. Once that was accomplished, Fotolog elected to increase the number of threads running concurrently to 32, and then, shortly thereafter, to 64.

“Because we can complete a job as one request instead of up to 200 separate ones, everything can go much faster,” explains Mashraqi. “Whenever the disk needs to write, it will be available to do it.”

working, and blogging, Fotolog is the choice of millions of users worldwide to connect with friends and favorites through photos.

For more information
To learn more about the Solaris 10 operating system, visit sun.com/solaris. For additional information about Fotolog, visit fotolog.com

On the horizon
Having seen exponentially beneficial results of running 64 concurrent threads, Fotolog is now looking at doubling the number of threads to 96. The company believes, based on its experience thus far, that its current number of servers—32—will be able to continue to handle the load. “Some people solve the scaling problem by throwing hardware at it, which is not a good business outcome, especially if they don’t understand their

“At 64 threads, our members see their Fotolog pages. At 32, they wait.”
Farhan Mashraqi
Fotolog

Further optimizing the architecture to support 64 threads
Before Fotolog, no known company had ever expanded to 64 concurrent InnoDB threads on a single instance of MySQL. The traditional scalability solution has always been to scale-out by adding more servers, rather than increasing thread concurrency. To make sure that this first configuration of its kind would

bottlenecks,” says Mashraqi. “We do it by pushing Solaris to its limits.”

About Fotolog
Fotolog, Inc. is the world’s largest photoblogging community, the 18th most trafficked site on the Internet, and the 3rd most trafficked social networking site. More

Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 USA Phone 1-650-960-1300 or 1-800-555-9SUN Web sun.com
© 2007 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Solaris, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Information subject to change without notice. Printed in USA.

07-727_Sun_Fotolog-3.indd 2

12/13/07 11:04:29 AM