Make sure gcc is installed.
- Unzip the project
unzip path/to/http_get.zip -d http_get
. - Change into the project directory
cd path/to/http_get/
. - Use
make
command to compile the code. Runmake
ormake all
. Make sureMakefile
is in the directory. - Executable
http_get
should be generated along with object files. make clean
to delete compiled files and the executable.
./http_get --url <Full URL>
Make HTTP request to URL and print the response to the console
<Full URL>
Required. Define the URL to make requests. Prefixhttp://
is required.- For example,
./http_get --url http://assignment.jiachengzhang.workers.dev/links
-
./http_get --help
Print help page. -
./http_get --profile <Number of Requests> <Full URL>
Measure website's performance.
<Number of Request>
Required. Make the given number of requests to the server.<Full URL>
Optional. Define the URL to make requests. Prefixhttp://
is required. It is set as website built from "General Assignment" (http://assignment.jiachengzhang.workers.dev) if there's not a provided URL.- For example,
./http_get --profile 10
makes 10 requests tohttp://assignment.jiachengzhang.workers.dev
by default, then prints out the performance../http_get --profile 10 http://static-links-page.signalnerve.workers.dev
makes 10 requests tohttp://static-links-page.signalnerve.workers.dev
, then prints out the performance.
Once the program is compiled via make
, it's time for performance measurement. Run bash run_test.sh <Number of Requests> <Site1's URL> <Site2's URL>
to perform comparison between two sites. <Number of Requests>
, <Site1's URL>
and <Site2's URL>
are optional. Run bash run_test.sh
to profile assignment.jiachengzhang.worker site
and static-links-page site
(Sites Comparison 1 with only 100 requests). Results can be found in profile.txt
.
I choose to compare my site built for general assignment assignment.jiachengzhang.worker site
and the site that my site fetches static page from static-links-page site
. The results are following,
I think this is a representaive comparison. assignment.jiachengzhang.worker site
requires extra time to fetch and wait the static page responsed by the static-links-page site
, then inject more content. Because both of the sites are hosted by Cloudflare, I assume that two servers are close to each other. The resulted statistics demostrated that assignment.jiachengzhang.worker site
takes more time to send back responses, and it also has larger response sizes compared to static-links-page site
among 1000 requests.
Here's the comparison between assignment.jiachengzhang.worker site
and baidu
, the most popular search engine in China, results are following,
Becuase the responsed web page of Baidu
has JavaScript and more content, its response size is larger than assignment.jiachengzhang.worker site
. In addition, Baidu
's smallest response size
is the same as largest response size
while assignment.jiachengzhang.worker site
has different smallest and largest response size, it may be because assignment.jiachengzhang.worker site
's content is random while Baidu
's not. Lastly, Baidu
's response has higher latency than assignment.jiachengzhang.worker site
. One reason could be my location is closer to Cloudflare's server than to Baidu's which is located in China; it could also because Baidu
's server is much busier than assignment.jiachengzhang.worker site
due to the fact that it needs to handle large numer of requests every seconds.
The following is the comparison between assignment.jiachengzhang.worker site
and New York University's Official Website
,
Among 50 requests to both websites, New York University's Official Website
has 3 times higher latency on average than assignment.jiachengzhang.worker site
's, and has response that's 3 times larger than assignment.jiachengzhang.worker site
in term of the largest response.