CSE 40771 - Distributed Systems - Fall 2024

View the Project on GitHub

A1 - Measurement Basics

Start by following the general instructions for assignments to set up your Python environment appropiately.

The first assignment will be a warm up in which you conduct a careful measurement of the costs of basic operations in distributed systems. To that end, write a series of small Python programs that measure the time to do the following things on the student machines:

  1. Make a trivial function call.
  2. Create/delete a file in your home directory.
  3. Create/delete a file in /tmp
  4. Get the current wall clock time.
  5. Insert an item into a Python dictionary.
  6. Make a TCP connection to a well-known internet service and close it.
  7. Make an HTTP connection to a well-known website, read back the HTML, and then close it.
  8. Open a file containing a large JSON document, and parse it into memory. (Check out json-generator.com to make some data.)
  9. Use scandir to iterate over all the items in your home directory and stat each one to measure its size.
  10. Run ls -l as a subprocess to accomplish the same thing.

Of course, there is little value in measuring a single one of these items, one of which may be faster than the resolution of the clock. So, measure how long it takes a number of items in a loop, such that the loop takes about five seconds. (You will have to experiment with the proper number of loop iterations for each test, since the times will vary widely.)

Each test program should run without arguments, carry out its measurement silently, and then report the elapsed time, number of operations, and average time per operation.

Then, run each test program ten times, so that you have ten average measurements for each operation. Make note of the fastest and slowest averages out of each ten.

Turning In

Turn in each of your Python programs, naming them Test1.py, Test2.py, … corresponding to the numbering above. Also turn in a concise lab report written in plain text called REPORT that indicates:

See the general instructions for how to turn in your materials.