1 / 29

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

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.

aliya
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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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

  3. HTTP Web Server Demo Demo Usage Demo On-Demand Thread Mode

  4. HTTP Web Server Demo Demo Thread-Pool Mode

  5. Web Browser Display Type “localhost:1234” in Firefox

  6. Web Browser Display Click “Introduction”

  7. Web Browser Display Get “Introduction.html”

  8. Web Browser Display Click “Home”

  9. Web Browser Display Get “index.html”

  10. Web Browser Display Click “error page”

  11. Web Browser Display Get “404 status code”

  12. Httperf Test Example Single-Session Example

  13. Httperf Test Example Multi-Session Example

  14. 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

  15. 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

  16. HTTP Web Server Design • On-Demand Thread Mode • Same as in Project 2

  17. HTTP Web Server Design • On-Demand Thread Mode – Each Thread Procudure

  18. 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

  19. HTTP Web Server Design Thread-Pool Mode

  20. HTTP Web Server Design Thread-Pool Mode

  21. 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

  22. 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

  23. 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

  24. 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

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

More Related