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. We have installed ab in the docker image you are using.
- Run
./httpserver --port 8000 --files www/. -
In a separate terminal window, run
ab -n 500 -c 10 http://127.0.0.1:8000/This command issues500requests at a concurrency level of10(meaning it dispatches10requests at a time). Read aboutabto learn more about the tool.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.
Answer the following questions in
results/answers.md.
- 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. How does the number of threads influence the results?
Next task: Proxy.