SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
my.opera.com scalability v2
         Nordic Perl Workshop ~ Oslo 2009
               cosimo streppone <cosimo@cpan.org>
Users (k)
                                                                2.500




                                                        1.640



                                                 887

                                          430
                            257 205
                     50
              10
        1
2000   2001   2002   2003   2004   2005   2006   2007    2008    2009
Users (k)
                              Servers
                              Dyn req/s




                                                                2.500

                                                        1.640

                                                 887
                            257 205 430
                     50
              10
        1
2000   2001   2002   2003   2004   2005   2006   2007    2008    2009
espenao> proxys all over. MOC is dying?
hkmoen> did MOC just die?
...
fred joined #myopera
fred> lots of proxys...
fred left #myopera
...
cosimo> WTF? ok, looking into it
static avatars
(or “put your http servers at work”)
new storage subsystem
          pools, servers
  fault tolerance, redundancy

      webdav, http, ftp,
      scp, mogilefs?, ...
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);
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
package HTTP::DAV;
...
#
# Retrieves info about a DAV url
#
# depth=0 avoids descending into dirs
#
sub propfind {
    my ($self, $url, $depth) = @_;
      $depth ||= 1;
      # ...
}
new cool static URLs
  http://static.myopera.com/
    /avatars/pool1/
    /dL/rLA/vdUxYn14kfe342QEM/
    /<user-id>_s.jpg



       crappy CGI-style URLs
http://my.opera.com/<user>/avatar.pl
/* results */


saved ~500k backend req/day

    browser cache used!
shared-nothing
  architecture
  (“zero tolerance for sharing”)
lvs +
        lw httpd



        mod_perl
.....
        backends



        nfs server
        disk cache
        users store
dogpile effect
(or the cache “storms”)
nfs-based file cache
/var/cache/myopera/
/var/cache/myopera/feeds/
/var/cache/myopera/blogs/
...

/var/cache/myopera/user/
/var/cache/myopera/user/1
/var/cache/myopera/user/10
/var/cache/myopera/user/11
/var/cache/myopera/user/2
...
(another 2 million entries)
...
/var/cache/myopera/user/1999999

        (on ext3)
soft counters

use MyOpera::Counter;

my $counter = MyOpera::Counter->new({
    key => “blog.access-$entry”,
    sync => sub {
        my ($value) = @_;
        # Real table update code
        ...
    }
});

$counter->inc();
dml statistics
[DML] time=1237308152, user=,
url=/tinh_yeu_cua_anh_b88/blog/index.dml/tag/...,
name=XWA::User, variable=active, type=module,
elapsed=0.068473, host=my.opera.com

[DML] time=1237308152, user=, url=/community/,
name=XWA::User, variable=, type=module, elapsed=0.015935,
host=my.opera.com

[DML] ...
top time-intensive modules
XWA::XMLProd::User::Sidebar   2024.919s   (27.2%, 0.28 s/call)
XWA::User                     1778.445s   (23.9%, 0.09 s/call)
XWA::User::Journal            1121.224s   (15.1%, 0.24 s/call)
XWA::User::Album               321.522s   ( 4.3%, 0.17 s/call)
XWA::User::Journal::Search     223.477s   ( 3.0%, 20.32 s/call)
XWA::User::Comments            188.011s   ( 2.5%, 0.05 s/call)
XWA::Skins                     180.486s   ( 2.4%, 0.49 s/call)
XWA::User::JournalArchive      159.525s   ( 2.1%, 4.43 s/call)
XWA::User::Posts               146.644s   ( 2.0%, 0.45 s/call)
XWA::User::Picture             141.324s   ( 1.9%, 0.10 s/call)
XWA::Albums                     93.740s   ( 1.3%, 2.04 s/call)
XWA::Journals                   92.390s   ( 1.2%, 2.37 s/call)
most called modules
XWA::User                     18784   calls   28.9%
XWA::XMLProd::User::Sidebar    7186   calls   11.1%
XWA::User::Spotlight           6439   calls    9.9%
XWA::Util::OneTimeKey          5576   calls    8.6%
XWA::User::Journal             4681   calls    7.2%
XWA::OIVWrapper                3974   calls    6.1%
XWA::User::Comments            3890   calls    6.0%
XWA::User::Album               1881   calls    2.9%
XWA::User::Ratings             1500   calls    2.3%
XWA::User::Picture             1485   calls    2.3%
XWA::XMLProd::MemberCount       611   calls    0.9%
XWA::XMLProd::Queue             589   calls    0.9%
XWA::Spotlight                  569   calls    0.9%
MyOpera::DML::FastFacts         567   calls    0.9%
XWA::XMLProd::Variables         562   calls    0.9%
slowest modules
XWA::User::Journal::Search      20.32s   (11   calls)
XWA::User::JournalArchive        4.43s   (36   calls)
XWA::User::GeneratePassword      3.76s   (3    calls)
XWA::XMLProd::Link::Bookmarks    3.45s   (12   calls)
XWA::Fans                        3.37s   (10   calls)
XWA::User::ForumLatestFriends    3.36s   (11   calls)
XWA::User::ForumNew              2.42s   (3    calls)
XWA::Journals                    2.37s   (39   calls)
XWA::Albums                      2.04s   (46   calls)
XWA::XMLProd::UserSearch         1.87s   (2    calls)
XWA::Jahoo                       1.83s   (46   calls)
XWA::Forum                       1.64s   (49   calls)
XWA::XMLProd::Link::Trash        0.86s   (2    calls)
XWA::XMLProd::LocationSearch     0.72s   (43   calls)
XWA::User::ForumSearch           0.67s   (78   calls)
?questions?
low level TCP/IP “throttling”


# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source             destination
ACCEPT     all -- x.x.x.x/x            anywhere
           limit: avg 20/sec burst 5
ACCEPT     all -- y.y.y.y/x            anywhere
           limit: avg 20/sec burst 5
DROP       all -- x.x.x.x/x            anywhere
DROP       all -- y.y.y.y/y            anywhere
full-page caching


- limiting “barrier”

- url hotlist
mod_cband
Web site monitoring,
in case the live demo fails
             :-)
NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0

Más contenido relacionado

La actualidad más candente

Varnish @ Velocity Ignite
Varnish @ Velocity IgniteVarnish @ Velocity Ignite
Varnish @ Velocity Ignite
Artur Bergman
 
glance replicator
glance replicatorglance replicator
glance replicator
irix_jp
 
0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services
Ilya Grigorik
 

La actualidad más candente (20)

Tuning Solr for Logs
Tuning Solr for LogsTuning Solr for Logs
Tuning Solr for Logs
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
Solr for Indexing and Searching Logs
Solr for Indexing and Searching LogsSolr for Indexing and Searching Logs
Solr for Indexing and Searching Logs
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof Networks
 
Decoding the Art of Red Teaming - OWASP Seasides
Decoding the Art of Red Teaming - OWASP SeasidesDecoding the Art of Red Teaming - OWASP Seasides
Decoding the Art of Red Teaming - OWASP Seasides
 
Administering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersAdministering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud Clusters
 
Varnish @ Velocity Ignite
Varnish @ Velocity IgniteVarnish @ Velocity Ignite
Varnish @ Velocity Ignite
 
Restfs internals
Restfs internalsRestfs internals
Restfs internals
 
glance replicator
glance replicatorglance replicator
glance replicator
 
0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013
 
톰캣 #09-쓰레드
톰캣 #09-쓰레드톰캣 #09-쓰레드
톰캣 #09-쓰레드
 
Riyaj real world performance issues rac focus
Riyaj real world performance issues rac focusRiyaj real world performance issues rac focus
Riyaj real world performance issues rac focus
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Fixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsFixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data Patterns
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
 

Destacado

Destacado (9)

My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009
 
Italian, do you speak it?
Italian, do you speak it?Italian, do you speak it?
Italian, do you speak it?
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera Software
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalability
 
YAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses PerlYAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses Perl
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard Way
 
Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attack
 

Similar a NPW2009 - my.opera.com scalability v2.0

OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 
Surge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.comSurge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.com
Cosimo Streppone
 
20140425 ruby conftaiwan2014
20140425 ruby conftaiwan201420140425 ruby conftaiwan2014
20140425 ruby conftaiwan2014
Hiroshi SHIBATA
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
davidblum
 
Avtex Lync 2013 Event - Fargo
Avtex Lync 2013 Event - FargoAvtex Lync 2013 Event - Fargo
Avtex Lync 2013 Event - Fargo
Avtex
 

Similar a NPW2009 - my.opera.com scalability v2.0 (20)

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
RESTful OGC Services
RESTful OGC ServicesRESTful OGC Services
RESTful OGC Services
 
Surge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.comSurge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.com
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Fundamentals of Physical Memory Analysis
Fundamentals of Physical Memory AnalysisFundamentals of Physical Memory Analysis
Fundamentals of Physical Memory Analysis
 
20140425 ruby conftaiwan2014
20140425 ruby conftaiwan201420140425 ruby conftaiwan2014
20140425 ruby conftaiwan2014
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling Twitter
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
 
Otimizando seu projeto Rails
Otimizando seu projeto RailsOtimizando seu projeto Rails
Otimizando seu projeto Rails
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Data Streaming Ecosystem Management at Booking.com
Data Streaming Ecosystem Management at Booking.com Data Streaming Ecosystem Management at Booking.com
Data Streaming Ecosystem Management at Booking.com
 
SQL Server On SANs
SQL Server On SANsSQL Server On SANs
SQL Server On SANs
 
Avtex Lync 2013 Event - Fargo
Avtex Lync 2013 Event - FargoAvtex Lync 2013 Event - Fargo
Avtex Lync 2013 Event - Fargo
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

NPW2009 - my.opera.com scalability v2.0

  • 1. my.opera.com scalability v2 Nordic Perl Workshop ~ Oslo 2009 cosimo streppone <cosimo@cpan.org>
  • 2.
  • 3.
  • 4. Users (k) 2.500 1.640 887 430 257 205 50 10 1 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
  • 5. Users (k) Servers Dyn req/s 2.500 1.640 887 257 205 430 50 10 1 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
  • 6.
  • 7. espenao> proxys all over. MOC is dying? hkmoen> did MOC just die? ... fred joined #myopera fred> lots of proxys... fred left #myopera ... cosimo> WTF? ok, looking into it
  • 8. static avatars (or “put your http servers at work”)
  • 9.
  • 10. new storage subsystem pools, servers fault tolerance, redundancy webdav, http, ftp, scp, mogilefs?, ...
  • 11. 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);
  • 12. 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
  • 13. package HTTP::DAV; ... # # Retrieves info about a DAV url # # depth=0 avoids descending into dirs # sub propfind { my ($self, $url, $depth) = @_; $depth ||= 1; # ... }
  • 14. new cool static URLs http://static.myopera.com/ /avatars/pool1/ /dL/rLA/vdUxYn14kfe342QEM/ /<user-id>_s.jpg crappy CGI-style URLs http://my.opera.com/<user>/avatar.pl
  • 15. /* results */ saved ~500k backend req/day browser cache used!
  • 16. shared-nothing architecture (“zero tolerance for sharing”)
  • 17. lvs + lw httpd mod_perl ..... backends nfs server disk cache users store
  • 18. dogpile effect (or the cache “storms”)
  • 20. soft counters use MyOpera::Counter; my $counter = MyOpera::Counter->new({ key => “blog.access-$entry”, sync => sub { my ($value) = @_; # Real table update code ... } }); $counter->inc();
  • 21. dml statistics [DML] time=1237308152, user=, url=/tinh_yeu_cua_anh_b88/blog/index.dml/tag/..., name=XWA::User, variable=active, type=module, elapsed=0.068473, host=my.opera.com [DML] time=1237308152, user=, url=/community/, name=XWA::User, variable=, type=module, elapsed=0.015935, host=my.opera.com [DML] ...
  • 22. top time-intensive modules XWA::XMLProd::User::Sidebar 2024.919s (27.2%, 0.28 s/call) XWA::User 1778.445s (23.9%, 0.09 s/call) XWA::User::Journal 1121.224s (15.1%, 0.24 s/call) XWA::User::Album 321.522s ( 4.3%, 0.17 s/call) XWA::User::Journal::Search 223.477s ( 3.0%, 20.32 s/call) XWA::User::Comments 188.011s ( 2.5%, 0.05 s/call) XWA::Skins 180.486s ( 2.4%, 0.49 s/call) XWA::User::JournalArchive 159.525s ( 2.1%, 4.43 s/call) XWA::User::Posts 146.644s ( 2.0%, 0.45 s/call) XWA::User::Picture 141.324s ( 1.9%, 0.10 s/call) XWA::Albums 93.740s ( 1.3%, 2.04 s/call) XWA::Journals 92.390s ( 1.2%, 2.37 s/call)
  • 23. most called modules XWA::User 18784 calls 28.9% XWA::XMLProd::User::Sidebar 7186 calls 11.1% XWA::User::Spotlight 6439 calls 9.9% XWA::Util::OneTimeKey 5576 calls 8.6% XWA::User::Journal 4681 calls 7.2% XWA::OIVWrapper 3974 calls 6.1% XWA::User::Comments 3890 calls 6.0% XWA::User::Album 1881 calls 2.9% XWA::User::Ratings 1500 calls 2.3% XWA::User::Picture 1485 calls 2.3% XWA::XMLProd::MemberCount 611 calls 0.9% XWA::XMLProd::Queue 589 calls 0.9% XWA::Spotlight 569 calls 0.9% MyOpera::DML::FastFacts 567 calls 0.9% XWA::XMLProd::Variables 562 calls 0.9%
  • 24. slowest modules XWA::User::Journal::Search 20.32s (11 calls) XWA::User::JournalArchive 4.43s (36 calls) XWA::User::GeneratePassword 3.76s (3 calls) XWA::XMLProd::Link::Bookmarks 3.45s (12 calls) XWA::Fans 3.37s (10 calls) XWA::User::ForumLatestFriends 3.36s (11 calls) XWA::User::ForumNew 2.42s (3 calls) XWA::Journals 2.37s (39 calls) XWA::Albums 2.04s (46 calls) XWA::XMLProd::UserSearch 1.87s (2 calls) XWA::Jahoo 1.83s (46 calls) XWA::Forum 1.64s (49 calls) XWA::XMLProd::Link::Trash 0.86s (2 calls) XWA::XMLProd::LocationSearch 0.72s (43 calls) XWA::User::ForumSearch 0.67s (78 calls)
  • 26. low level TCP/IP “throttling” # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- x.x.x.x/x anywhere limit: avg 20/sec burst 5 ACCEPT all -- y.y.y.y/x anywhere limit: avg 20/sec burst 5 DROP all -- x.x.x.x/x anywhere DROP all -- y.y.y.y/y anywhere
  • 27. full-page caching - limiting “barrier” - url hotlist
  • 29. Web site monitoring, in case the live demo fails :-)