<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance Metrics of a System on Programmer's Insight</title><link>https://blog.ganapathy.xyz/tags/performance-metrics-of-a-system/</link><description>Recent content in Performance Metrics of a System on Programmer's Insight</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 20 Mar 2013 21:53:33 -0700</lastBuildDate><atom:link href="https://blog.ganapathy.xyz/tags/performance-metrics-of-a-system/index.xml" rel="self" type="application/rss+xml"/><item><title>Performance metrics of Computer Systems - 1</title><link>https://blog.ganapathy.xyz/2013/03/performance-metrics-of-computer-systems.html</link><pubDate>Wed, 20 Mar 2013 21:53:00 -0700</pubDate><guid>https://blog.ganapathy.xyz/2013/03/performance-metrics-of-computer-systems.html</guid><description>&lt;div&gt;&#10;When we think about evaluating the performance of a system, some things that comes to our mind are&lt;br&gt;&#10;&lt;br&gt;&#10;a) Configuration and Flow that needs to be bench-marked.&lt;br&gt;&#10;b) Number of instances of node/server (1 or many ).&lt;br&gt;&#10;c) Duration of the task.&lt;br&gt;&#10;d) Tools that are gonna be used for analyzing and preparing report.&lt;br&gt;&#10;e) Existing benchmark report of the system for comparing the new data.&lt;br&gt;&lt;br&gt;Let&#10; me give you my idea on each of the above aspects as well as my views on&#10; performance metrics of a system. Specifically let me discuss about "&lt;i&gt;arriving&amp;nbsp; at benchmarks when we release the Version 1 of the software&lt;/i&gt;" in this blog. &lt;br&gt;&#10;&lt;br&gt;&#10;consider a simple coin toss :)&amp;nbsp; Yeah its about probability and queuing :D &lt;br&gt;&#10;How are we going to measure the performance of this toss? &lt;br&gt;&#10;a) May be height travelled by the coin ?&lt;br&gt;&#10;b) Number of flips it makes? etc etc.&lt;br&gt;&#10;&lt;br&gt;&#10;We use &lt;i&gt;"laws of physics"&lt;/i&gt; as a tool to measure the performance metrics of the coin.&lt;br&gt;&#10;&lt;br&gt;&#10;Now&#10; consider a system where messages are received, parsed and given to &#10;various components and sent back. This kind of system is called &lt;i&gt;Open system&lt;/i&gt;.&lt;br&gt;&#10;&lt;br&gt;&#10;There is one more type of system called &lt;i&gt;Closed System&lt;/i&gt;.&#10; Interpret it to a CI machine where CI-coordinators submit jobs which &#10;in-turn is executed on a set of machines ( servers ) and returns back to&#10; idle state.&lt;br&gt;&#10;&lt;br&gt;&#10;Our software (Version 1) can be open or &#10;closed. As we don't have any previous benchmarks for this software, we &#10;have to arrive at a theoretical bench-mark so that we are able to &#10;ascertain the practical measurements.&lt;br&gt;&#10;&lt;br&gt;&#10;So how do we arrive at theoretical benchmarks? &lt;br&gt;&#10;Using Queuing models :-). Yeah its all maths buddy :D&lt;br&gt;&#10;&lt;br&gt;&#10;For those who have taken a Queuing course, these things should not be new. Others please continue reading.&lt;br&gt;&#10;&lt;br&gt;&#10;As we are used to event-driven programming, lets continue our thoughts using this.&lt;br&gt;&#10;&lt;br&gt;&#10;What is event-driven programming? &lt;br&gt;&#10;Some&#10; events happen and based on the event we execute some tasks ( code ). &#10;After this may be the server goes to wait state to handle next set of &#10;events.&lt;br&gt;&#10;&lt;br&gt;&#10;So lets define 4 set of events.&lt;br&gt;&#10;a) Customers / Messages arrive randomly (which we call Poisson arrivals)&lt;br&gt;&#10;b) Customers / Message wait in queue for getting processed. &lt;br&gt;&#10;c) They get processed. ( called exponential service times)&lt;br&gt;&#10;d) They leave the system ( our system memory allocs are put back to pool. )&lt;br&gt;&#10;&lt;br&gt;&#10;Of-course&#10; there are certain systems where messages arrive at fixed time slots &#10;like burst ( Systems like ALOHA / Slotted ALOHA uses something like &#10;this. Other case may be where attacker is trying to send a burst message&#10; causing buffer overflows in network elements) or what not.&lt;br&gt;&#10;&lt;br&gt;&#10;So having defined these events we can categorize our system ( software ) as M/M/N/K system.&lt;br&gt;&#10;First&#10; M denotes the arrival rate of messages into our system. Second M &#10;denotes the rate at which it is processed. N denotes the number of &#10;servers handling our messages and K denotes the system capacity.&lt;br&gt;&#10;&lt;br&gt;&#10;Why do we have two M's ?&lt;br&gt;&#10;Aren't the messages going to be served in the order they arrive?&lt;br&gt;&#10;&lt;br&gt;&#10;No.&#10; Most systems have some thing called classes similar to IntServ/DiffServ&#10; model where customers paying more are grouped into higher classes and &#10;have better experience while those pay low have lower experience &#10;comparatively.&lt;br&gt;&#10;&lt;br&gt;&#10;Also consider the case where server is bombarded with lots of requests it can't handle. What can server do now ?&lt;br&gt;&#10;&lt;br&gt;&#10;It can delay the person entering the system through some protocols like Stateless Cookie protocol&lt;br&gt;&#10;i.e&#10; if some one sends INVITE message in case of SIP protocol or SYN message&#10; in case of TCP the server handling it can send a reply asking him to &#10;solve a hardest puzzle/ calculating a hash which would take sufficient &#10;amount of time for the sender to compute and reply. In the mean time &#10;server clears the messages in its queue and is ready to accept new &#10;connections.&lt;br&gt;&#10;&lt;br&gt;&#10;So we are deliberately delaying the &#10;customer entering the system. This happens with IRCTC [ Indian Railway &#10;Reservation Systems Servers :) ] &lt;br&gt;&#10;&lt;br&gt;&#10;So coming back to our M/M/N/K model, this model has a set of predefined formulas through which&lt;br&gt;&#10;one&#10; can arrive at various metrics of system like throughput, delay, waiting&#10; time of customer(message), time spent by the message in the system etc.&lt;br&gt;&#10;&lt;br&gt;&#10;Using&#10; these values along with the system parameters one can arrive at the &#10;theoretical bench-mark of a system and then use it to compare with &#10;practical data of our version1 software.&lt;br&gt;&#10;&amp;nbsp; &lt;br&gt;&#10;Let us conclude it for now. Other factors would be posted gradually.&lt;br&gt;&#10;Hope you got something out of this post.&lt;br&gt;&#10;Please post comments/feedback (if any).&lt;/div&gt;</description></item></channel></rss>