1 / 53

Computer Modeling  And  Simulation

Computer Modeling  And  Simulation. F.Ramezani Department of Computer Engineering Islamic Azad University SARI Branch. Introduction to Computer Modeling And Simulation. Topics. معرفی تکنیک های اندازه گیری نظارت سخت افزار نظارت نرم افزار نظارت ترکیبی تحلیل دادهها

Download Presentation

Computer Modeling  And  Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Modeling And Simulation F.Ramezani Department of Computer Engineering Islamic Azad University SARI Branch Introduction toComputer Modeling AndSimulation

  2. Topics • معرفی • تکنیک های اندازه گیری • نظارت سخت افزار • نظارت نرم افزار • نظارت ترکیبی • تحلیل دادهها • تکنیک های شبیه سازی • تجزیه و تحلیل رگرسیون • واریانس تکنیک های کاهش • مدل های صف • تجزیه و تحلیل تصادفی Introduction to Computer Modeling And Simulation

  3. مقدمه • Evaluation(ارزیابی) : بررسی این که آیا عملکرد یک سیستم نسبت به سیستم های قبل بهتر شده یا خیر. • جنبه های ارزیابی: • functional: سیستم باید دقیقا کاری را که برای آن طراحی شده انجام بدهد. • performance • Performance Evaluation (ارزیابی کارایی): - اطمینان از این که سیستم برای کاربرد موردنظر مناسب, مؤثر و قابل اطمینان است. - سیستم باید با توجه به محدودیت منابع, نزدیک به سطح بهینه عمل کند. Introduction to Computer Modeling And Simulation

  4. Objectives (1 of 6) تکنیک های ارزیابی مناسب، عملکرد متریک و حجم کار برای یک سیستم را انتخاب کند. • Select appropriate evaluation techniques, performance metrics and workloads for a system. • Techniques: اندازه گيري ، سنجش شبیه سازی و تحلیل • Metrics: شرايط ، معيارها ، ضوابط (ex: response time) • Workloads: requests by users/applications to the system • Example:? • a) Two disk drives • b) Two transactions processing systems • c) Two packet retransmission algorithms Introduction to Computer Modeling And Simulation

  5. Objectives (2 of 6) • انجام اندازه گیری عملکرد درستی • Need two tools: load generator and monitor • Example: Which workload…? • a) Utilization on a LAN • b) Response time from a Web server • c) Audio quality Introduction to Computer Modeling And Simulation

  6. Objectives (3 of 6) • استفاده از تکنیک های مناسب آماری برای مقایسه چند راه حل جایگزین • یک اجرا از یک حجم کاری اغلب کافی نیست • بسیاری از کامپیوتر ها عملکرد غی قطعی دارند • با مقایسه چندین اجرا میتوان نتایج تولید شده را اصلاح کرد • Example: Packets lost on a link. Which link is better? File Size Link A Link B 1000 5 10 1200 7 3 1300 3 0 50 0 1 Introduction to Computer Modeling And Simulation

  7. Objectives (4 of 6) • طراحی اندازه گیری و شبیه سازی باارزش ترین اطلاعات را با کمترین تلاش ارائه می کنند. • اغلب بسیاری از عوامل هستند که کارایی عملکرد را تحت تاثیر قرار میدهند • جدا از اثر که بصورت جداگانه هم مهم هستند • Example? • A) garbage collection technique: G1, G2 none • B) type of workload: editing, compiling, AI • C) type of CPU: P2, P4 Introduction to Computer Modeling And Simulation

  8. Objectives (5 of 6) • انجام شبیه سازی به درستی • انتخاب درست زبان برنامه نویسی، مقدار اولیه برای تولید اعداد تصادفی ، طول اجرای شبیه سازی، تجزیه و تحلیل قبل از اجرا • Example: • A) how long should the simulation be run? • B) برای بدست آوردن همین دقت چه عملی می توان انجام داد برای کوتاه کردن اجرا Introduction to Computer Modeling And Simulation

  9. Objectives (6 of 6) • استفاده از سیستم صف برای تجزیه و تحلیل عملکرد سیستم • استفاده از سیستم های کامپیوتری با نرخ ورود و نرخ خدمات متفاوت برای • Multiple servers • Multiple queues • Example: • Web request rate 2 سرویس دهنده وب دو پردازنده ای یا 4 سرویس دهنده وب تک پردازنده ای؟ Introduction to Computer Modeling And Simulation

  10. The Art of Performance Evaluation • ارزشیابی مکانیکی تولید نمی شود • نیاز به دانش دقیقی از سیستم • انتخاب دقیق روش، حجم کار، ابزار • پاسخ صحیح به عنواندو تحلیل کارایی و انتخاب یا حجم کار در معیارهای مختلف Introduction to Computer Modeling And Simulation

  11. A Systematic Approach for Evaluation • اهداف مسئله و تعریف مرزهای • انتخاب معیارهای عملکرد • لیست سیستم و پارامترهای حجم کار • انتخاب عوامل و ارزش ها • انتخاب روش های ارزیابی • انتخاب حجم کار • آزمایش های طراحی • تجزیه و تحلیل و تفسیر داده ها • بررسی نتایج. • Repeat. Introduction to Computer Modeling And Simulation

  12. معیارهای اندازه گیری کارایی جنبه های اصلی که در اندازه گیری کارایی درنظر گرفته می شود: • سرعت انجام کار: (با توجه به تنوع بار کاری) • کنترل زمان واقعی • پردازش تراکنش • محاسبات محاوره ای • پردازش دسته ای • چگونگی برخورد سیستم با خرابی و وضعیت غیر معمول : (با توجه به نوع خرابی) • از دست دادن قابل توجهی از اطلاعات مانند خرابی هارد دیسک • خرابی پردازنده • چگونگی استفاده سیستم از منابع Introduction to Computer Modeling And Simulation

  13. معیارهای اندازه گیری کارایی .... • responsiveness: (تاثير پذيري) ارزیابی سرعت انجام کار • اندازه گیری ها: • waiting time: زمان از دادن کار به سیستم تا پاسخ • processing time: زمان پردازش یک کار • conditional waiting time: زمان انتظار برای کارهایی که زمان پردازش معینی لازم دارند. • queue length • انواع اندازه گیری: • محاسبه میانگین • حد بالا • درصد • توزیع کلی Introduction to Computer Modeling And Simulation

  14. معیارهای اندازه گیری کارایی • usage level: نحوه استفاده از منابع • throughput: تعداد فرایندهایی که در واحد زمان از پردازنده استفاده می کنند. • utilization: مقدار کار مفید در واحد زمان تذکر: معمولا آنچه در این قسمت بررسی می شود با responsiveness در تناقض است. • Missionability(شايستگي‌)این که آیا در طول زمان مأموریت, سیستم به صورت پیوسته عملکرد مناسبی داشته یا خیر. • احتمال این که در فاصله زمانی مأموریت سیستم خطایی برای آن اتفاق نیفتد. • تعیین عمر سیستم Introduction to Computer Modeling And Simulation

  15. معیارهای اندازه گیری کارایی • dependability: قابلیت اطمینان سیستم در زمان طولانی • از دو نظر: reliability , availability اعتبار و دسترسی • (MTTF): Mean Time To Failure • (MTTR): Mean Time To Repair • (MTBF): Mean time between failure • Long term availability • cost of a failure • Productivity: بهره وري • user friendliness آسانی • Maintainability نگه داری • Understandability درک Introduction to Computer Modeling And Simulation

  16. ارتباط هر گروه از سیستم های کامپیوتری با معیار مناسب Introduction to Computer Modeling And Simulation

  17. روشهای ارزیابی کارایی • اندازه گیری • شبیه سازی • مدل سازی تحلیلی • مدل سازی ترکیبی (ترکیبی 2،3) Introduction to Computer Modeling And Simulation

  18. روشهای ارزیابی کارایی ... • measurement: اندازه گیری • اساسی ترین روش که در سایر روشها هم استفاده می شود. • داده ای که از اندازه گیری ها جمع آوری می شود باید با روش های آماری تحلیل شود تا نتیجه گیری ها معنی دار باشد. • تعیین پارامترهای خروجی که باید اندازه گیری شوند, چگونه باید اندازه گیری شوند و چه مقادیری باید برای ترکیبهای ورودی که تحت کنترل هستند انتخاب شوند. Introduction to Computer Modeling And Simulation

  19. روشهای ارزیابی کارایی ... • simulation modeling: ساخت یک مدل برای رفتار سیستم و اجرای آن با بار کاری مناسب. • مزیت: کلی بودن و انعطاف پذیری • نکات مهم: • تعیین این چه بخش هایی ازسیستم و در چه سطحی از جزئیات شبیه سازی شوند. • داده تولید شده باید با روش های آماری تحلیل شود. • باید سعی کرد که هزینه کاهش پیدا کند. • شبیه سازی بسته به هدف مطالعه در سطوح مختلفی از جزئیات انجام می شود. Introduction to Computer Modeling And Simulation

  20. روشهای ارزیابی کارایی ... • Analytic modeling: ساخت یک مدل ریاضی برای رفتار سیستم و حل آن. • برای بررسی رفتار کلی مفید است. (دامنه مدل محدود است) • مدل های تحلیلی ساده معمولا به راحتی حل می شوند و نتایج کاملا دقیقی تولید می کنند.نسبت به مدل های پیچیده پایدارتر هستند, خطاهای کوچک در مقدار پارامترها, کمتر در نتایج تأثیر می گذارد. • نتایج تحلیل, مقدار پیش بینی بهتری نسبت به اندازه گیری یا شبیه سازی ایجاد می کنند. • در برخی از سیستمها پارامترهای ورودی دقیقا مشخص نیستند یا نتایج مطلوب به خوبی تعریف نشده اند. زمانی که مدل سازی دقیق لازم نیست روشهای تحلیلی مناسبند. Introduction to Computer Modeling And Simulation

  21. Introduction to Computer Modeling And Simulation

  22. روشهای ارزیابی کارایی ... • Hybrid Modeling • برای مدلهای پیچیده که شامل چند زیرمدل هستند مناسب است. • مثال: ارزیابی سیستم کامپیوتر که از dynamic partitioning memory allocation استفاده می کند: • حل مدل تحلیلی با فرض عدم وجود fragmentation و تعیین توزیع زمان نگهداری حافظه • شبیه سازی فقط برای تخصیص حافظه, نگهداری و آزادسازی و تعیین میانگین کسری از حافظه که قابل استفاده نیست. • تنظیم مجدد مدل تحلیلی مرحله اول Introduction to Computer Modeling And Simulation

  23. کاربردهای ارزیابی کارایی • system design: • تعیین اهداف کارایی و اطمینان و ایجاد معماری پایه • تعیین نحوه انتخاب پارامترها برای رسیدن به اهداف (ساخت مدلی از رفتار سیستم با سطح مناسبی از جزئیات و ارزیابی آن برای انتخاب پارامترها) • system selection: • انتخاب بهترین سیستم از یک مجموعه از سیستمها از لحاظ هزینه, در دسترس بودن, سازگاری و ... • system upgrade: • جایگزینی سیستم یا بخشی از آن با واحد جدید. • system tuning: • بهینه سازی کارایی با تغییر سیاست های مدیریت منابع. • system analysis: • بررسی اشکالهای سیستم و دلیل وجود آنها. Introduction to Computer Modeling And Simulation

  24. workload characterization • هدف: ایجاد ورودی های معینی برای سیستم واقعی یا مدل آن. • دو گروه ورودی: • پارامترهای قابل کنترل توسط طراح یا متصدی سیستم. مثال: قوانین زمان بندی, ارتباط بین دستگاهها, سیاست های تخصیص منابع • ورودی هایی که توسط محیط تولید می شوند. مثال: تقاضاهای سرویس برای کارهای ورودی. • مثال:افزایش قابلیت محاسباتی یک سیستم: • باید اندازه گیری تحت بار کاری واقعی انجام شود و پارامترهای قابل کنترل در سطح مطلوبی ثابت نگه داشته شوند. • مشکل: 1) کی و به چه مدتی اندازه گیری انجام شود؟ 2) دقت به این مسأله که هدف تعیین بار کاری برای سیتم توسعه یافته است نه سیستم موجود. 3) میزان استفاده از منایع چقدر است؟ Introduction to Computer Modeling And Simulation

  25. workload characterization • مسائل موجود: • زمانی که اندازه گیری مستقیم امکان پذیر نیست. • زمانی که دقیقا مشخص نیست که کدام ویژگیهای بار کاری مهم هستند. • بار کاری در زمانهای مختلف, متفاوت است. • در مدل های تحلیلی مدل بار کاری خلاصه ای که به صورت آماری است به کار می رود. • در شبیه سازی لازم است جزئیات دقیق تر بررسی شوند. • خلاصه سازی بار کاری باعث کاهش هزینه ها و پایداری بیشتری می شود • انواع بار کاری : • Executable ( اجرایی): شامل ثبت نمونه های ورودی و طول مدت سرویس دهی برای کارها. • Nonexecutable: تعیین توزیع ها که برای مدل سازی تحلیلی به کار می رود. Introduction to Computer Modeling And Simulation

  26. روشهای آماری برای ارزیابی عملکرد

  27. Why do we need statistics? 1. Noise, noise, noise, noise, noise! Introduction to Computer Modeling And Simulation

  28. Why Do We Need Statistics? 2. Aggregate data into meaningful information. 445 446 397 226 388 3445 188 1002 47762 432 54 12 98 345 2245 8839 77492 472 565 999 1 34 882 545 4022 827 572 597 364 Introduction to Computer Modeling And Simulation

  29. Why Do We Need Statistics? “Impossible things usually don’t happen.” - Sam Treiman, Princeton University • Statistics helps us quantify “usually.” Introduction to Computer Modeling And Simulation

  30. What is a Statistic? • “کمیت هر چیزی با استفاده از نمونه هایی از آن محاسبه میشود.” Merriam-Webster → یک داده نماینده از کل داده و کل ساختار خواهد بود. Introduction to Computer Modeling And Simulation

  31. What are Statistics? • “جمع آوری اطلاعات داده ها.” Merriam-Webster → We are most interested in analysis and interpretation here. Introduction to Computer Modeling And Simulation

  32. Objectives • زمینه بصری مفهومی برای برخی از ابزارهای استاندارد آماری هستند. • نتیجه گیری معنی دار در حضور اندازه گیری های داده های نویزی. • به شما اجازه می دهد به درستی و هوشمندانه اعمال روش ها در موقعیت های جدید داشته باشید Introduction to Computer Modeling And Simulation

  33. ابزارهای آماری اساسی(1 of 3) • رویدادهای مستقل:یک رویداد دیگر تاثیر نمی گذارددانستن احتمال یک رویداد برآورد یکی دیگر از تغییر نیست • Cumulative Distribution (or Density) Function: • Fx(a) = P(x<=a) • Mean (or Expected Value): • Mean µ = E(x) = (pixi) for i over n • Variance: • Square of the distance between x and the mean • (x- µ)2 • Var(x) = E[(x- µ)2] =pi (xi- µ)2 • Variance is often . Square root of variance, 2, is standard deviation انحراف معیار Introduction to Computer Modeling And Simulation

  34. Basics (2 of 3) • Coefficient of Variation: • Ratio of standard deviation to mean • C.O.V. =  / µ • Covariance: • Degree two random variables vary with each other • Cov = 2xy = E[(x- µx)(y- µy)] • Two independent variables have Cov of 0 وابسته =1 خواهد شد • Correlation: • Normalized Cov (between –1 and 1) • xy= 2xy / xy • Represents degree of linear relationship Introduction to Computer Modeling And Simulation

  35. Basics (3 of 3) • Quantile: • The x value of the CDF (Cumulative Distribution (or Density) Function) at  • Denoted x, so F(x) =  • Often want .25, .50, .75 • Median: • The 50-percentile (or, .5-quantile) • Mode: • The most likely value of xi • Normal Distribution • Most common distribution used, “bell” curve Introduction to Computer Modeling And Simulation

  36. Summarizing Data by a Single Number • Indices of central tendency • Three popular: mean, median, mode • Mean – sum all observations, divide by num میانگین • Median – sort in increasing order, take middle وسط • Mode – plot histogram and take largest bucket • Mean can be affected by outliers, while median or mode ignore lots of info • Mean has additive properties (mean of a sum is the sum of the means), but not median or mode Introduction to Computer Modeling And Simulation

  37. mean median mode modes f(x) f(x) mean median no mode f(x) (a) (b) mean median mode (c) median mean Relationship Between Mean, Median, Mode mode f(x) f(x) median mean (d) Introduction to Computer Modeling And Simulation (d)

  38. Common Misuses of Means (1 of 2) • Using mean of significantly different values • Just because mean is right, does not say it is useful • Ex: two samples of response time, 10 ms and 1000 ms. Mean is 505 ms but useless. • Using mean without regard to skew • Does not well-represent data if skewed • Ex: sys A: 10, 9, 11, 10, 10 (mean 10, mode 10) • Ex: sys B: 5, 5, 5, 4, 31 (mean 10, mode 5) Introduction to Computer Modeling And Simulation

  39. Common Misuses of Means (2 of 2) • Multiplying means • Mean of product equals product of means if two variables are independent. But: • if x,y are correlated E(xy) != E(x)E(y) • Ex: mean users system 23, mean processes per user is 2. What is the mean system processes? Not 46!  Processes determined by load, so when load high then users have fewer. Instead, must measure total processes and average. Introduction to Computer Modeling And Simulation

  40. Geometric Mean (1 of 2) • Previous mean was arithmetic mean • Used when sum of samples is of interest • Geometric mean when product is of interest • Multiply n values {x1, x2, …, xn} and take nth root: x = (xi)1/n • Example: measure time of network layer improvement, where 2x layer 1 and 2x layer 2 equals 4x improvement. • Layer 7 improves 18%, 6 13%, 5, 11%, 4 8%, 3 10%, 2 28%, 1 5% • So, geometric mean per layer: • [(1.18)(1.13)(1.11)(1.08)(1.10)(1.28)(1.05)]1/7 – 1 • Average improvement per layer is 0.13, or 13% Introduction to Computer Modeling And Simulation

  41. Harmonic Mean (1 of 2) • Harmonic mean of samples {x1, x2, …, xn} is: n / (1/x1 + 1/x2 + … + 1/xn) • Use when arithmetic mean works for 1/x • Ex: measurement of elapsed processor benchmark of m million instructions. The ith takes ti seconds. MIPS xi is m/ti • Since sum of instructions matters, can use harmonic mean for benchmarks = n / [1/(m/t1) + 1/(m/t2) + … + 1/(m/tn)] = m / [(1/n)(t1 + t2 + … + tn) Introduction to Computer Modeling And Simulation

  42. Harmonic Mean (2 of 2) • Ex: if different benchmarks (mi), then sum of mi/ti does not make sense • Instead, use weighted harmonic mean. xi’s represent the MIPS rate for n different benchmarks n / (w1/x1 + w2/x2 + … + w3/xn) • where w1 + w2 + .. + wn = 1 • In example, perhaps choose weights proportional to size of benchmarks • wi = mi / (m1 + m2 + .. + mn) • So, weighted harmonic mean (m1 + m2 + .. + mn) / (t1 + t2 + .. + tn) • Reasonable, since top is total size and bottom is total time Introduction to Computer Modeling And Simulation

  43. Mean of a Ratio (1 of 2) • Set of n ratios, how to summarize? • Here, if sum of numerators and sum of denominators both have meaning, the average ratio is the ratio of averages Average(a1/b1, a2/b2, …, an/bn) = (a1 + a2 + … + an) / (b1 + b2 + … + bn) = [(ai)/n] / [(bi)/n] • Commonly used in computing mean resource utilization Introduction to Computer Modeling And Simulation

  44. Mean of a Ratio (2 of 2) • CPU utilization: • For duration 1 busy 45%, 1 %45, 1 45%, 1 45%, 100 20% • Sum 200%, mean != 200/5 or 40% • The base denominators (duration) are not comparable • mean = sum of CPU busy / sum of durations = (.45+.45+.45+.45+.20) / (1+1+1+1+100) = 21% Introduction to Computer Modeling And Simulation

  45. Frequency mean Response Time Summarizing Variability (1 of 2) • Summarizing by a single number is rarely enough  need statement about variability • If two systems have same mean, tend to prefer one with less variability Frequency mean Introduction to Computer Modeling And Simulation Response Time

  46. Summarizing Variability (2 of 2) • Indices of Dispersion • Range – min and max values observed • Variance or standard deviation • 10- and 90-percentiles • (Semi-)interquartile range • Mean absolute deviation Introduction to Computer Modeling And Simulation

  47. Range • Easy to keep track of • Record max and min, subtract • Mostly, not very useful: • Minimum may be zero • Maximum can be from outlier • System event not related to phenomena studied • Maximum gets larger with more samples, so no “stable” point • However, if system is bounded, for large sample, range may give bounds Introduction to Computer Modeling And Simulation

  48. Sample Variance • Sample variance (can drop word “sample” if meansing is clear) • s2 = [1/(n-1)] (xi – x)2 • Also called degrees of freedom • Main problem is in units squared so changing the units changes the answer squared • Ex: response times of .5, .4, .6 seconds Variance = 0.01 seconds squared or 10000 msecs squared Introduction to Computer Modeling And Simulation

  49. Standard Deviation • So, use standard deviation • s = sqrt(s2) • Same unit as mean, so can compare to mean • Ex: response times of .5, .4, .6 seconds • stddev .1 seconds or 100 msecs • Can compare each to mean • Ratio of standard deviation to mean? • Called the Coefficient of Variation (C.O.V.) • Takes units out and shows magnitude • Ex: above is 1/5 (or .2) for either unit Introduction to Computer Modeling And Simulation

  50. Percentiles/Quantile • Similar to range • Value at express percent (or fraction) • 90-percentile, 0.9-quantile • For –quantile, sort and take [(n-1)+1]th • [] means round to nearest integer • 25%, 50%, 75%  quartiles (Q1, Q2, Q3) • Note, Q2 is also the median • Range of Q3 – Q1 is interquartile range دامنه میان چارکی • ½ of (Q3 – Q1) is semi-interquartile range دامنه نیمه چارکی Introduction to Computer Modeling And Simulation

More Related