Performance
Test, measure, and comment on the performance of httpserver, forkserver, threadserver, and poolserver. We will use the Apache HTTP server benchmarking tool (ab for short) to load test each server type. You can install ab with sudo apt-get install -y apache2-utils.
- Run
./httpserver --files www/. In a separate terminal window, run
ab -n 500 -c 10 http://192.168.162.162:8000/This command issues 500 requests at a concurrency level of 10 (meaning it dispatches 10 requests at a time). Read
man abto learn more about the tool. You can type “man ab” in your terminal or your preferred search engine. However, please note that typing “man ab” into Google will also give you defined images of chiseled male abdominal muscles; do so at your own discretion.Notice how
aboutputs the mean time per request. Take note of this value and comment on how it changes when we change how the server handles requests.- Use
abto load-testforkserver,threadserver, andpoolserver. Play around with thenandcvariables as well as the size of the thread pool inpoolserver.
You no longer have to answer these questions on Gradescope, but test and consider the following questions!
- Run
abonhttpserver. What happens whennandcgrow large? - Run
abonforkserver. What happens whennandcgrow large? Compare these results with your answer in the previous question. - Run
abonthreadserver. What happens whennandcgrow large? Compare these results with your answers in the previous questions. - Run
abonpoolserver. What happens whennandcgrow large? Compare these results with your answers in the previous questions.