 A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it really fast  Runs.

Slides:



Advertisements
Similar presentations
By: Craig Hecock.  A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it.
Advertisements

N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.
Why Concurrency? Allows multiple applications to run at the same time  Analogy: juggling.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
1 Chapter 4 Threads Threads: Resource ownership and execution.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Interesting facts about node.js.  Asynchronous I/O  How do they do that?..threads (usually) What do Web Servers do?
CS 153 Design of Operating Systems Spring 2015
Node.js - What is Node.js? -
Concurrency: Threads, Address Spaces, and Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
1 Web Based Programming Section 8 James King 12 August 2003.
SE-2840 Dr. Mark L. Hornick1 NodeJS Server-side JavaScript.
Web Architecture Introduction
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
Chat Room App Logan Linn Network Application Design Fall 2010.
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.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
Threads versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
Node.Js 1. 2 Contents About Node.Js Web requirement latest trends Introduction Simple web server creation in Node.Js Dynamic Web pages Dynamic web page.
CS533 Concepts of Operating Systems Jonathan Walpole.
Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Cooperative Task Management without Manual Stack management Hanyun Tao EECS 582 – W161.
Overview Web Technologies Computing Science Thompson Rivers University.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Multithreading vs. Event Driven in Code Development of High Performance Servers.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
NodeJS and MEAN cs6320.
Top 8 Best Programming Languages To Learn
Node.Js Server Side Javascript
Process concept.
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Process Management Process Concept Why only the global variables?
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
Sujata Ray Dey Maheshtala College Computer Science Department
Processes and Threads Processes and their scheduling
NodeJS and MEAN Prof. L. Grewe.
Chapter 3: Processes.
3 Things Everyone Knows About Node JS That You Don't
AJAX.
Node.js talking to PROGRESS
Node.Js Server Side Javascript
Concurrency: Threads, Address Spaces, and Processes
Capriccio – A Thread Model
Parallel Programming in Contemporary Programming Languages (Part 2)
Distributed Systems - Comp 655
Concurrency: Threads, Address Spaces, and Processes
CS 143A Quiz 1 Solution.
PROCESS MANAGEMENT Information maintained by OS for process management
Sujata Ray Dey Maheshtala College Computer Science Department
INTRODUCTION TO By Stepan Vardanyan.
Prof. Leonardo Mostarda University of Camerino
Chapter 3: Processes.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Chapter 3: Processes Process Concept Process Scheduling
Introduction.
CS703 – Advanced Operating Systems
Concurrency: Threads, Address Spaces, and Processes
Presentation transcript:

 A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it really fast  Runs over the command line  Designed for high concurrency ◦ Without threads or new processes  Never blocks, not even for I/O  Uses the CommonJS framework ◦ Making it a little closer to a real OO language

 Instead of threads Node uses an event loop with a stack  Alleviates overhead of context switching

ThreadsAsynchronous Event-driven Lock application / request with listener-workers threads only one thread, which repeatedly fetches an event Using incoming-request modelUsing queue and then processes it multithreaded server might block the request which might involve multiple events manually saves state and then goes on to process the next event Using context switchingno contention and no context switches Using multithreading environments where listener and workers threads are used frequently to take an incoming- request lock Using asynchronous I/O facilities (callbacks, not poll/select or O_NONBLOCK) environments

 Request for “index.html” comes in  Stack unwinds and ev_loop goes to sleep  File loads from disk and is sent to the client

 Servers do nothing but I/O ◦ Scripts waiting on I/O requests degrades performance  To avoid blocking, Node makes use of the event driven nature of JS by attaching callbacks to I/O requests  Scripts waiting on I/O waste no space because they get popped off the stack when their non-I/O related code finishes executing

 Use of JS on both the client and server-side should remove need to “context switch” ◦ Client-side JS makes heavy use of the DOM, no access to files/databases ◦ Server-side JS deals mostly in files/databases, no DOM  JSDom project for Node works for simple tasks, but not much else

1.It's fast 2.It can handle tons of concurrent requests 3.It's written in JavaScript (which means you can use the same code server side and client side ) PlatformNumber of request per second PHP ( via Apache)3187,27 Static ( via Apache )2966,51 Node.js5569,30

   chromium-and-v8 chromium-and-v8  crankshaft-for-v8.html crankshaft-for-v8.html  Chrome-10-9-vs-Opera-11-vs-Firefox-11- Performance-Comparison shtml Chrome-10-9-vs-Opera-11-vs-Firefox-11- Performance-Comparison shtml