Skip to content
Snippets Groups Projects
Commit 2b35e29f authored by Peter Cai's avatar Peter Cai
Browse files

Initial for section 5

parent 02b81562
No related branches found
No related tags found
No related merge requests found
markers = {
"default": ".",
"kernel_polling": "+",
"manual_polling": "x",
"irq_packing": "*",
"irq_on_ht": "D",
"fstack": "s",
"caladan": "p",
"caladan (per-thread QPS w/ 2 threads)": "p"
"vanilla": ".",
"kernel polling (patched)": "+",
"kernel polling (configuration)": "x",
"irq packing": "*",
}
colors = {
"default": "tab:blue",
"kernel_polling": "tab:orange",
"manual_polling": "tab:purple",
"irq_packing": "tab:olive",
"irq_on_ht": "pink",
"fstack": "tab:green",
"caladan": "tab:red",
"caladan (per-thread QPS w/ 2 threads)": "tab:red"
"vanilla": "tab:blue",
"kernel polling (patched)": "tab:orange",
"kernel polling (configuration)": "tab:purple",
"irq packing": "tab:red",
}
import os
import matplotlib.pyplot as plt
from config import markers, colors
import util
experiments = [f for f in os.listdir('../data')
if f.startswith('memcached_qps_scan') and len(os.listdir(os.path.join('../data', f))) > 0]
def parse_memcached_output(s):
lines = s.split('\n')
qps = int(float(lines[6].split(' ')[3]))
......@@ -32,60 +27,10 @@ def extract_qps_latency_exp(exp):
return ret
def extract_qps_latency(threads, include_caladan = False):
def extract_qps_latency(experiments):
ret = dict()
for exp in experiments:
split = exp.split('.')
if split[-2] != ('t' + str(threads)):
continue
if split[-3] == 'caladan' and not include_caladan:
continue
name = split[-3]
if name[0].isdigit():
name = 'default'
ret[name] = extract_qps_latency_exp(exp)
ret[exp] = extract_qps_latency_exp(exp)
return ret
def show_plot(threads, include_caladan = False):
plt.cla()
if include_caladan:
plt.title('Memcached QPS vs Latency (99th percentile), %d threads, with Caladan' % (threads,))
else:
plt.title('Memcached QPS vs Latency (99th percentile), %d threads' % (threads,))
data = extract_qps_latency(threads, include_caladan)
if include_caladan and threads == 1:
# Because we cannot run caladan on 1 threads, we use the t2 data
# but we half the QPS
name = 'caladan (per-thread QPS w/ 2 threads)'
data[name] = extract_qps_latency_exp('memcached_qps_scan.5.4.0-136-generic.caladan.t2.c160')
data[name] = ([qps / 2 for qps in data[name][0]], data[name][1], data[name][2])
for k in data:
plt.errorbar(data[k][0], data[k][1], yerr = data[k][2], capsize = 4, label = k, marker = markers[k], color = colors[k])
plt.xlabel('QPS')
plt.ylabel('Latency (99th percentile)')
plt.yscale('log')
plt.xlim(xmin = 0)
plt.legend()
if os.getenv('SAVE_FIGURE') != 'true':
plt.rcParams.update({'font.size': 16})
plt.show()
else:
if include_caladan:
plt.savefig('../data/figs/memcached_qps_scan.t%d.caladan.png' % (threads,), dpi = 192)
else:
plt.savefig('../data/figs/memcached_qps_scan.t%d.png' % (threads,), dpi = 192)
show_plot(1)
show_plot(1, True)
show_plot(8)
show_plot(8, True)
import matplotlib.pyplot as plt
from config import markers, colors
from memcached_qps_scan import extract_qps_latency
import os
experiments = [
"memcached_qps_scan.5.15.79-peter.t8.c20", # vanilla
"memcached_qps_scan.5.15.79-peter.irq_packing.t8.c20", # irq packing
"memcached_qps_scan.5.13.0-48-generic.manual_polling.t8.c20", # manual polling
"memcached_qps_scan.5.15.79-peter.kernel_polling.t8.c20", # kernel polling
]
names = [
"vanilla",
"irq packing",
"kernel polling (configuration)",
"kernel polling (patched)",
]
def show_plot():
plt.cla()
plt.title('Memcached QPS vs Latency (99th percentile), 8 cores')
data = extract_qps_latency(experiments)
for i in range(len(experiments)):
k = experiments[i]
display_name = names[i]
plt.errorbar(data[k][0], data[k][1], yerr = data[k][2], capsize = 4, label = display_name, marker = markers[display_name], color = colors[display_name])
plt.xlabel('QPS')
plt.ylabel('Latency (99th percentile)')
plt.yscale('log')
plt.xlim(xmin = 0)
plt.legend()
if os.getenv('SAVE_FIGURE') != 'true':
plt.rcParams.update({'font.size': 16})
plt.show()
else:
plt.savefig('../data/figs/memcached_qps_scan_uma.png', dpi = 192)
show_plot()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment