APACHE 2.0 A Look Under the Hood CHUUG, June 2002 by Cliff Woolley

Slides:



Advertisements
Similar presentations
HTTP and Apache Roy T. Fielding eBuilt, Inc. The Apache Software Foundation
Advertisements

CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
What all is there Inside the Apache web server. These slides are part of study material of LAMP course. Course conducted by Prof Rocky Jagtiani – Technical.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
COEN 445 Communication Networks and Protocols Lab 4
Apache Web Server v. 2.2 Reference Manual Chapter 4 Multi-Processing Modules (MPMs)
Performed by: Yair Sommer Rea Yeheskel Instructor: Idan Katz In Cooperation with:Motorola הטכניון - מכון טכנולוגי לישראל הפקולטה להנדסת חשמל Technion -
OPERATING SYSTEM OVERVIEW
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
Performed by: Yair Sommer Rea Yeheskel Instructor: Idan Katz In Cooperation with:Motorola הטכניון - מכון טכנולוגי לישראל הפקולטה להנדסת חשמל Technion -
APACHE WEBSERVER.
Linux Networking CIS Why Linux/Unix? Configurability ▫Customizable System to satisfy unique needs. Scalability ▫Able to serve an increasing number.
1 Web Servers Web Protocols and Practice Chapter 4.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Apache Architecture. How do we measure performance? Benchmarks –Requests per Second –Bandwidth –Latency –Concurrency (Scalability)
Fronting Tomcat with Apache Httpd Mladen Turk Red Hat, Inc.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
22-Aug-15 | 1 |1 | Help! I need more servers! What do I do? Scaling a PHP application.
Christopher Bednarz Justin Jones Prof. Xiang ECE 4986 Fall Department of Electrical and Computer Engineering University.
Mod_lua for beginners Eric Covener, IBM November 2011.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
CSCC69: Operating Systems Assignment 3 Review. Assignment Review Implement the file-related system calls – open, close, dup2 – read, write, lseek – chdir,
Web Services CSCI N321 – System and Network Administration Copyright © 2007,2008 by Scott Orr and the Trustees of Indiana University.
CHEN Ge CSIS, HKU March 9, Jigsaw W3C’s Java Web Server.
SB Implementing ScriptBasic Multi- Thread How to embed ScriptBasic multi-thread?
Advanced Topics in Module Design: Threadsafety and Portability Aaron Bannert
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
Apache Web Server. Aim of this section –Introduce you to workings of the most common webserver –Give you a little experience in role of webmaster Configuring.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
© 2001 Covalent Technologies – Commercial in Confidence – 29 January Writing Apache 2.0 Modules and porting 1.3 modules to 2.0 Dirk-Willem van.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
APACHE 조준희 (Cho, Junhee)
© 2004 OPNET Technologies, Inc. All rights reserved. OPNET and OPNET product names are trademarks of OPNET Technologies, Inc. ARMing Apache David Carter.
Processes Introduction to Operating Systems: Module 3.
Apache API Notes Robert S. Thau (Presented by Justin Erenkrantz)
– Mod_perl : Performance CGI Introduction to mod_perl Mod_perl : Performance CGI in Apache mod_perl is more than CGI scripting.
1 MSRBot Web Crawler Dennis Fetterly Microsoft Research Silicon Valley Lab © Microsoft Corporation.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Marcelo R.N. Mendes. What is FINCoS? A set of tools for data generation, load submission, and performance measurement of CEP systems; Main Characteristics:
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
Apache Global Configuration Apache MPM (multi-processing modul) Common Directives.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
More than one site? Use multiple configuration files Use multiple configuration files  httpd –d {path}  Assumes “conf/httpd.conf” Logging transactions.
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
CSCC69: Operating Systems Tutorial 10. Hints on testing Assignment 3 How to test tlb replacement algorithms? – Write a program that creates an array larger.
Performance Optimization in Apache 2.0 Development: How we made Apache faster, and what we learned from the experience O’Reilly Open.
By Ruizhe Ma, Avinash Madineni Sidoine Lafleur Kamgang Nov,
IBM Http Server Basic Administration. CONTENTS Web server IHS How does IHS differ from Apache Basic configurations Advanced Configurations Performance.
Module 9. Dealing with Generalization Course: Refactoring.
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Apache Configuration. Application Install IBM HTTP Server is Apache.
NWCLUG 04/06/2010 Jared Moore L A M P.
Efficient Software-Based Fault Isolation
Web Protocols and Practice
Dockerize OpenEdge Srinivasa Rao Nalla.
CS 6560: Operating Systems Design
SOFTWARE DESIGN AND ARCHITECTURE
Modularity and Memory Clearly, programs must have access to memory
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
Threads and Cooperation
Challenges in Network Troubleshooting In big scale networks, when an issue like latency or packet drops occur its very hard sometimes to pinpoint.
Unit-5 Chap-1 Configuring Web Server
Lecture Topics: 11/1 General Operating System Concepts Processes
Issues in Client/Server Programming
Outline Operating System Organization Operating System Examples
CSE 153 Design of Operating Systems Winter 2019
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

APACHE 2.0 A Look Under the Hood CHUUG, June 2002 by Cliff Woolley

Introduction Assumptions The problems with the design of 1.3 How Apache 2.0 addresses them

Assumptions You are somewhat familiar with configuring Apache 1.3 That you understand the concept of Apache modules

The problems with 1.3 Non-standard configuration scripts Porting to new and unusual platforms is difficult Doesn’t scale well Modules can’t interact in particularly interesting ways

How Apache 2.0 addresses these design problems Configuration now uses GNU autoconf The Apache Portable Runtime (APR) Multi-Processing Modules (MPMs) I/O filtering “hooks”

The build environment: Using GNU autoconf No more APACI – now it’s the real thing No more Configuration.tmpl – everything uses./configure arguments (hint: look at config.nice) Autoconf’s feature tests are nice from a developer’s perspective

The build environment: The source tree layout Modules categorized by function, not just lumped together Platform-specific files hidden away Vendors can add their own module directories

The Apache Portable Runtime Platform Abstraction Resource Management Consistency, consistency, consistency

APR: Platform abstraction Feature tests Native OS-specific data structures hidden behind a consistent interface

APR: Resource management Memory allocation handled for you Resource lifetimes arranged into a tree that’s easy to prune

APR: All about consistency …interface to the Operating System …resource handling Naming convention! (i.e., be ready for renames)

Multi-Processing Modules What are they? How do you configure them? Which one is best?

MPMs defined A module that is specialized for managing the process/thread model used by Apache on a particular platform Each has its own target OS and scalability goals

MPM configuration # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0

MPM configuration # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0

MPMs: How to choose Benchmark!! (but don’t trust ab) Consider RAM usage vs. performance, etc. Other tunability factors too, but this is the big one

Filtered I/O Bucket Brigades (my specialty :) Input Filters Output Filters

Bucket Brigades A convenient abstract data type What do they look like? How are they used? What good are they?

Input filtering Data is “pulled” from the client through the input filters Each filter transforms the data it hands back to its caller in some way Order is assigned at the beginning of each request

Output filtering The most common form – interesting things happen when old-style “handlers” get converted into output filters Data is “pushed” to the client through the output filters Again, each filter transforms the data that passes through it

Apache modules The module structure itself has changed: module MODULE_VAR_EXPORT foo_module = { STANDARD_MODULE_STUFF, foo_init_Module, /* module initializer */ foo_config_perdir_create, /* create per-dir config structures */ foo_config_perdir_merge, /* merge per-dir config structures */ foo_config_server_create, /* create per-server config structures */ foo_config_server_merge, /* merge per-server config structures */ foo_config_cmds, /* table of config file commands */ foo_config_handler, /* [#8] MIME-typed-dispatched handlers */ foo_hook_Translate, /* [#1] URI to filename translation */ foo_hook_Auth, /* [#4] validate user id from request */ foo_hook_UserCheck, /* [#5] check if the user is ok _here_ */ foo_hook_Access, /* [#3] check access by host address */ NULL, /* [#6] determine MIME type */ foo_hook_Fixup, /* [#7] pre-run fixups */ NULL, /* [#9] log a transaction */ NULL, /* [#2] header parser */ foo_init_Child, /* child_init */ NULL, /* child_exit */ foo_hook_ReadReq, /* [#0] post read-request */ };

Apache modules The module structure itself has changed: module AP_MODULE_DECLARE_DATA foo_module = { STANDARD20_MODULE_STUFF, foo_config_perdir_create, /* create per-dir config structures */ foo_config_perdir_merge, /* merge per-dir config structures */ foo_config_server_create, /* create per-server config structures */ foo_config_server_merge, /* merge per-server config structures */ foo_config_cmds, /* table of configuration directives */ foo_register_hooks /* register hooks */ };

Apache modules What happened to all the other functions? How does a module register interest in one of those functions?

Hooks A new, more flexible replacement for most of the module_struct’s “phases” Order is runtime-selectable (mostly) Any module can register its own hooks – this allows a whole new level of inter- module cooperation

Hooks: example static void register_hooks(apr_pool_t *p) { APR_REGISTER_OPTIONAL_FN(ap_ssi_get_tag_and_value); APR_REGISTER_OPTIONAL_FN(ap_ssi_parse_string); APR_REGISTER_OPTIONAL_FN(ap_register_include_handler); ap_hook_post_config(include_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST); ap_hook_fixups(include_fixup, NULL, NULL, APR_HOOK_LAST); ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_RESOURCE); }

Hooks: example cont. static int include_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { include_hash = apr_hash_make(p); ssi_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_include_handler); if(ssi_pfn_register) { ssi_pfn_register("if", handle_if); ssi_pfn_register("set", handle_set); ssi_pfn_register("else", handle_else); } return OK; }

Conclusion What will I get when upgrading to Apache 2.0? What won’t I get (yet)? Future directions

Questions?