RouteScript optimizer: smarter tips after #96
Suggest protect customers only where IP customers would get unhappy (under 95% served): it costs a second routing pass, about +65% on a big network. Point at the exchange the network actually peers at, where you have no port yet, instead of the city's main IX. And the draft admits it has never been paged at 3 a.m.
This commit is contained in:
parent
1858098a4d
commit
1473fb0627
4 changed files with 12 additions and 6 deletions
|
|
@ -2435,8 +2435,8 @@
|
||||||
"+{n} more customer":"+{n} altro cliente",
|
"+{n} more customer":"+{n} altro cliente",
|
||||||
"+{n} more customers":"+{n} altri clienti",
|
"+{n} more customers":"+{n} altri clienti",
|
||||||
"line {n}: prepend 1 to 3 times":"riga {n}: prepend da 1 a 3 volte",
|
"line {n}: prepend 1 to 3 times":"riga {n}: prepend da 1 a 3 volte",
|
||||||
"# Suggested by the optimizer from live traffic. Check it, then deploy.":"# Suggerito dall’ottimizzatore in base al traffico reale. Controllalo, poi fai il deploy.",
|
|
||||||
"# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.":"# {net}: {g} via transit, ma fa peering a {ix} a {city}, dove hai un POP. Prendi una porta lì.",
|
"# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.":"# {net}: {g} via transit, ma fa peering a {ix} a {city}, dove hai un POP. Prendi una porta lì.",
|
||||||
"# {net}: {g} over the IX. A PNI would take it off the shared port.":"# {net}: {g} via IX. Un PNI lo toglierebbe dalla porta condivisa.",
|
"# {net}: {g} over the IX. A PNI would take it off the shared port.":"# {net}: {g} via IX. Un PNI lo toglierebbe dalla porta condivisa.",
|
||||||
"Optimize":"Ottimizza",
|
"Optimize":"Ottimizza",
|
||||||
|
"# Suggested by the optimizer from live traffic. It has never been paged at 3 a.m., so check it, then deploy.":"# Suggerito dall’ottimizzatore dal traffico in tempo reale. Non è mai stato svegliato alle 3 di notte, quindi controllalo e poi fai il deploy.",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2435,8 +2435,8 @@
|
||||||
"+{n} more customer":"+{n} cliente a mais",
|
"+{n} more customer":"+{n} cliente a mais",
|
||||||
"+{n} more customers":"+{n} clientes a mais",
|
"+{n} more customers":"+{n} clientes a mais",
|
||||||
"line {n}: prepend 1 to 3 times":"linha {n}: prepend de 1 a 3 vezes",
|
"line {n}: prepend 1 to 3 times":"linha {n}: prepend de 1 a 3 vezes",
|
||||||
"# Suggested by the optimizer from live traffic. Check it, then deploy.":"# Sugerido pelo otimizador a partir do tráfego ao vivo. Confira e depois faça o deploy.",
|
|
||||||
"# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.":"# {net}: {g} via transit, mas faz peering no {ix} em {city}, onde você tem um POP. Pegue uma porta lá.",
|
"# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.":"# {net}: {g} via transit, mas faz peering no {ix} em {city}, onde você tem um POP. Pegue uma porta lá.",
|
||||||
"# {net}: {g} over the IX. A PNI would take it off the shared port.":"# {net}: {g} via IX. Um PNI tiraria isso da porta compartilhada.",
|
"# {net}: {g} over the IX. A PNI would take it off the shared port.":"# {net}: {g} via IX. Um PNI tiraria isso da porta compartilhada.",
|
||||||
"Optimize":"Otimizar",
|
"Optimize":"Otimizar",
|
||||||
|
"# Suggested by the optimizer from live traffic. It has never been paged at 3 a.m., so check it, then deploy.":"# Sugerido pelo otimizador a partir do tráfego ao vivo. Ele nunca foi acionado às 3 da manhã, então confira e depois faça o deploy.",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1730,13 +1730,15 @@ function teParse(src){const out={spill:null,cap:{},net:{},up:{},prep:{},protect:
|
||||||
return out;}
|
return out;}
|
||||||
// Share of an upstream's traffic that moves away for each prepend: prepending is a hint, not an order.
|
// Share of an upstream's traffic that moves away for each prepend: prepending is a hint, not an order.
|
||||||
const PREPEND_F=[0,0.35,0.6,0.75];
|
const PREPEND_F=[0,0.35,0.6,0.75];
|
||||||
function teOptimize(){const L=[tr('# Suggested by the optimizer from live traffic. Check it, then deploy.'),'spill at 85%'];
|
function teOptimize(){const L=[tr('# Suggested by the optimizer from live traffic. It has never been paged at 3 a.m., so check it, then deploy.'),'spill at 85%'];
|
||||||
if(S.biz.some(b=>!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber))L.push('protect customers');
|
// Protecting customers costs a second routing pass: only worth it where IP customers would get unhappy (under 95% served).
|
||||||
|
if(S.biz.some(b=>!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&!BIZ_T[b.type].event&&sfOf(R,b.city)<0.95))L.push('protect customers');
|
||||||
const ups=[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*regionMult(t.city)))})).sort((a,b)=>a.p-b.p);
|
const ups=[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*regionMult(t.city)))})).sort((a,b)=>a.p-b.p);
|
||||||
if(ups.length>1){L.push('prefer transit '+NET[ups[0].n].name.toLowerCase());L.push('avoid transit '+NET[ups[ups.length-1].n].name.toLowerCase());}
|
if(ups.length>1){L.push('prefer transit '+NET[ups[0].n].name.toLowerCase());L.push('avoid transit '+NET[ups[ups.length-1].n].name.toLowerCase());}
|
||||||
const tips=[];
|
const tips=[];
|
||||||
for(const n of NETS){const g=(R.netEg[n.id]||{}).t||0;if(g<1)continue;const at=Object.keys(S.pops).find(c=>S.ixp[c]===undefined&&ixStatic(c).some(x=>ixMembers(x).includes(n.id)));
|
for(const n of NETS){const g=(R.netEg[n.id]||{}).t||0;if(g<1)continue;// The exchange where it is a member and you have no port yet, in a city where you have a POP.
|
||||||
if(at)tips.push([g,tr('# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.',{net:n.name,g:fmtG(g),ix:ixName(at),city:CITY[at].name})]);}
|
let at=null;for(const c of Object.keys(S.pops)){at=ixIdsIn(c).find(x=>S.ixp[x]===undefined&&ixMembers(x).includes(n.id));if(at)break;}
|
||||||
|
if(at)tips.push([g,tr('# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.',{net:n.name,g:fmtG(g),ix:ixName(at),city:CITY[ixCity(at)].name})]);}
|
||||||
for(const n of NETS){const g=(R.netEg[n.id]||{}).ix||0;if(g>=50&&!S.pni.some(p=>p.net===n.id))tips.push([g,tr('# {net}: {g} over the IX. A PNI would take it off the shared port.',{net:n.name,g:fmtG(g)})]);}
|
for(const n of NETS){const g=(R.netEg[n.id]||{}).ix||0;if(g>=50&&!S.pni.some(p=>p.net===n.id))tips.push([g,tr('# {net}: {g} over the IX. A PNI would take it off the shared port.',{net:n.name,g:fmtG(g)})]);}
|
||||||
tips.sort((a,b)=>b[0]-a[0]).slice(0,5).forEach(x=>L.push(x[1]));
|
tips.sort((a,b)=>b[0]-a[0]).slice(0,5).forEach(x=>L.push(x[1]));
|
||||||
return L.join('\n');}
|
return L.join('\n');}
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,10 @@ test('RouteScript BGP: local-pref and prepending move transit, protected custome
|
||||||
assert.match(draft, /prefer transit cogentle/);
|
assert.match(draft, /prefer transit cogentle/);
|
||||||
assert.match(draft, /peers at DE-KICKS/);
|
assert.match(draft, /peers at DE-KICKS/);
|
||||||
assert.equal(ev('teParse(teOptimize()).errors.length'), 0, 'the draft is a valid script');
|
assert.equal(ev('teParse(teOptimize()).errors.length'), 0, 'the draft is a valid script');
|
||||||
|
// With room to spare, protecting customers would only cost a second routing pass, so it is not suggested.
|
||||||
|
ev("S.pops.fra.bb.d=5;S.te.script='';compute()");
|
||||||
|
assert.ok(ev("sfOf(R,'fra')") >= 0.95);
|
||||||
|
assert.doesNotMatch(ev('teOptimize()'), /protect customers/);
|
||||||
ev("S.te.script='';ACT.teEdit();ACT.teOpt()");
|
ev("S.te.script='';ACT.teEdit();ACT.teOpt()");
|
||||||
assert.match(ev("document.getElementById('teSrc').value"), /Suggested by the optimizer/);
|
assert.match(ev("document.getElementById('teSrc').value"), /Suggested by the optimizer/);
|
||||||
assert.deepEqual(errors, []);
|
assert.deepEqual(errors, []);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue