SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Beyond Apache: Faster Web
         Servers
       Siddharth Vijayakrishnan
        mail@bluefireworks.net




                                  Beyond Apache: Faster Web Servers – p.1/11
About me
 •   Application developer with Oracle India
 •   Work on web servers in my free time
 •   Contributor to Lighttpd




                                      Beyond Apache: Faster Web Servers – p.2/11
Executive summary
  •   How does a web server work?
  •   How can it made to work faster
  •   Apache
  •   Other web servers
  •   Lighttpd
  •   The road ahead




                                       Beyond Apache: Faster Web Servers – p.3/11
Let’s write a web server
  •   First try:socket(), bind(), listen(),
      accept(),sendresponse(), close()
  •   Second try: socket(), bind(),listen(), accept(),
      fork() etc
  •   Second try better than the first since it can handle
      multiple connections
  •   A lot of web servers do just this and work just fine




                                         Beyond Apache: Faster Web Servers – p.4/11
What’s wrong then?
  •   This model does not scale well
  •   Model breaks down completely under overload
      conditions
       • Slashdot effect / "Thundering Herd" problem
       • Distributed Denial of Service attacks




                                      Beyond Apache: Faster Web Servers – p.5/11
Threads v/s Event Driven
  •   Threads:-
       • Kernel schedulers are getting better at their
         job
       • Scales well on SMP systems
       • Throughput degrades drastically under heavy
         load




                                        Beyond Apache: Faster Web Servers – p.6/11
Threads v/s Event Driven
  •   Event Driven:-
       • Avoids the nasty beasties - synchronization,
         dead lock, adaptive process spawning etc
       • Scales nicely under overload
       • A single process event driven design cannot
         take advantage of SMP
       • Blocking I/O can degrade performance of the
         event driven model




                                       Beyond Apache: Faster Web Servers – p.7/11
The Apache Web Server
  •   Poster child of the OSS revolution
  •   Feature rich
  •   Module API allows extensions to server
      functionality
  •   Apache2 supports multiple processing models
       • prefork
       • worker
       • experimental event driven mode




                                      Beyond Apache: Faster Web Servers – p.8/11
What Ails Apache?
  •   Slow adoption of Apache2 (some stats here)
  •   Apache 1.3 (the most popular version) suffers
      from generic multi process server scalability
      issues
  •   Rich feature set can sometimes be a problem e.g
        • httpd.conf / rewrite / virtual hosting are not
          the easiest to get right
        • Support for .htaccess slows down processing




                                         Beyond Apache: Faster Web Servers – p.9/11
Others in the fray
  •   thttpd
        • Really fast at serving static content
        • Not much support for anything else

  •   zeus
        • Fast but not open source

  •   Others:
        • gatling, cherokee, boa, nginx, mathopd
        • Matrix showing features present and lacking




                                       Beyond Apache: Faster Web Servers – p.10/11
Experimental Efforts
  •   Tux (kernelspace httpd), Flash
       • Inspired by the Mindcraft survey that showed
         IIS to be faster than Apache
       • Tux was a nice experiment till sendfile()
         arrived
  •   Flash
       • has an excellent specWEB 99 score
       • Hybrid design model - Asymmetric
         Multiprocess Event Driven
       • Judicious use of threads to get around the
         flaws in the event driven model
  •   Lazy Asynchronous I/O
                                      Beyond Apache: Faster Web Servers – p.11/11
Lighttpd: A Viable Alternative
  •   Began as an experiment to prove that a web
      server running as a single process could
      withstand the thundering herds
  •   Stuff to be added here




                                      Beyond Apache: Faster Web Servers – p.12/11
Lighttpd: Features
  •   Standard Set
       • HTTP/1.1 support, SSL,
         FastCGI,CGI,WebDAV, IPv6
       • Module API available

  •   Unique Features
       • Works with different event handlers
       • Memcache integration
       • Workarounds for most of the problems that
         event driven servers face
       • Really simple configuration




                                      Beyond Apache: Faster Web Servers – p.13/11
Lighttpd: Currently
  •   19,000 installations as per the last Netcraft survey
  •   Phenomenal growth rate in the number of servers
      running lighty
  •   Release 1.4.7 is out
       • Release early, Release often -> A release
         every two or three weeks
  •   Enthusiastic response from the ’frameworks’
      crowd
       • RoR users form the most vocal support group

  •   Some popular sites running Lighttpd
       • www.nexopia.com
       • wikipedia image/download servers
       • Textdrive                       Beyond Apache: Faster Web Servers – p.14/11
Lighttpd: How Does It Compare
  •   benchmark data goes here




                                 Beyond Apache: Faster Web Servers – p.15/11
Lighttpd: Future
  •   Filters
  •   Windows port (if someone gets the time)
  •   Get the server into all major distributions
  •   More and more modules (contributions will be
      gratefully accepted)




                                      Beyond Apache: Faster Web Servers – p.16/11

Mais conteúdo relacionado

Mais procurados

Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutSander Temme
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelChristian Posta
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Ricard Clau
 
Roll your own FOSS cloud hosting
Roll your own FOSS cloud hostingRoll your own FOSS cloud hosting
Roll your own FOSS cloud hostingRussell Searle
 
Modern software architectures - PHP UK Conference 2015
Modern software architectures - PHP UK Conference 2015Modern software architectures - PHP UK Conference 2015
Modern software architectures - PHP UK Conference 2015Ricard Clau
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsAchievers Tech
 
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...PHP Conference Argentina
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceValeri Karpov
 

Mais procurados (10)

Stackato v2
Stackato v2Stackato v2
Stackato v2
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache Camel
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
 
Roll your own FOSS cloud hosting
Roll your own FOSS cloud hostingRoll your own FOSS cloud hosting
Roll your own FOSS cloud hosting
 
Modern software architectures - PHP UK Conference 2015
Modern software architectures - PHP UK Conference 2015Modern software architectures - PHP UK Conference 2015
Modern software architectures - PHP UK Conference 2015
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
 
Don't worry with bower
Don't worry with bowerDon't worry with bower
Don't worry with bower
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-Service
 

Destaque

SoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk FunctionalitySoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk Functionalitywebhostingguy
 
HC INSTALLATION GUIDE
HC INSTALLATION GUIDE HC INSTALLATION GUIDE
HC INSTALLATION GUIDE webhostingguy
 
Parallels Presentation Materials
Parallels Presentation MaterialsParallels Presentation Materials
Parallels Presentation Materialswebhostingguy
 
Dedicated Server Service Agreement
Dedicated Server Service AgreementDedicated Server Service Agreement
Dedicated Server Service Agreementwebhostingguy
 

Destaque (7)

Web Server Primer
Web Server PrimerWeb Server Primer
Web Server Primer
 
elc200day13.ppt
elc200day13.pptelc200day13.ppt
elc200day13.ppt
 
SoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk FunctionalitySoftLayer-Extending Plesk Functionality
SoftLayer-Extending Plesk Functionality
 
HC INSTALLATION GUIDE
HC INSTALLATION GUIDE HC INSTALLATION GUIDE
HC INSTALLATION GUIDE
 
Parallels Presentation Materials
Parallels Presentation MaterialsParallels Presentation Materials
Parallels Presentation Materials
 
Dedicated Server Service Agreement
Dedicated Server Service AgreementDedicated Server Service Agreement
Dedicated Server Service Agreement
 
File Upload
File UploadFile Upload
File Upload
 

Semelhante a Beyond Apache: Lighttpd as a Faster Web Server Alternative

DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilitycherryhillco
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptxsanjanabal
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
My site is slow
My site is slowMy site is slow
My site is slowhernanibf
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640LLC NewLink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 

Semelhante a Beyond Apache: Lighttpd as a Faster Web Server Alternative (20)

DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptx
 
2 7
2 72 7
2 7
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
title
titletitle
title
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
My site is slow
My site is slowMy site is slow
My site is slow
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 

Mais de webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guidewebhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3webhostingguy
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serverswebhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidationwebhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreementwebhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructurewebhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.pptwebhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandiserswebhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Productswebhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mbwebhostingguy
 
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...webhostingguy
 

Mais de webhostingguy (20)

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
 

Beyond Apache: Lighttpd as a Faster Web Server Alternative

  • 1. Beyond Apache: Faster Web Servers Siddharth Vijayakrishnan mail@bluefireworks.net Beyond Apache: Faster Web Servers – p.1/11
  • 2. About me • Application developer with Oracle India • Work on web servers in my free time • Contributor to Lighttpd Beyond Apache: Faster Web Servers – p.2/11
  • 3. Executive summary • How does a web server work? • How can it made to work faster • Apache • Other web servers • Lighttpd • The road ahead Beyond Apache: Faster Web Servers – p.3/11
  • 4. Let’s write a web server • First try:socket(), bind(), listen(), accept(),sendresponse(), close() • Second try: socket(), bind(),listen(), accept(), fork() etc • Second try better than the first since it can handle multiple connections • A lot of web servers do just this and work just fine Beyond Apache: Faster Web Servers – p.4/11
  • 5. What’s wrong then? • This model does not scale well • Model breaks down completely under overload conditions • Slashdot effect / "Thundering Herd" problem • Distributed Denial of Service attacks Beyond Apache: Faster Web Servers – p.5/11
  • 6. Threads v/s Event Driven • Threads:- • Kernel schedulers are getting better at their job • Scales well on SMP systems • Throughput degrades drastically under heavy load Beyond Apache: Faster Web Servers – p.6/11
  • 7. Threads v/s Event Driven • Event Driven:- • Avoids the nasty beasties - synchronization, dead lock, adaptive process spawning etc • Scales nicely under overload • A single process event driven design cannot take advantage of SMP • Blocking I/O can degrade performance of the event driven model Beyond Apache: Faster Web Servers – p.7/11
  • 8. The Apache Web Server • Poster child of the OSS revolution • Feature rich • Module API allows extensions to server functionality • Apache2 supports multiple processing models • prefork • worker • experimental event driven mode Beyond Apache: Faster Web Servers – p.8/11
  • 9. What Ails Apache? • Slow adoption of Apache2 (some stats here) • Apache 1.3 (the most popular version) suffers from generic multi process server scalability issues • Rich feature set can sometimes be a problem e.g • httpd.conf / rewrite / virtual hosting are not the easiest to get right • Support for .htaccess slows down processing Beyond Apache: Faster Web Servers – p.9/11
  • 10. Others in the fray • thttpd • Really fast at serving static content • Not much support for anything else • zeus • Fast but not open source • Others: • gatling, cherokee, boa, nginx, mathopd • Matrix showing features present and lacking Beyond Apache: Faster Web Servers – p.10/11
  • 11. Experimental Efforts • Tux (kernelspace httpd), Flash • Inspired by the Mindcraft survey that showed IIS to be faster than Apache • Tux was a nice experiment till sendfile() arrived • Flash • has an excellent specWEB 99 score • Hybrid design model - Asymmetric Multiprocess Event Driven • Judicious use of threads to get around the flaws in the event driven model • Lazy Asynchronous I/O Beyond Apache: Faster Web Servers – p.11/11
  • 12. Lighttpd: A Viable Alternative • Began as an experiment to prove that a web server running as a single process could withstand the thundering herds • Stuff to be added here Beyond Apache: Faster Web Servers – p.12/11
  • 13. Lighttpd: Features • Standard Set • HTTP/1.1 support, SSL, FastCGI,CGI,WebDAV, IPv6 • Module API available • Unique Features • Works with different event handlers • Memcache integration • Workarounds for most of the problems that event driven servers face • Really simple configuration Beyond Apache: Faster Web Servers – p.13/11
  • 14. Lighttpd: Currently • 19,000 installations as per the last Netcraft survey • Phenomenal growth rate in the number of servers running lighty • Release 1.4.7 is out • Release early, Release often -> A release every two or three weeks • Enthusiastic response from the ’frameworks’ crowd • RoR users form the most vocal support group • Some popular sites running Lighttpd • www.nexopia.com • wikipedia image/download servers • Textdrive Beyond Apache: Faster Web Servers – p.14/11
  • 15. Lighttpd: How Does It Compare • benchmark data goes here Beyond Apache: Faster Web Servers – p.15/11
  • 16. Lighttpd: Future • Filters • Windows port (if someone gets the time) • Get the server into all major distributions • More and more modules (contributions will be gratefully accepted) Beyond Apache: Faster Web Servers – p.16/11