Ierg 4180 tutorial 7 lei deng 2013 11 06 08
This presentation is the property of its rightful owner.
Sponsored Links
1 / 29

IERG 4180 Tutorial 7 Lei Deng 2013-11-06/08 PowerPoint PPT Presentation


  • 153 Views
  • Uploaded on
  • Presentation posted in: General

IERG 4180 Tutorial 7 Lei Deng 2013-11-06/08. Some Reminders. The due date for Project 3 is 2013-11-17 (next Sunday) Mark Scheme and Demo has been uploaded Office Change: Lei Deng: SHB 826B -> SHB 803. HTTP Web Server Demo. Demo Usage Demo On-Demand Thread Mode. HTTP Web Server Demo.

Download Presentation

IERG 4180 Tutorial 7 Lei Deng 2013-11-06/08

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Ierg 4180 tutorial 7 lei deng 2013 11 06 08

IERG 4180 Tutorial 7 Lei Deng2013-11-06/08


Some reminders

Some Reminders

The due date for Project 3 is 2013-11-17 (next Sunday)

Mark Scheme and Demo has been uploaded

Office Change:

Lei Deng: SHB 826B -> SHB 803


Http web server demo

HTTP Web Server Demo

Demo Usage

Demo On-Demand Thread Mode


Http web server demo1

HTTP Web Server Demo

Demo Thread-Pool Mode


Web browser display

Web Browser Display

Type “localhost:1234” in Firefox


Web browser display1

Web Browser Display

Click “Introduction”


Web browser display2

Web Browser Display

Get “Introduction.html”


Web browser display3

Web Browser Display

Click “Home”


Web browser display4

Web Browser Display

Get “index.html”


Web browser display5

Web Browser Display

Click “error page”


Web browser display6

Web Browser Display

Get “404 status code”


Httperf test example

Httperf Test Example

Single-Session Example


Httperf test example1

Httperf Test Example

Multi-Session Example


Http web server design

HTTP Web Server Design

  • Web Browser Behavior

    • Connect to the web server via TCP

    • Send request to get the root html file “/”.

  • Web Server Behavior

    • Accept Incoming connections

    • Send the homepage to the web browser after get the requests for URI “/”.

    • Disconnect the TCP link with the web browser


Http web server design1

HTTP Web Server Design

  • Web Browser Behavior

    • Click hyperlink to get the html file name

    • Connect to the web server via TCP

    • Send request to get the html file, such as “Introduction.html”.

  • Web Server Behavior

    • Accept Incoming connections

    • Send the requested file to the web browser or send 404 status code if the requested file doesn’t exist

    • Disconnect the TCP link with the web browser


Http web server design2

HTTP Web Server Design

  • On-Demand Thread Mode

    • Same as in Project 2


Http web server design3

HTTP Web Server Design

  • On-Demand Thread Mode – Each Thread Procudure


Http web server design4

HTTP Web Server Design

  • An Important Tip

    • In Linux system, thread resources will not be released back to the system when a joinable thread terminates

    • Either you can use pthread_join() function or set the thread to be detachable such as using pthread_detach() function

    • A Possible Solution In the Thread

      #ifndef WIN32

      //release resource after thread return automatically

      pthread_detach(pthread_self());

      #endif


Http web server design5

HTTP Web Server Design

Thread-Pool Mode


Http web server design6

HTTP Web Server Design

Thread-Pool Mode


Http web server design7

HTTP Web Server Design

  • Thread-Pool Mode

    • The session thread will not terminate but can block if no item in the queue

    • Do synchronization

      • use mutex to protect the queue


Http web server design8

HTTP Web Server Design

  • Requirements

    • Implement the HTTP protocol so that the web browser (IE, Chrome, Firefox) can visit the web

      server and get some web pages

    • Handle the case that the requested web pages are not found in your web server

    • Run well in both Linux and Windows

    • Feel free to use the demo web pages or use your own


Httperf options

HttperfOptions

  • --num-conn=N

    • N: Total number of connections to create

  • --wsess=N1, N2, X --burst-length=L

    • N1: Total number of concurrent sessions

    • N2: Total number of connections in each session

    • X: Think-time, i.e., the idle time between two consecutive bursts.

    • L: Total number of connections in each burst


Httperf test requirement

Httperf Test Requirement

  • B1: On-Demand Thread Mode in Linux and Windows

    • Get the response time for the single-session test

      with different number of connections

    • e.g.

      ./NetProbe 1234 o

      httperf --hog --server localhost --port 1234 --uri /index.html

      --num-conn 10000


Httperf test requirement1

Httperf Test Requirement

  • B2: Thread-Pool Thread Mode in Linux and Windows

    • Get the response time for the single-session test

      with different number of connections and different number of threads

    • e.g.

      ./NetProbe 2345 p 4

      httperf --hog --server localhost --port 2345 --uri /index.html

      --num-conn 10000


Httperf test requirement2

Httperf Test Requirement

  • B3: Capacity of On-Demand Thread Mode in Linux and Windows

    • Get the response time (reply rate, errors) for the multi-session test with different number of concurrent sessions

    • You can fix each session with such as 100 requests

    • You can fix think-time such as 0.1 second

    • e.g.

      ./NetProbe 1234 o

      httperf--hog --server localhost --port 1234 --uri /index.html

      --wsess10,100,0.1


Httperf test requirement3

Httperf Test Requirement

  • B4: Capacity of Thread-Pool Mode in Linux and Windows

    • Get the response time (reply rate, errors) for the multi-sessiontest with different number of concurrent sessions and different number of threads

    • You can fix each session with such as 100 requests

    • You can fix think-time such as 0.1 second

    • e.g.

      ./NetProbe 2345 p 4

      httperf--hog --server localhost --port 2345 --uri /index.html

      --wsess10,100,0.1


Performance metric

Performance Metric

  • The response time, reply rate and errors for the on-demand thread mode and thread-pool mode with given test parameters, the same to all of you.

    • e.g.

      • --wsess 100,100,0.1

  • Try best to improve the performance for your web server


Submission requirement

Submission Requirement

VS 2010 solution and Linux source files and/or IDE project files

Readme file to instruct us how to compile and run your codes in both Windows and Linux system

Httperf Test Document

Declaration Form


  • Login