首页 > 其他分享 >CS-350 - Fundamentals of Computing Systems

CS-350 - Fundamentals of Computing Systems

时间:2024-09-25 17:49:51浏览次数:7  
标签:plot Computing Fundamentals average between queue time CS distribution

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代 写CS-350 - Fundamentals of Computing Systems  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?

 

标签:plot,Computing,Fundamentals,average,between,queue,time,CS,distribution
From: https://www.cnblogs.com/wx--codinghelp/p/18431824

相关文章

  • 阿里云ECS无法使用25端口发送短信解决方法
    phpmailer发邮件提示SMTP->ERROR:Failedtoconnecttoserver的解决方法写的网站本地测试发送短信成功,但是部署到阿里云ECS服务器上发送短信失败。打开cmd测试下telnetsmtp.163.com25 失败telnetsmtp.163.com465成功则解决方法如下配置的时候设置端口465,并加密SSL$mailer->......
  • Elasticsearch 实战应用详解
    Elasticsearch是一个分布式搜索和分析引擎,广泛应用于各种场景,如全文搜索、日志与事件数据分析、实时数据流处理等。本文将详细介绍如何在实际项目中使用Elasticsearch,包括安装配置、基本操作、高级查询及优化策略。1.安装和配置安装Elasticsearch通过官方包管理器安装......
  • CSS基础
    CSS简介CSS概念CSS(CascadingStyleSheets)层叠样式表,又叫级联样式表,简称样式表CSS文件后缀名为.cssCSS用于HTML文档中元素样式的定义为什么需要CSS使用css的目的就是让网页具有美观一致的页面CSS和HTML之间的关系HTML用于构建网页的结构CSS用于构建HTML元素的样式H......
  • 大模型项目部署时Gradio Web页面打不开或者打开用不了及pydantic.errors.PydanticSche
    问题描述 在复现大模型demo时连接器和模型加载都没问题,但是gradio界面打不开或者打开后用不了原因分析:感觉应该是gradio的版本问题导致该文件缺少相关文件解决方案:可以首先按照上面要求下载文件https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_a......
  • 【Elasticsearch系列七】索引 crud
    ......
  • 2024.9.2-CSP模拟赛1
    考试:大约在9:40左右发了题。9:45把所有的题目都快速看了一遍,T1感觉模拟可能会T,T2最小生成树的板子,T3又是追及问题感觉要挂,T4感觉像是区间DP。9:50开始做T1,先是手搓了一个gcd又手动模拟了取模(想起了xqy因为取模导致的TLE),样例输出得都挺快的。但是看了一眼数据......
  • 2024.9.3-CSP模拟赛2
    考试:9:00开题:第一题第一眼数据范围\(1\len\le5\times10^7\),感觉有T的风险。第二题littlebird,记得在以前做过这道题。第三题不太会,没有给部分分的比值,感觉只能写个暴搜。\(O(n^2)\)的暴力肯定会,正解先待会再想。9:10做T1,直接写暴力,5分钟写完了。试了一下500......
  • 2024.9.5-CSP模拟赛4
    考试:9:00~9:10看题:T1:很久之前做过,没有什么印象了。T2:感觉是广搜,但有可能要爆。T3:搜索题,猛加优化。T4:不知道是什么类型的题目。9:10~9:50写T1,已经忘了怎么写的,只能当做一道新题来做。写了个贪心,分了2中情况进行讨论,样例和自造样例都过了,但肯定会WA。其实在写计算的......
  • 2024.9.4-CSP模拟赛3
    考试:9:00~9:25怎么还不发卷啊,等得有点慌了,这是在考验心态吗?原来是极域出了点问题9:25~9:35发卷了,先看题。T1:相对距离,这不是原题吗,这题能做。T2:平衡队列,数据有点大,要不要离散化?好像不用,先等会在仔细看看。T3:第一眼数据范围:\(1\leN\le100\),直接弗洛伊德呀。T4:是并查集吗......
  • 2024.9.6-CSP模拟赛5
    考试:9:00~9:10发卷:T1有想法但要思考一下。T2水题,秒切。T3状压,昨天晚上就在看,但没看完只听了思路。T4看上去是原题,可以做一做。9:10~9:30先做T4,真是原题,直接写。直接写了归并排序,前面又补了一个0,然后求了逆序对。样例很快就过了就放了。9:30~9:50直接写了T2,T2......