Accelerating Zope applications with Squid and ESI



Similar documents
Implementing Reverse Proxy Using Squid. Prepared By Visolve Squid Team

ZENworks 11 Support Pack 4 HTTP Proxy Reference. May 2016

Linux Squid Proxy Server

Setting up a Squid-Proxy Server

1. What is this? Why would I want it?

Cover Page. Content Server - Reverse Proxy Server Resource Guide 10g Release 3 ( ) March 2007

Proxy. Proxy. Computer Center, CS, NCTU. Proxy. A proxy server is a server which services the requests of its clients by: Goals: Server.

Varnish the Drupal way

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

LabVIEW Internet Toolkit User Guide

<Insert Picture Here> Oracle Web Cache 11g Overview

Working With Virtual Hosts on Pramati Server

CYAN SECURE WEB APPLIANCE. User interface manual

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Deliuery Networks. A Practical Guide to Content. Gilbert Held. Second Edition. CRC Press. Taylor & Francis Group

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Bubble Full Page Cache for Magento

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Outline Definition of Webserver HTTP Static is no fun Software SSL. Webserver. in a nutshell. Sebastian Hollizeck. June, the 4 th 2013

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

Deploying the BIG-IP System v10 with Oracle Application Server 10g R2

imhosted Web Hosting Knowledge Base

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

Search Engine Optimization for a WebSphere Commerce System

Lecture 11 Web Application Security (part 1)

ZEN LOAD BALANCER EE v3.02 DATASHEET The Load Balancing made easy

Hardened Plone. Making Your Plone Site Even More Secure. Presented by: Nathan Van Gheem

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP System v10 with Microsoft IIS 7.0 and 7.5

Load Balancing Web Applications

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

1Intro. Apache is an open source HTTP web server for Unix, Apache

Deploying the BIG-IP System with Oracle E-Business Suite 11i

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

Linux VPS with cpanel. Getting Started Guide

End User Guide The guide for /ftp account owner

Apache Tomcat. Load-balancing and Clustering. Mark Thomas, 20 November Pivotal Software, Inc. All rights reserved.

S y s t e m A r c h i t e c t u r e

Content Management Systems: Drupal Vs Jahia

SiteCelerate white paper

AS/400e. TCP/IP Services and Applications Webserver(HTTP)

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

ZEN LOAD BALANCER EE v3.04 DATASHEET The Load Balancing made easy

CS 188/219. Scalable Internet Services Andrew Mutz October 8, 2015

The course will be run on a Linux platform, but it is suitable for all UNIX based deployments.

MAGENTO HOSTING Progressive Server Performance Improvements

Load testing with. WAPT Cloud. Quick Start Guide

Configuring Nex-Gen Web Load Balancer

Deploying the BIG-IP System v10 with SAP NetWeaver and Enterprise SOA: ERP Central Component (ECC)

Ruby on Rails Secure Coding Recommendations

How to Scale out SharePoint Server 2007 from a single server farm to a 3 server farm with Microsoft Network Load Balancing on the Web servers.

HAProxy. Free, Fast High Availability and Load Balancing. Adam Thornton 10 September 2014

Layers of Caching: Key to scaling your website. Lance Albertson -- Narayan Newton

Reference and Troubleshooting: FTP, IIS, and Firewall Information


ICANWK414A Create a common gateway interface script

P and FTP Proxy caching Using a Cisco Cache Engine 550 an

Third Party Integration

Apache Tomcat & Reverse Proxies

WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide

Make a folder named Lab3. We will be using Unix redirection commands to create several output files in that folder.

Configuring Apache HTTP Server as a Reverse Proxy Server for SAS 9.2 Web Applications Deployed on BEA WebLogic Server 9.2

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

DEPLOYMENT GUIDE Version 1.2. Deploying F5 with Oracle E-Business Suite 12

CS 558 Internet Systems and Technologies

Oracle Collaboration Suite

Web Performance. Lab. Bases de Dados e Aplicações Web MIEIC, FEUP 2014/15. Sérgio Nunes

Intro to Load-Balancing Tomcat with httpd and mod_jk

DEPLOYMENT GUIDE Version 2.1. Deploying F5 with Microsoft SharePoint 2010

W3Perl A free logfile analyzer

Comparison table for an idea on features and differences between most famous statistics tools (AWStats, Analog, Webalizer,...).

SuperLumin Nemesis. Administration Guide. February 2011

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP System v9.x with Microsoft IIS 7.0 and 7.5

Configuration Worksheets for Oracle WebCenter Ensemble 10.3


Crawl Proxy Installation and Configuration Guide

Configuring IIS 6 to Load Balance a JBoss 4.2 Adobe LiveCycle Enterprise Suite 2 (ES2) Cluster

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

Running Nginx as Reverse Proxy server

Advanced Linux System Administration Knowledge GNU/LINUX Requirements

Table of Contents. Chapter 1: Installing Endpoint Application Control. Chapter 2: Getting Support. Index

Cyber Security Challenge Australia 2014

Optimizing Drupal Performance. Benchmark Results

World Wide Web. Before WWW

Configuring IBM HTTP Server as a Reverse Proxy Server for SAS 9.3 Web Applications Deployed on IBM WebSphere Application Server

Bubble Full Page Cache for Magento

DEPLOYMENT GUIDE. Deploying F5 for High Availability and Scalability of Microsoft Dynamics 4.0

Web Application Firewall

Smart Connect. Deployment Guide

FileMaker Server 15. Getting Started Guide

A Tool for Evaluation and Optimization of Web Application Performance

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP system v10 with Microsoft Exchange Outlook Web Access 2007

Chapter 22: Integrating Flex applications with portal servers

WebGUI Load Balancing

REQUIREMENTS AND INSTALLATION OF THE NEFSIS DEDICATED SERVER

Transcription:

Accelerating Zope applications with Squid and ESI Simon Eisenmann 7. Jun 2004 Göteborg, EuroPython 2004 2004 struktur AG page 1 2004 struktur AG

Squid in front of Zope - Why? Massive speedup. Only sanitized HTTP requests are proxied to ZServer. Fast and powerfull access control. HTTP Load balancing. Zero downtime on software upgrade. Serve multiple sites with one IP (virtual hosting). Extremly flexible redirection (Redirector). 2004 struktur AG page 2

Why Squid and not Apache? pro Squid: Squid is faster than Apache. Custom redirector more flexible than mod_rewrite rules. All sorts of different caching strategies and options. Squid3 supports Edge Side Includes (ESI). contra Squid: Not a web server (no PHP, CGI, static pages,... ). Complex setup. More hardware resources required. 2004 struktur AG page 3

Squid <> Zope communication 2004 struktur AG page 4

ZEO as Squid parent cache Squid can use ZEO clients as parent Caches. Only requires Zope HTTP and ICP ports to be configured. ZEO clients are configured as cache peers in squid.conf: cache_peer 127.0.0.1 parent 8081 3131 no-digest \ no-netdb-exchange round-robin 2004 struktur AG page 5

ZEO client configuration Enabling HTTP and ICP ports in zope.conf: <http-server> address 8081 </http-server> <icp-server> # valid key is "address" address 127.0.0.1:3131 </icp-server> 2004 struktur AG page 6

What's the ICP port thing? ICP is the Internet Cache Protocol Used for querying neighbor caches about objects. Squid uses ICP to detect dead or unreliable peers. Squid can use ICP to choose the fastest peer. ICP included as standard from Zope 2.6 and later. http://www.zope.org/members/htrd/icp/intro http://www.linofee.org/~jel/proxy/squid/icp-id.html 2004 struktur AG page 7

Squid2 or Squid3 Squid2: + stable + supports all features required for accelerating + binaries for almost any platform (including Win) - requires patching to log in Apache's combined log format Squid3-PRE3: - unstable - contains bugs + supports ESI + supports Apache's combined log format + simpler VirtualHosting configuration + Supports multithreaded redirectors 2004 struktur AG page 8

Squid.conf - the Squid configuration The squid.conf is a huge beast. (3600+ Lines) Thankfully most of these lines are comments. 2004 struktur AG page 9

Squid.conf changes required http_port 80 vhost #hierarchy_stoplist cgi-bin? logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st \ "%{Referer}>h" "%{User-Agent}>h" access_log /usr/local/squid3/logs/access.log combined redirect_program /usr/local/squid3/iredir/iredirector.py redirect_children 20 redirect_rewrites_host_header off acl in_backendpool dstdomain backendpool cache_peer 127.0.0.1 parent 8081 3131 no-digest no-netdb-exchange round-robin cache_peer_access 127.0.0.1 allow in_backendpool cache_peer_access 127.0.0.1 deny all http_access allow all never_direct allow all ie_refresh on 2004 struktur AG page 10

The Redirector The redirector is a external tool which takes a URL on the command line and returns the rewritten URL. Redirectors can be used to do redirection based on numerous conditions. Usually, redirectors make use of regular expressions. There are redirectors written in Perl, Bash, Python, C,... 2004 struktur AG page 11

iredir - a Python redirector Configuration is a Python method. Flexible and stable. # define sitemap matching regex mapping sitemap = { (10, '[\S]*plone.org'): 'backendpool/virtualhostbase/http/$netloc$:80/plo ne.org/virtualhostroot', (20, '[\S]*mydomain.com'): '302:http://plone.org', (10, 'localhost'): 'backendpool/virtualhostbase/http/$netloc$:80/vir tualhostroot', } http://longsleep.org/projects/iredir 2004 struktur AG page 12

Edge Side Includes (ESI) Simple markup language. Meant for application servers and content management. Open standard. Developed by Akamai, ATG, BEA Systems, Circadence, Digital Island, IBM, Interwoven, Oracle, and Vignette. Provides possibility to cache highly dynamic pages. Zope Corp. sponsored ESI development in Squid3. 2004 struktur AG page 13

ESI markup tags Tag <esi:include> <esi:choose> <esi:try> <esi:vars> <esi:remove> <!--esi... --> <esi:inline> Purpose Include a separately cacheable fragment. Conditional execution? choose among several different alternatives based on, for example, cookie value or user agent. Specify alternative processing when a request fails (e.g., the origin server is not accessible). Permit variable substitution (for environment variables). Specify alternative content to be stripped by ESI but displayed by the browser if ESI processing is not done. Specify content to be processed by ESI but hidden from the browser. Include a separately cacheable fragment whose body is included in the template. 2004 struktur AG page 14

ESI support in Squid3 ESI in Squid works well when: The builtin custom parser is used. Only ASCII websites are served. Squid also supports Expat as ESI parser which features other encodings than ASCII. Though with Expat, ESI doesn't work very well in latest Squid3 (PRE3) release. 2004 struktur AG page 15

A simple Zope example 2004 struktur AG page 16

The ESI header (set_esi_header) To enable ESI processing the Surrogate-Control HTTP header has to be set for each response. 2004 struktur AG page 17

Plone2 skin using ESI Metal makros need to become ESI markup: <!--<a metal:use-macro="here/global_logo/macros/portal_logo"> The portal logo, linked to the portal root </a>--> <esi:global_logo metal:usemacro="here/esi_slot_global_logo/macros/main"> The portal logo, linked to the portal root </esi:global_logo> I introduce the esi_slot and esi_view id namespaces. esi_slot is used for seperation of the real view and esi markup. esi_view contains the real html code which is later on inserted instead of the markup. esi_slot code may be replaced by some general tool which auto generates the required markup. 2004 struktur AG page 18

ESI inserts the Plone logo 2004 struktur AG page 19

ESI inserts the Plone logo 2004 struktur AG page 20

Making a Plone2 ESI skin Simulate the main_template/macros/master and add the esi scripts (get_esi_template and set_esi_header) Add the esi header to the skin. (set_esi_header) default_template has to use esi markup for each caching relevant part. (eg news slot, etc..) Write esi_slot markup for each portlet / part. Write esi_view for the portlet code / site part. (requires a master macro) Test the esi_view_something template by accessing it directly ttw. Each esi_view_something template can define own caching headers. 2004 struktur AG page 21

Let's try it Ok.. let's see Plone2 with ESI in action. 2004 struktur AG page 22

Performance / Benefits Uncached ESI pages are slower than without ESI. With the right caching headers Squid can serve 500 req/s on a standard machine. On high traffic sites ESI is the only way to cache highly dynamic pages. Allowes different caching headers for different site parts. 2004 struktur AG page 23

Future Squid3 will be come stable. ESI parser will support UTF-8. ESI integration into CMFSquidTool. 2004 struktur AG page 24

Questions? I know caching is a very complex thing..... so are the any Questions? 2004 struktur AG page 25

Thanks! More information can be found here: http://www.squid-cache.org http://www.linofee.org/~jel/proxy/squid/icp-id.html http://longsleep.org/projects/iredir http://www.esi.org http://www.edge-delivery.org/spec.html http://www.esi.org/press103002.html http://squid.sourceforge.net/old_projects.html#esi http://longsleep.org/howto/ This talk will be available at http://www.struktur.de 2004 struktur AG page 26