【无标题】

CS-350 - Fundamentals of Computing Systems

Homework Assignment #2 - EVAL

Due on September 26, 2024 — Late deadline: September 28, 2024 EoD at 11:59 pm

EVAL Problem 1

In this EVAL assignment we will start to explore how to discover characteristics of incoming workload, we will dive into how to measure the overheads of our systems, and we will also study the properties how queues evolve in response to varying traffic conditions.

a) First thing first, let’s try to make sense out of the workload that is coming from the client. You might recall that by invoking the client with various values of the -a and -s parameters significantly impacts the load seen by your server. Now it is time to reverse-engineer the characteristics of that traffic. Start with the following to collect the report of 1,000 packets handled at the server:

./server_mt 2222 & ./client -a 6 -s 10 -n 1000 2222

Now, isolate only the lengths of the requests as they are sent from the client. With that, produce a plot of the distribution of the request lengths you have collected. The distribution plot should have on the x-axis a set of time bins, e.g., from 0 (included) to 0.005 (excluded), from 0.005 (included) to 0.010 (excluded), and so on in steps of 0.005 increments. Given each transaction, look at its length. If it is in the range between 0.005 and 0.010 seconds, it falls in the second bin; if it is in the range between 0.010 and 0.015, it falls in the third bin and so on.

On the y-axis, plot how many requests fall in each bin! But do not plot the raw count. Rather, normalize that value by the total number of requests you are plotting. In this case, 1,000. Hooray! You have produced a distribution plot.

b) By using the same procedure used in the previous part, produce a distribution plot of the inter-arrival time between any two subsequent requests. Say that request R0 is sent (look at the sent timestamp!) arrives at t0 = 10s and R1 is sent at t1 = 15s, then the inter-arrival time between them is t iat0,1 = (t1−t0).

Compute all the 999 inter-arrival times you have observed and plot their distribution just like you did above, except that this time you will normalize by 999.

c) Time to reverse-engineer things! Let’s start from the distribution of request lengths. Use your favorite programming language to generate 10,000 samples from the following theoretical distributions:

(1) A Normal distribution with mean 1/10 and standard deviation 1;

(2) An Exponential distribution with mean 1/10;

(3) A uniform. distribution with mean 1/10.

Plot these distribution together (on the same plot, just different lines) with the distribution you previ-ously acquired from your server run. Thus, your plot should have a total of 4 different lines (I suggest having lines instead of bars for this plot) in it. Then, comment on which ones of the curves matches more closely with the experimental data. If there is one of them that matches remarkably close, you have successfully reverse-engineered the characteristics of your input load!

d) Do the same with the inter-arrival times. But this time, compare it with the following three references:

(1) A Normal distribution with mean 1/6 and standard deviation 1;

(2) An Exponential distribution with mean 1/6;

(3) A uniform. distribution with mean 1/6.

Produce the comparison plot and comment on the match between the experimental and theoretical curves. At this point, can you tell me what the -a and -s parameters control, exactly?

EVAL Problem 2

In this EVAL problem, we will start to study the relationship between utilization, throughput, and queues in response to changing load conditions.

a) First thing first, learn how to take a good queue size average. A good queue average measurement should consider the amount of time the queue remains in a certain state, i.e., it should be a timed average of the queue length.

Let us make an example. Say that your queue at t = 0 has 3 elements in it, and it stays that way until time t = 9 sec, at which point the queue becomes empty. If you do not consider time, the average size would be q = (3 + 0)/2 = 1.5. But this is incorrect: most of the time we see the queue with 3 elements, and only at the end with 0. So an average of 1.5 seems wrong.

The right way to take the average is by weighting the queue state by the time it stays in that state. Thus, the right way to calculate q in our example is q = 3 · (10/9) + 0 · (10/1) = 2.7. You can see how this is a better average of queue size over a 10 seconds time window starting from time t = 0.

Now, measure the queue length for the case where your queue-enabled server is invoked with the following parameters:

./server_q 2222 & ./client -a 14 -s 15 -n 1000 2222

Use the queue snapshots produced by the worker thread to measure the queue size as it was observed after each request was observed. Use the time elapsed between two subsequent queue snapshots to weigh that size towards the total average.

b) Now let us repeat the computation of the queue size average as in Q?? but this time sweep through the -a parameter passed to the server. In particular, run the first experiment for a value of 1; then a second time with a value of 2; and so on until and including the case where the value is 15. Thus, you will run 15 experiments in total. This might take a while, so try to automate the runs and dump the results into a file for later analysis.

By reusing what you learned in hw1, also extract utilization and response time averages from each of the 15 experiments. Now, you should have three sets of 15 values each: (1) utilization, (2) average response time, (3) average queue length.

Finally, produce a plot that depicts the trend of the average response time (on the y-axis as line 1) and average queue size (on the y-axis as line 2) as a function of the server utilization x-axis. What relationship do you discover between how response time and queue length averages evolve as a result of increasing utilization?

c) By looking at the plot produced above, can you conclude that there is some fixed proportional rela-tionship between queue length and response time? Is there something in the theory covered so far capable of modeling this relationship?

资源下载链接为: https://pan.quark.cn/s/abbae039bf2a DDC控制器是一种智能化的控制设备,广泛应用于建筑自动化、工业控制以及环境监控等领域。它基于先进的微处理器技术,具备强大的数据处理能力和灵活的编程功能。通过预先设定的程序,DDC控制器能够对各类传感器采集的信号进行分析处理,并根据预设的控制策略,精准地驱动执行器完成相应的操作。 在建筑自动化系统中,DDC控制器可用于控制暖通空调系统,实现对温度、湿度、风速等参数的精确调节。它能根据室内外环境的变化,自动调整空调设备的运行状态,确保室内环境的舒适性,同时优化能源消耗。此外,DDC控制器还可用于照明控制,根据自然光照强度和人员活动情况,自动调节灯光亮度,实现节能与舒适性的平衡。 在工业控制领域,DDC控制器可用于监控和控制生产线上的各种设备。它可以实时采集设备的运行数据,如温度、压力、流量等,通过分析这些数据判断设备的运行状态,并及时发出指令调整设备的运行参数,确保生产过程的稳定性和产品质量的可靠性。 DDC控制器具有高度的可靠性和稳定性,能够在恶劣的环境条件下长期稳定运行。其模块化的设计便于安装、调试和维护,用户可以根据实际需求灵活配置控制器的输入输出模块。此外,DDC控制器还具备良好的兼容性,能够与多种类型的传感器和执行器无缝对接,构建完整的自动化控制系统。 总之,DDC控制器凭借其卓越的性能和广泛的应用领域,已成为现代自动化控制系统中不可或缺的核心设备,为实现智能化、高效化和节能化的控制目标提供了有力支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值