This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Round-robin | Least Outstanding Requests | Performance Improvement | ||
---|---|---|---|---|
Median | 68.5 | 54.7 | 25.23% | |
P95 | 1062.4 | 217.2 | 389.13% | |
P99 | 2374 | 386.4 | 514.39% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
http.createServer((req, res) => { | |
if (req.method === 'POST') { | |
let now = Date.now(); | |
const finish = now + Math.random() * 200; | |
while (now < finish) { | |
now = Date.now(); | |
} | |
res.writeHead(200, { | |
'Content-Type': 'application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config: | |
target: "" | |
phases: | |
- duration: 120 | |
arrivalRate: 10 | |
scenarios: | |
- flow: | |
- loop: | |
- get: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface InboundMessage { | |
room: string; | |
id: string; | |
data: object; | |
version: number; | |
} | |
ws.on('message', (rawMsg: string) => { | |
const messages: InboundMessage[] = JSON.parse(rawMsg); | |
console.log(messages); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface MessageAction { | |
action: 'subscribe' | 'unsubscribe'; | |
message: { | |
// Which room to subscribe to or unsubscribe from | |
room: string; | |
// Whether to "dump" existing messages for this room | |
dump: boolean; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_metric_alarm" "alb_error_rate" { | |
alarm_name = "${aws_lb.main.name}-alb-error-rate" | |
comparison_operator = "GreaterThanOrEqualToThreshold" | |
evaluation_periods = 2 | |
threshold = 5 | |
alarm_description = "Load balancer error rate has exceeded 5%" | |
treat_missing_data = "notBreaching" | |
metric_query { | |
id = "error_rate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_route53_health_check" "latency" { | |
type = "CLOUDWATCH_METRIC" | |
cloudwatch_alarm_name = "${aws_cloudwatch_metric_alarm.latency.alarm_name}" | |
cloudwatch_alarm_region = "${var.region}" | |
insufficient_data_health_status = "Healthy" | |
tags = { | |
Name = "high-latency" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_route53_record" "latency-use1" { | |
zone_id = "${data.aws_route53_zone.my_zone.zone_id}" | |
name = "my-application" | |
type = "A" | |
set_identifier = "service-us-east-1" | |
alias { | |
zone_id = "${aws_lb.main_us_east_1.zone_id}" | |
name = "${aws_lb.main_us_east_1.dns_name}" | |
evaluate_target_health = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//sslstatic.wix.com/services/js-sdk/1.43.0/js/wix.min.js"></script> | |
<script> | |
!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push( | |
arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0]; | |
d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode. | |
insertBefore(d,q)}(window,document,'script','_gs'); | |
_gs('YOUR-SITE-TOKEN', false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ { from: '11.11.12.71:6381', to: '11.11.12.70:6380', slot: 6553 }, | |
{ from: '11.11.12.72:6381', to: '11.11.12.71:6381', slot: 9829 }, | |
{ from: '11.11.12.72:6381', to: '11.11.12.70:6381', slot: 10922 }, | |
{ from: '11.11.12.71:6380', to: '11.11.12.72:6381', slot: 16383 }, | |
{ from: '11.11.12.70:6381', to: '11.11.12.72:6381', slot: 13321 }, | |
{ from: '11.11.12.72:6381', to: '11.11.12.70:6381', slot: 10921 }, | |
{ from: '11.11.12.70:6381', to: '11.11.12.72:6381', slot: 13109 }, | |
{ from: '11.11.12.72:6381', to: '11.11.12.70:6381', slot: 10920 }, | |
{ from: '11.11.12.70:6381', to: '11.11.12.72:6381', slot: 13110 }, | |
{ from: '11.11.12.72:6381', to: '11.11.12.70:6381', slot: 10919 }, |
NewerOlder