Pipeline | Pipeline io_uring | Non-pipelined | Non-pipelined io_uring | |
---|---|---|---|---|
CPU | 99 | 50 (-50%) | 97 | 48 (-50%) |
RPS | 2,592,670 | 2,878,222 (+11%) | 497,429 | 631,976 (+26%) |
Working set | 79 | 81 | 79 | 81 |
Latency (mean) | 1.28 | 0.98 | 1.07 | 1.47 |
Latency (99th) | n/a | 7.57 | 14.8 | 14.67 |
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
Mix.install([ | |
{:benchee, "~> 1.2"} | |
]) | |
# ------------------------------------------------------------------------------ | |
# Original code | |
# ------------------------------------------------------------------------------ | |
defmodule Original do | |
# Masking is done @mask_size bits at a time until there is less than that number of bits left. |
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
defmodule Client do | |
def main(pid) do | |
cmd = IO.gets("Enter a command: ") |> String.trim() | |
case String.split(cmd) do | |
["show"] -> | |
key = self() | |
Task.async(fn -> | |
send(pid, {:list, key, self()}) |
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
use lunatic::net::{TcpListener, TcpStream}; | |
use lunatic::process::{self, Process}; | |
use lunatic::Mailbox; | |
use std::io::{BufRead, BufReader, Write}; | |
use std::net::SocketAddr; | |
#[derive(serde::Serialize, serde::Deserialize)] | |
struct Request { | |
from: Process<String>, | |
data: String, |
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
#!/usr/bin/env python3 | |
import atexit | |
import json | |
import requests | |
import subprocess | |
import sys | |
namespace = sys.argv[1] | |
proxy_process = subprocess.Popen(['kubectl', 'proxy']) | |
atexit.register(proxy_process.kill) |
This tutorial demonstrates how to create a Pod and manually schedule it to a node using cURL. This guide assumes you don't have a scheduler running in your Kubernetes cluster.
The following pod will run version 1.10.0 of nginx with a 100m CPU limit.
Create the nginx pod manifest and name it pod.json
: