Commits

Bryan O'Sullivan committed ed1fc6f

Snapshot

Comments (0)

Files changed (7)

 all: hs2010.pdf
 
-hs2010.pdf: hs2010.tex biblio.bib graphs.gnuplot
+hs2010.pdf: hs2010.tex biblio.bib graphs.gnuplot *.dat
 	gnuplot graphs.gnuplot
 	for i in *.eps; do epstopdf $$i; done
 	pdflatex hs2010
 set ytics 0,5000
 set key bottom center outside
 set yrange [0:*]
-set xrange [1:20000]
+set xrange [1:70000]
 set output 'http-rps.tex'
 set log x
 set xlabel 'Active concurrent clients'
 set ylabel 'Requests per second'
-plot 'new-pong-server.dat' using 1:4 title '\texttt{pong} (new)', \
-     'old-pong-server.dat' using 1:4 title '\texttt{pong} (old)', \
-     'new-static-http-4k.dat' using 1:4 title '\texttt{file} (new)', \
-     'old-static-http-4k.dat' using 1:4 title '\texttt{file} (old)'
+plot 'new-pong-server.dat' using 1:3 title '\texttt{pong} (new)', \
+     'old-pong-server.dat' using 1:3 title '\texttt{pong} (old)', \
+     'new-static-http-4k.dat' using 1:3 title '\texttt{file} (new)', \
+     'old-static-http-4k.dat' using 1:3 title '\texttt{file} (old)'
 
+set output 'idle-rps.tex'
+set xlabel 'Active idle clients'
+set yrange [0:20000]
+plot 'old-dead-pong.dat' using 1:3 title '\texttt{pong} (old)', \
+     'new-dead-pong.dat' using 1:3 title '\texttt{pong} (new, \texttt{epoll})', \
+     'poll-dead-pong.dat' using 1:3 title '\texttt{pong} (new, \texttt{poll})'
+
+set term epslatex color size 3.5in,2.8in
 set output 'http-lat.tex'
 set log
 set ytics autofreq
 set yrange [*:*]
+set xlabel 'Active concurrent clients'
 set ylabel 'Request latency (ms)'
+set key bottom center outside
 plot 'new-pong-server.dat' using 1:7 title '\texttt{pong} (new)', \
      'old-pong-server.dat' using 1:7 title '\texttt{pong} (old)', \
      'new-static-http-4k.dat' using 1:7 title '\texttt{file} (new)', \
      'old-static-http-4k.dat' using 1:7 title '\texttt{file} (old)'
+
+set term epslatex color size 3.2in,2.133in
+set output 'idle-lat.tex'
+set xlabel 'Active idle clients'
+set yrange [*:*]
+set key top left reverse Left inside
+plot 'old-dead-pong.dat' using 1:7 title '\texttt{pong} (old)', \
+     'new-dead-pong.dat' using 1:7 title '\texttt{pong} (new, \texttt{epoll})',      'poll-dead-pong.dat' using 1:7 title '\texttt{pong} (new, \texttt{poll})'
   \centering
   \input{http-rps.tex}
   \caption{Requests served per second by two HTTP server benchmarks,
-    under old and new~I/O managers.}
+    with all clients busy, under old and new~I/O managers.}
   \label{fig:http-rps}
 \end{figure}
 
 \begin{figure}
   \centering
   \input{http-lat.tex}
-  \caption{Latency per request served of the HTTP server benchmarks,
-    under old and new~I/O managers.}
+  \caption{Latency per request with all clients busy.}
   \label{fig:http-lat}
 \end{figure}
 
 or so that the original~I/O manager is capable of.  (We simply stopped
 measuring at 16,384.)
 
+\begin{figure}
+  \centering
+  \input{idle-rps.tex}
+  \caption{Requests served per second, with varying numbers of idle
+    connections.}
+  \label{fig:idle-rps}
+\end{figure}
+
+\begin{figure}
+  \centering
+  \input{idle-lat.tex}
+  \caption{Latency per request, with varying numbers of idle
+    connections.}
+  \label{fig:idle-lat}
+\end{figure}
+
+For a more realistic workload, we open a varying number of connections
+that we keep idle, then measure the performance of a series requests
+using 64 concurrently active clients.  Figures~\ref{fig:idle-rps}
+and~\ref{fig:idle-lat} illustrate the effects on throughput and
+latency of the \texttt{pong} microbenchmark of varying the number of
+idle clients.  For good measure, we measured the performance of both
+the \texttt{epoll} and \texttt{poll} back ends to the new event
+manager.  The original and \texttt{epoll} managers demonstrate
+comparable performance up to the 1,024 limit that \texttt{select} can
+handle, but while \texttt{poll} is erratic and disastrous, the
+performance of the \texttt{epoll} back end does not begin to fall off
+significantly until we have 50,000 idle connections open.
+
 
 \subsection{Performance of timeout management}
 \label{sec:perf:timeout}
 library.  Our current focus is on integrating it into the~GHC source
 tree and runtime system, so that it is available to all applications.
 
+\subsection{Lower overhead}
+
+We were a little surprised that \texttt{epoll} is consistently
+slightly slower than \texttt{select}.  We posit that part of the
+reason for this might be that we currently issue two
+\texttt{epoll\_ctl} system calls per event notification: one to queue
+it with the kernel, and one to dequeue it.  In contrast, the
+original~I/O manager has no added system call overhead.  If we used
+\texttt{epoll} in edge-triggered mode, we could eliminate the need to
+call \texttt{epoll\_ctl} to dequeue an event. 
+
+As a side note, the~BSD \texttt{kqueue} mechanism is cleaner than
+\texttt{epoll} in this one respect, combining queueing, dequeueing,
+and checking for multiple events into a single system call.  However,
+the smaller number of trips across the user/kernel address space
+boundary does not appear to result in better performance, and the
+\texttt{kqueue} mechanism is otherwise more cluttered and difficult to
+use than \texttt{epoll}.
+
 \subsection{Windows support}
 
 The Windows operating system presents a difficulty to our current

new-dead-pong.dat

 4096 18012.857 18030.010 17757.100 18229.750 3.553 3.550 3.511 3.604
 8192 17643.977 17555.530 17313.230 18036.050 3.628 3.646 3.548 3.697
 16384 17003.081 17068.430 16611.490 17279.900 3.765 3.750 3.704 3.853
+24576 16560.514 16585.370 16193.620 16818.600 3.865 3.859 3.805 3.952
+32768 17002.770 17020.350 16633.070 17375.500 3.765 3.760 3.683 3.848
+40960 13991.253 14147.690 13082.500 14485.220 4.580 4.524 4.418 4.892
+49152 12222.181 12155.530 11995.470 12572.810 5.238 5.265 5.090 5.335

old-dead-pong.dat

 128 18423.589 18452.910 18267.410 18673.960 3.474 3.468 3.427 3.504
 256 18418.947 18365.950 18321.330 18574.210 3.475 3.485 3.446 3.493
 512 18426.776 18392.500 18333.320 18562.070 3.473 3.480 3.448 3.491
-920 17888.959 17868.820 17814.100 18104.300 3.578 3.582 3.535 3.593
+900 18213.920 18210.460 17993.480 18469.060 3.514 3.514 3.465 3.557
+940 18127.727 18165.900 17917.680 18331.170 3.531 3.523 3.491 3.572

old-pong-server.dat

 64 18513.643 18514.420 18470.180 18565.770 3.457 3.457 3.447 3.465
 128 18417.129 18439.340 18351.780 18492.460 6.950 6.942 6.922 6.975
 256 17796.474 17849.890 17612.560 18016.490 14.386 14.342 14.209 14.535
-512 20315.569 22936.060 16663.280 23111.590 25.853 22.323 22.153 30.726
+512 17854.823 17057.740 16318.430 23271.080 29.045 30.016 22.002 31.376
 1016 16457.051 15933.390 14969.250 21065.890 62.439 63.765 48.230 67.872

poll-dead-pong.dat

+1 16289.511 16097.460 14461.610 18090.940 3.951 3.976 3.538 4.426
+2 16376.801 16555.000 14739.650 17929.820 3.926 3.866 3.569 4.342
+4 16473.856 16844.940 13826.060 17401.960 3.906 3.799 3.678 4.629
+8 15898.026 15959.880 14567.750 17481.940 4.043 4.010 3.661 4.393
+16 15963.906 15891.610 14350.350 17490.380 4.028 4.027 3.659 4.460
+32 15742.143 16226.680 13384.260 16674.450 4.086 3.944 3.838 4.782
+64 14923.309 15353.270 13353.770 15539.390 4.300 4.168 4.119 4.793
+128 13009.184 13036.500 11081.930 14198.760 4.946 4.909 4.507 5.775
+256 12251.150 12672.390 10849.520 13064.120 5.245 5.050 4.899 5.899
+512 11585.793 11798.950 10195.250 12489.180 5.543 5.424 5.124 6.277
+1024 9329.607 9360.880 8806.800 9716.010 6.866 6.837 6.587 7.267
+2048 4713.131 4618.450 4236.060 5211.580 13.638 13.857 12.280 15.108
+4096 1545.604 1511.130 1068.860 1951.550 42.712 42.352 32.794 59.877
+8192 581.354 575.750 524.380 705.580 111.006 111.158 90.705 122.049
+16384 430.534 394.070 301.970 713.150 158.853 162.408 89.743 211.938