Skip to content

Commit

Permalink
L31 emdashes
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklam committed Sep 17, 2024
1 parent b03ba26 commit 069a5c3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
40 changes: 20 additions & 20 deletions lectures/L31-slides.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
\begin{frame}
\frametitle{Queueing Theory}

Literally the theory of queues -- what makes queues appear, how will they behave, and how do we make them go away?
Literally the theory of queues---what makes queues appear, how will they behave, and how do we make them go away?


Queueing theory has played a role in your life whether you know it or not.
Expand Down Expand Up @@ -48,12 +48,12 @@
\frametitle{Questions Queueing Theory Helps Answer}

\begin{itemize}
\item Given a choice between a single machine with speed $s$ or $n$ machines, each with speed $s/n$, which should we choose?
\item Given a choice between a single machine with speed $s$, or $n$ machines, each with speed $s/n$, which should we choose?
\item If the arrival rate and service rate double, how does the mean response time change?
\item Should we try to balance load or is that a waste of time/effort?
\item Can we give priority to certain operations without harming another category of job?
\item How do job size variability and heavy-tailed workloads affect our choices of scheduling policy?
\item If 12 servers is enough to handle 9 jobs per second, do we need 12~000 servers if we have an arrival rate if 9~000 jobs per second?
\item If 12 servers is enough to handle 9 jobs per second, do we need 12~000 servers if we have an arrival rate of 9~000 jobs per second?
\end{itemize}

\end{frame}
Expand All @@ -64,12 +64,12 @@
\frametitle{Formal Terms and Bank Analogies}

\begin{itemize}
\item Server - The banking centre fulfilling customer requests.
\item Customer - Initiator of service requests.
\item Wait time - The time a customer spends waiting in line.
\item Service time - The time from when a teller starts to serve a customer up to the time when the next customer is called forward.
\item Arrival rate - The rate at which customers arrive.
\item Service rate - the rate at which customer requests are serviced.
\item Server---the banking centre fulfilling customer requests.
\item Customer---the initiator of service requests.
\item Wait time---the time a customer spends waiting in line.
\item Service time---the time from when a teller starts to serve a customer up to the time when the next customer is called forward.
\item Arrival rate---the rate at which customers arrive.
\item Service rate---the rate at which customer requests are serviced.

\end{itemize}

Expand All @@ -81,11 +81,11 @@
\frametitle{Formal Terms and Bank Analogies}

\begin{itemize}
\item Utilization - The fraction of the teller's time used actually handling customer requests (not idling).
\item Queue length - The total number of customers waiting, or currently with a teller, or both.
\item Response time - The sum of wait and service time for a single visit.
\item Residence time - The total response time if a customer visits several tellers (or the same one multiple times).
\item Throughput - The rate at which customers get their requests serviced and dealt with.
\item Utilization---the fraction of the teller's time used actually handling customer requests (not idling).
\item Queue length---the total number of customers waiting, or currently with a teller, or both.
\item Response time---the sum of wait and service time for a single visit.
\item Residence time---the total response time if a customer visits several tellers (or the same one multiple times).
\item Throughput---the rate at which customers get their requests serviced and dealt with.
\end{itemize}

\end{frame}
Expand Down Expand Up @@ -153,7 +153,7 @@

Suppose the average service rate $\mu$ is 5 jobs per second.

The system is not overloaded -- 3 jobs per second arriving is less than 5 jobs per second being serviced.
The system is not overloaded---3 jobs per second arriving is less than 5 jobs per second being serviced.

\end{frame}

Expand Down Expand Up @@ -191,7 +191,7 @@
\frametitle{Option 3}


The answer is (3) - we don't need to double the CPU speed.
The answer is (3)---we don't need to double the CPU speed.

We can see later in formal terms why this is the case, but think for a minute about what it is?

Expand Down Expand Up @@ -304,7 +304,7 @@
\begin{frame}
\frametitle{Digression on Load Balancing}

Imagine your typical ``server farm'' - you have $n$ servers that are all responsible for handling incoming requests.
Imagine your typical ``server farm''---you have $n$ servers that are all responsible for handling incoming requests.

Let's imagine all servers are the same (or close enough).

Expand All @@ -321,7 +321,7 @@
\begin{frame}
\frametitle{Assignment Policies}

There are a few different task assignment policies - ways in which we can assign work to servers:
There are a few different task assignment policies---ways in which we can assign work to servers:

\begin{itemize}
\item Random
Expand All @@ -347,7 +347,7 @@
You'll never know what you can do\\
Until you get it up as high as you can go''

\hfill - Kenny Loggins
\hfill -- Kenny Loggins


\end{frame}
Expand Down Expand Up @@ -512,7 +512,7 @@

The closed system strategy: set it up so there is always work to do.

In closed systems, there's often consideration given to \textit{think time} -- this is what happens when the user is on the command line and dispatching work to do.
In closed systems, there's often consideration given to \textit{think time}---this is what happens when the user is on the command line and dispatching work to do.

To keep the system totally busy in the stress test, we need think time to be zero---so additional work is always available.

Expand Down
26 changes: 13 additions & 13 deletions lectures/L31.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ \section*{A Short Introduction to Queueing Theory}
I tend to tell stories about banks that imply I hate them. Not really, they're just a place where there's likely to be a queue and I'm likely to be annoyed and thinking about how to optimize this situation. So let's define some terms formally, to make sure we're all on the same page when it comes to terminology and language. Some of these will seem obvious, but let's be complete (like the book~\cite{swps}):

\begin{itemize}
\item Server - The banking centre fulfilling customer requests.
\item Customer - Initiator of service requests.
\item Wait time - The time a customer spends waiting in line.
\item Service time - The time from when a teller starts to serve a customer up to the time when the next customer is called forward.
\item Arrival rate - The rate at which customers arrive.
\item Service rate - the rate at which customer requests are serviced.
\item Utilization - The fraction of the teller's time used actually handling customer requests (not idling).
\item Queue length - The total number of customers waiting, or currently with a teller, or both.
\item Response time - The sum of wait and service time for a single visit.
\item Residence time - The total response time if a customer visits several tellers (or the same one multiple times).
\item Throughput - The rate at which customers get their requests serviced and dealt with.
\item Server---The banking centre fulfilling customer requests.
\item Customer---The initiator of service requests.
\item Wait time---The time a customer spends waiting in line.
\item Service time---The time from when a teller starts to serve a customer up to the time when the next customer is called forward.
\item Arrival rate---The rate at which customers arrive.
\item Service rate---The rate at which customer requests are serviced.
\item Utilization---The fraction of the teller's time used actually handling customer requests (not idling).
\item Queue length---The total number of customers waiting, or currently with a teller, or both.
\item Response time---The sum of wait and service time for a single visit.
\item Residence time---The total response time if a customer visits several tellers (or the same one multiple times).
\item Throughput---The rate at which customers get their requests serviced and dealt with.
\end{itemize}

The mathematical symbols for this are represented in the following table~\cite{swps}:
Expand Down Expand Up @@ -119,9 +119,9 @@ \subsection*{A Digression on Load Balancing}

\subsection*{Red Line Overload\footnote{You've seen ``Top Gun'', right? \url{https://www.youtube.com/watch?v=siwpn14IE7E}}}

Earlier I mentioned it would probably be bad to see 6 jobs arriving per second to a system that can handle 5 per second. This doesn't seem like rocket science, but it bears repeating. In our discussion we require that $\lambda \leq \mu$ and assume that $\lambda < \mu$. That is to say, we are not overloaded (as engineering students you may be amused by the idea that you might one day NOT be overloaded). Remember now that the values for $\lambda$ and $\mu$ are averages, so it could happen that temporarily we ``fall behind'' a bit, but then make up for it a little later on, or we temporarily get ahead before a bunch more work gets piled on. Think about the long term, though -- if we are not at least keeping up then this will eventually get out of hand. How badly? Well, in the limit, the queue length goes to infinity.
Earlier I mentioned it would probably be bad to see 6 jobs arriving per second to a system that can handle 5 per second. This doesn't seem like rocket science, but it bears repeating. In our discussion we require that $\lambda \leq \mu$ and assume that $\lambda < \mu$. That is to say, we are not overloaded (as engineering students you may be amused by the idea that you might one day NOT be overloaded). Remember now that the values for $\lambda$ and $\mu$ are averages, so it could happen that temporarily we ``fall behind'' a bit, but then make up for it a little later on, or we temporarily get ahead before a bunch more work gets piled on. Think about the long term, though---if we are not at least keeping up then this will eventually get out of hand. How badly? Well, in the limit, the queue length goes to infinity.

The justification comes from~\cite{pmd}: Let's represent time with $t$, its usual symbol and define $N(t)$ as the number of jobs in the system at time $t$. $A(t)$ represents arrivals by time $t$ and $D(t)$ represents departures by time $t$. So:
The justification comes from~\cite{pmd}: Let's represent time with $t$, its usual symbol, and define $N(t)$ as the number of jobs in the system at time $t$. $A(t)$ represents arrivals by time $t$ and $D(t)$ represents departures by time $t$. So:

\begin{center}
$E[N(t)] = E[A(t)] - E[D(t)] \geq \lambda t - \mu t = t (\lambda - \mu) $
Expand Down

0 comments on commit 069a5c3

Please sign in to comment.