IPW2008 - my.opera.com scalability
- 8. My Opera Community
http://my.opera.com
blogs shoutbox
Opera browser promotion
photo albums
RSS-Atom feeds
slideshows
custom designs
Public APIs
xml/json forums
- 16. Users (k)
2.500 *
1.640 IPW2008
887
430
257 205
1 10 50
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
- 17. Users (k)
Servers
2.500 *
IPW2008
1.640
887
430
257 205
1 10 50
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
- 18. Users (k)
Servers
Dyn req/s
2.500*
1.640
887
257 205 430
1 10 50
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
- 21. Start
Y
Does it run?
Does it N
N scale?
No problem...
Identify and fix
Wait and restart Y bottlenecks
End
- 25. lvs +
lw httpd
mod_perl
.....
backends
nfs server
disk cache
users store
- 26. lvs +
lw httpd
mod_perl
.....
backends
nfs server
disk cache
users store
- 27. lvs +
lw httpd
mod_perl
.....
backends
nfs server
disk cache
users store
- 30. /* problem */
1 function
(XWA::Quote2Dev::Quote)
~95% req time
- 31. /* solution */
Start
Y Great. Serve
In Cache? from cache.
N
Query DB, etc... Done!
Put it in cache
this time!
- 32. /* solution */
Yes, that simple!
Profiling is key.
try:
m{^ Devel:: .* Prof .*}x
- 36. /* problem */
a single forum page
~~
50 avatars
(crappy CGI backend requests)
- 38. new storage subsystem
pools, servers
fault tolerance, redundancy
webdav, http, ftp,
scp, mogilefs?, ...
- 39. user uploads use case
# Create resource object for avatar
my $res = MyOpera::Storage::Resource::Avatar->new(
owner => '{userid}',
content => '{binary data}',
);
# Main storage subsystem handle
my $storage = MyOpera::Storage->new();
# Upload on pools of servers all at once
my $ok = $storage->upload($res);
- 40. resources
(user uploads, binary blobs, ...)
pools, servers
URLs
http://static.myopera.com/pool1/avatars/a4/754/a1b2c3d4e5f6.../<userid>_o.png
http://static.myopera.com/pool1/avatars/a4/754/a1b2c3d4e5f6.../<userid>_t.jpg
http://static.myopera.com/pool1/avatars/a4/754/a1b2c3d4e5f6.../<userid>_m.jpg
http://static.myopera.com/pool1/avatars/a4/754/a1b2c3d4e5f6.../<userid>_l.jpg
- 46. /* solution */
ideas taken from
HTML::Mason, Django, ...
patched File::NFSLock
- 50. /* try 1 */
load-balanced
database profiles
- 54. soft counters
(didn't work as expected, in progress...)
sacrifice speed for concurrency
(mysql's myisam locks all table on update)
- 55. /* future directions */
database partitioning?
modperl backend optimization?
threading sucks in mp2. debian anyone?
improve memory sharing?
sysadmin-level optimizations?