CHEN Ge CSIS, HKU March 9, 2000. Jigsaw W3C’s Java Web Server.

Slides:



Advertisements
Similar presentations
Java Network Programming Vishnuvardhan.M. Dept. of Computer Science - SSBN Java Overview Object-oriented Developed with the network in mind Built-in exception.
Advertisements

CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.
COEN 445 Communication Networks and Protocols Lab 4
Scalable Content-aware Request Distribution in Cluster-based Network Servers Jianbin Wei 10/4/2001.
1 Routing and Scheduling in Web Server Clusters. 2 Reference The State of the Art in Locally Distributed Web-server Systems Valeria Cardellini, Emiliano.
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
CS 623 Lecture #9 Yen-Yu Chen Utku Irmak. Papers to be read Better operating system features for faster network servers.Better operating system features.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Locality-Aware Request Distribution in Cluster-based Network Servers 1. Introduction and Motivation --- Why have this idea? 2. Strategies --- How to implement?
Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006.
Client Server Design Alternatives© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid.
Communication in Distributed Systems –Part 2
ArcGIS for Server Reference Implementations An ArcGIS Server’s architecture tour.
CS-3103 & CS-502, Summer 2006 Programming Project #31 Programming Project #3 Web Server CS-3103 & CS-502 Operating Systems.
Server issues How to approach the design of servers.
Fundamentals of Python: From First Programs Through Data Structures
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Implementing ISA Server Publishing. Introduction What Are Web Publishing Rules? ISA Server uses Web publishing rules to make Web sites on protected networks.
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
Multi-Threaded Application CSNB534 Asma Shakil. Overview Software applications employ a strategy called multi- threaded programming to split tasks into.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Computer Emergency Notification System (CENS)
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Concurrency Patterns Emery Berger and Mark Corner University.
ECE200 – Computer Organization Chapter 9 – Multiprocessors.
1 Web Based Programming Section 8 James King 12 August 2003.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
1 (Worker Queues) cs What is a Thread Pool? A collection of threads that are created once (e.g. when a server starts) That is, no need to create.
Building a Scalable Web Server with Global Object Space Support on Heterogeneous Clusters Ge Chen, Cho-Li Wang, Francis. C. M. Lau Department Of Computer.
Dynamic Architectures (Component Reconfiguration) with Fractal.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
Jigsaw Performance Analysis Potential Bottlenecks.
Copyright © 2002 ProsoftTraining. All rights reserved. Java Servlets.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
1 MSRBot Web Crawler Dennis Fetterly Microsoft Research Silicon Valley Lab © Microsoft Corporation.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Building a Scalable Web Server with Global Object Space Support on Heterogeneous Clusters Ph.D Annual Talk Ge CHEN CSIS HKU.
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
Designing a Middleware Server for Abstract Database Connection.
Review CS File Systems - Partitions What is a hard disk partition?
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
CSE 434: Computer Networks Project Single vs. Per Connection vs. Pooling Threading Techniques Dominic Hilsbos, Dorothy Johnson, Chris Volpe, Andy Wong,
SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.
Background Computer System Architectures Computer System Software.
Basics of the Domain Name System (DNS) By : AMMY- DRISS Mohamed Amine KADDARI Zakaria MAHMOUDI Soufiane Oujda Med I University National College of Applied.
1 CS 430: Information Discovery Lecture 17 Web Crawlers.
Distributed Server Scheduler Eyal Serero Alex Fishgate Supervisor : Vitaly Suchin.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Last Class: Introduction
Threaded Programming in Python
Processes and threads.
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
WWW and HTTP King Fahd University of Petroleum & Minerals
File System Implementation
Cross Platform Development using Software Matrix
Processes and Threads Processes and their scheduling
Spark Presentation.
Lecture 21 Concurrency Introduction
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
Client-Server Interaction
Meng Cao, Xiangqing Sun, Ziyue Chen May 28th, 2014
Cooperative Caching, Simplified
Architecture Competency Group
CS703 - Advanced Operating Systems
Presentation transcript:

CHEN Ge CSIS, HKU March 9, Jigsaw W3C’s Java Web Server

What is Jigsaw? Jigsaw is a Web Server developed by W3C. The source code is of version Jigsaw is a Web Server developed by W3C. The source code is of version Jigsaw is written in pure Java, and the document of Jigsaw claims “Jigsaw will run on any platform that supports Java, with no changes”Jigsaw is written in pure Java, and the document of Jigsaw claims “Jigsaw will run on any platform that supports Java, with no changes”

Jigsaw’s Internal Design Basic Concepts in JigsawBasic Concepts in Jigsaw –Resource –Frame –Filter –Indexer

Jigsaw’s Internal Design –A Resource is a full Java object, containing only information that the raw Resource (a file, a directory...) can provide (e.g., for a file, the size, last modification date...)

Jigsaw’s Internal Design –A Frame is a full Java Object, containing all the information needed to serve this Resource using a specific Protocol (e.g., HTTPFrame for HTTP). Jigsaw attaches Frames to Resources to handle protocol related activities.

Jigsaw’s Internal Design –A Filter is a full Java Object, associated to a Frame, that can modify the Request and/or the Reply. For example the Authentication is handled by a special filter.

Jigsaw’s Internal Design –A Indexer is also a full Java Object, which tries to create and setup some resource automatically. The resources can be created depending on their name or their extension. Once the resource has been created, the Indexer is also in charge of attaching the right frames to this resource, like the HTTP frame, the filters and so on.

Jigsaw’s Internal Design A sample FileResource:A sample FileResource:

Jigsaw’s Internal Design The inheritance tree of Jigsaw:The inheritance tree of Jigsaw:

Jigsaw’s Internal Design The ResourceStoreManageThe ResourceStoreManage –Jigsaw use a ResourceStoreManage to manage all the resource used in the runtime of the server. –The ResourceStoreManage’s implementation use some simple cache policy to make the resource reference more efficient.

Jigsaw’s Internal Design The ResourceStoreManageThe ResourceStoreManage –It seems that, if we start multiple Jigsaws on a machine, all the servers will share the same ResourceStoreManage.

How Jigsaw Works? Jigsaw utilize Java’s thread extensively. All the major classes of Jigsaw are running as Java Threads.Jigsaw utilize Java’s thread extensively. All the major classes of Jigsaw are running as Java Threads. Jigsaw separates serving document into two different processing stagesJigsaw separates serving document into two different processing stages –Indexing Stage –Serving Stage

How Jigsaw Works? Separate serving document into two stages make the resource lookup and resource sharing more efficent.Separate serving document into two stages make the resource lookup and resource sharing more efficent.

How Jigsaw Works? Using an sample http request handling process in Jigsaw to explain how Jigsaw works, and view some important classes in Jigsaw.Using an sample http request handling process in Jigsaw to explain how Jigsaw works, and view some important classes in Jigsaw.

How Jigsaw Works? When Jigsaw starts upWhen Jigsaw starts up –An instance of the class httpd created. httpd

How Jigsaw Works? httpd Initialize() httpd Indexer root manager

How Jigsaw Works? httpd Indexer root manager initializeServerSocket() After initialization, the httpd call the initializeServerSocket() to create the server socket and the ClientSocketFacotry which is a pool of SocketClient.After initialization, the httpd call the initializeServerSocket() to create the server socket and the ClientSocketFacotry which is a pool of SocketClient. httpd Indexer root manager Server port factory

How Jigsaw Works? After create the server socket successfully, httpd creates a thread, assigns itself to the thread, and runs as a thread.After create the server socket successfully, httpd creates a thread, assigns itself to the thread, and runs as a thread. httpd factory Indexer root manager this.thread = new Thread (this); ;…;this.thread.run(); httpd factory Indexer root manager

How Jigsaw Works? public void run () { … while ( ( ! finishing) && ( socket != null ) ) { Socket ns = null ; try { ns = socket.accept() ; ns.setTcpNoDelay(true); } catch (IOException e) { … } if ( (socket != null) && (ns != null) && (factory != null) ) factory.handleConnection (ns) ; } // Our socket has been closed, perform associated cleanup. cleanup(restarting) ; } httpd factory Indexer root manager

How Jigsaw Works? When there’s an incoming connection request, the httpd thread uses the client pool to handle the request.When there’s an incoming connection request, the httpd thread uses the client pool to handle the request. httpd factory Indexer root manager /archives/index.html SocketClientFactory handleConnection()

How Jigsaw Works? SocketClientFactory maintains a pool of SocketClients. It first either finds a free SocketClient thread in the pool, if available, or kills some old connections to get a free SocketClient, if the load have not exceeds the max-load.SocketClientFactory maintains a pool of SocketClients. It first either finds a free SocketClient thread in the pool, if available, or kills some old connections to get a free SocketClient, if the load have not exceeds the max-load.

How Jigsaw Works? When the Factory find a free SocketClient, it bind the incoming socket to the SocketClient, and the SocketClient will starts a thread to perform the request.When the Factory find a free SocketClient, it bind the incoming socket to the SocketClient, and the SocketClient will starts a thread to perform the request. Because all the SocketClients run as threads, when a connection is bound to a SocketClient, the server can keep on listening on the net for new incoming requests.Because all the SocketClients run as threads, when a connection is bound to a SocketClient, the server can keep on listening on the net for new incoming requests.

How Jigsaw Works? Then the SocketClient will process the incoming request, and calls the httpd’s perform(Request) method to lookup for the necessary resources. The perform method will return back a object containing all the resources needed to reply the request. SoketClient uses this object to send back the request result.Then the SocketClient will process the incoming request, and calls the httpd’s perform(Request) method to lookup for the necessary resources. The perform method will return back a object containing all the resources needed to reply the request. SoketClient uses this object to send back the request result.

How Jigsaw Works? After the request is replied, the SocketClient close the connection and return itself to the free SocketClient pool in the SocketClientFactory.After the request is replied, the SocketClient close the connection and return itself to the free SocketClient pool in the SocketClientFactory.

Some Notices on Jigsaw Jigsaw uses a thread pool (cache) to handle incoming request, instead creates a new process or thread to deal with it.Jigsaw uses a thread pool (cache) to handle incoming request, instead creates a new process or thread to deal with it. Jigsaw caches requested resources in a resource hashtable according to the resource id, in order to reduce file system access.Jigsaw caches requested resources in a resource hashtable according to the resource id, in order to reduce file system access.

Some Notices on Jigsaw When the httpd is looking up the requested resource, if it is a read only request, it will only increase the lock number (reference number) of that object, so one resource can be accessed simultaneously by multiple request.When the httpd is looking up the requested resource, if it is a read only request, it will only increase the lock number (reference number) of that object, so one resource can be accessed simultaneously by multiple request.

Some Notices on Jigsaw Jigsaw also uses some LRU algorithm to discard long-unused resources in memory. And also kills long idle connection and SocketClient to decrease the server’s work load.Jigsaw also uses some LRU algorithm to discard long-unused resources in memory. And also kills long idle connection and SocketClient to decrease the server’s work load.

Some Notices on Jigsaw It does not provide direct configuration method to run it on multi-machines cooperatively. But its internal design makes it possible to replace or add some of its classes to gain new functions.It does not provide direct configuration method to run it on multi-machines cooperatively. But its internal design makes it possible to replace or add some of its classes to gain new functions.

End of Jigsaw

High-performance Web Servers in other institutes JAWS---An Web Server in CS Dept., Washington UniversityJAWS---An Web Server in CS Dept., Washington University –JAWS’s findings: “Factoring out I/O, the primary determinant to server performance is the concurrency strategy”“Factoring out I/O, the primary determinant to server performance is the concurrency strategy” “For single CPU machines, single-threaded solutions are acceptable and perform well. However, they do not scale for multi- processor platforms. ““For single CPU machines, single-threaded solutions are acceptable and perform well. However, they do not scale for multi- processor platforms. “

High-performance Web Servers in other institutes –JAWS’s findings: Process-based concurrency implementations perform reasonably well when the network is the bottleneck. However, on high-speed networks like ATM, the cost of spawning a new process per request is relatively high.Process-based concurrency implementations perform reasonably well when the network is the bottleneck. However, on high-speed networks like ATM, the cost of spawning a new process per request is relatively high. Multi-threaded designs appear to be the choice of the top Web server performers. The cost of spawning a thread is much cheaper than that of a process.Multi-threaded designs appear to be the choice of the top Web server performers. The cost of spawning a thread is much cheaper than that of a process.

High-performance Web Servers in other institutes –JAWS’ Framework Overview:

High-performance Web Servers in other institutes –“... the key to developing high performance Web systems is through a design which is flexible enough to accommodate different strategies for dealing with server load and is configurable from a high level specification describing the characteristics of the machine and the expected use load of the server.” –More on JAW: ch.htmlhttp:// ch.htmlhttp:// ch.htmlhttp:// ch.html

High-performance Web Servers in other institutes Scalable Web Server Architecture from Lucent & UT AustinScalable Web Server Architecture from Lucent & UT Austin

High-performance Web Servers in other institutes Scalable Web Server Architecture from Lucent & UT AustinScalable Web Server Architecture from Lucent & UT Austin –Redirection Server is used –Data is distributed among the servers –Problem occurs on constantly moving docs

High-performance Web Servers in other institutes Web Server Clusters in UCSBWeb Server Clusters in UCSB –Master/Slave Architecture

High-performance Web Servers in other institutes Web Server Clusters in UCSBWeb Server Clusters in UCSB –Masters handles static requests. –Dynamic content requests may be processed locally at masters, or redirected to a slave node or another master. –Slaves may be either dedicated or non- dedicated.