Some server “stress” tests Can our TCP concurrent server handle many successive and/or simultaneous connections?

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Recitation 8: 10/28/02 Outline Processes Signals –Racing Hazard –Reaping Children Annie Luo Office Hours: Thursday 6:00.
CSCC69: Operating Systems
Readers and Writers An introduction to the Linux programming interface for using UNIX semaphores.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning.
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
Controlling concurrency A look at some techniques for process synchronization in the Linux environmemt.
15-213/ Intro to Computer Systems by btan with reference to Spring 10’s slides.
Creating a UAA VPN Connection For Your Computer To Facilitate Polycom PVX – For Windows XP Last Modified On 10/25/2010 University of Alaska Anchorage,
Concurrent TCP connections A look at design-changes which permit a TCP server to handle multiple clients without delays.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
CSSE Operating Systems
The ‘wait4()’ function Looking at how the various ‘wait()’ system-calls rely on ‘wait4()’ in the x86_64 Linux kernel.
Threads© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
Multiplexing i/o A look at some alternatives under Linux for dealing concurrently with multiple sources of device-input.
Client Server Model and Software Design TCP/IP allows a programmer to establish communication between two application and to pass data back and forth.
THE EVOLUTION OF NFS Dave Hitz and Andy Watson Network Appliance, Inc.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
Enabling Internet “Suspend/Resume” with Session Continuations Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek,
1 Transport Layer Computer Networks. 2 Where are we?
Socket Programming References: redKlyde ’ s tutorial set Winsock2 for games (gamedev.net)
Hands On Networking Socket Programming Ram P Rustagi, ISE Dept Abhishek Gupta, ISE Dept Laxmi Kuber, MCA Dept June 28-30, 2012.
Elementary TCP Sockets
Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
Module 10: Monitoring ISA Server Overview Monitoring Overview Configuring Alerts Configuring Session Monitoring Configuring Logging Configuring.
The process concept (section 3.1, 3.3 and demos)  Process: An entity capable of requesting and using computer resources (memory, CPU cycles, files, etc).
Concurrent Programming. Concurrency  Concurrency means for a program to have multiple paths of execution running at (almost) the same time. Examples:
Programming with TCP – III 1. Zombie Processes 2. Cleaning Zombie Processes 3. Concurrent Servers Using Threads  pthread Library Functions 4. TCP Socket.
Computing Infrastructure for Large Ecommerce Systems -- based on material written by Jacob Lindeman.
June-Hyun, Moon Computer Communications LAB., Kwangwoon University Chapter 26 - Threads.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Processes and Threads.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
CS603 Basics of underlying platforms January 9, 2002.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Recitation: Signaling S04, Recitation, Section A Debug Multiple Processes using GDB Debug Multiple Processes using GDB Dup2 Dup2 Signaling Signaling.
Intro to Socket Programming CS 360. Page 2 CS 360, WSU Vancouver Two views: Server vs. Client Servers LISTEN for a connection and respond when one is.
TCP Client-Server Example
Threads. Readings r Silberschatz et al : Chapter 4.
CSCI 330 UNIX and Network Programming Unit XVI: TCP Server Programming.
The Process CIS 370, Fall 2009 CIS UMassD. The notion of a process In UNIX a process is an instance of a program in execution A job or a task Each process.
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
Concurrent TCP servers. The basic idea 1 client = 1 task. The task is alive as long until the connection is closed The task closes the connection.
Do-more Technical Training Communications (Modbus TCP)
Sockets A popular API for client-server interaction.
7/9/ Realizing Concurrency using Posix Threads (pthreads) B. Ramamurthy.
1 Issues in Client/Server Refs: Chapter 27 Case Studies RFCs.
Introduction to threads
Threads Threads.
UNIX PROCESSES.
Review: TCP Client-Server Interaction
Client-Server Interaction
Dave Hitz and Andy Watson Network Appliance, Inc
0x1A Great Papers in Computer Security
COS 461: Computer Networks Spring 2013
استراتيجيات تعديل السلوك بين النظرية والتطبيق
Distributed Computing Systems
Issues in Client/Server Programming
Dave Hitz and Andy Watson Network Appliance, Inc
Advanced UNIX programming
Server-side Programming CSE 333 Autumn 2018
Server-side Programming CSE 333 Summer 2018
fork() and exec() David Ferry CSCI 3500 – Operating Systems
Concurrency: Processes CSE 333 Summer 2018
Server-side Programming CSE 333 Winter 2019
Processes Creation and Threads
Chapter 4: Threads.
Presentation transcript:

Some server “stress” tests Can our TCP concurrent server handle many successive and/or simultaneous connections?

‘tcpserver3.cpp’ This version of our concurrent server used a signal-handler to call ‘wait()’ whenever a child-process disconnected from a client and invoked the ‘exit()’ system-call It seemed to eliminate ‘zombie’ processes But we didn’t yet see how it performs in case multiple simultaneous connections are initiated by a client application

‘sixlinks.cpp’ A modification of our ‘tcpclient2.cpp’ that will attempt to establish six simultaneous connections with our ‘tcpserver3.cpp’ It does seem successful in responding to these client-requests very promptly, but we need to check for ‘zombie’ processes Is there a problem? If so, why? And how can we ‘fix’ that problem?

‘waitpid()’ There’s a more general form of the UNIX ‘wait()’ function which allows the caller to request ‘non-blocking’ behavior using an option-flag: $ waitpid( -1, NULL, WNOHANG ); ‘wait’ for any child-process we don’t need any ‘status’ info return immediately to the caller without blocking The function-value returned will be 0 if no more child-processes have exited without already having been waited for; or will be equal to the PID of a child that had earlier exited and was just now ‘waited for’ by this function-call

‘tcpserver4.cpp’ Modifies one line of the signal-handler in our ‘tcpserver3.cpp’ concurrent server so that all child-processes that have exited are ‘waited for’ before resuming the task Changes:wait( NULL ); To: while ( waitpid( -1, NULL, WNOHANG ) > 0 );

‘tcpstress.cpp’ This demo modifies our ‘tcpclient2.cpp’ so that it make a large number of separate connection-requests and data-exchanges in rapid succession, to test the server’s ability to respond promptly and correctly

acknowledgement The ideas used to motivate the ‘concurrent TCP server’ here are adaptations from the presentation by W. Richard Stevens in his classic text “UNIX Network Programming, 2 nd Ed”, Prentice-Hall (1998), volume 1

In-class exercise #1 Can you modify our ‘sixlinks.cpp’ program so that it will establish a much larger set of simultaneous connections? How many can you successfully establish before the system’s resources are exhausted?

In-class exercise #2 Is there any upper limit on the number of consecutive connection-requests that our ‘tcpstress.cpp’ client can establish, given the fact that each connection-request is closed (and system resources released) before the next connection is attempted?