Skip to content

Instantly share code, notes, and snippets.

View platinumthinker's full-sized avatar
🌐
Waiting

PlatinumThinker platinumthinker

🌐
Waiting
View GitHub Profile
Общая статистика:
```
sudo perf stat -g -- ./dgemm
40002.711133 cpu-clock (msec) # 4.000 CPUs utilized
430,879 context-switches # 0.011 M/sec
3,104 cpu-migrations # 0.078 K/sec
9,119 page-faults # 0.228 K/sec
59,508,881,346 cycles # 1.488 GHz
43,869,839,589 instructions # 0.74 insn per cycle <-- Менее 1 при полной загрузке всех ядер!!
@platinumthinker
platinumthinker / latency.markdown
Created May 30, 2017 17:52 — forked from mjt0704/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

Threads 1000 Msgs/sec Miss L1 % Miss LLC % BMiss IPC
4000 350 6.7 54 0.38 1.34
2000 400 6.3 49 0.44 1.39
1000 400 6.4 31 0.35 1.51
500 450 6.6 14 0.34 1.64
200 490 6.2 10 0.40 1.72
100 510 7.5 6.6 0.5 1.70
32 510 7.3 7 0.5 1.70
8 550 6.5 6.2 0.5 1.70
id CPU Family CPU (cpu x core x thread) RAM Res shell Res
elbrus Elbrus 4C 1891ВМ8Я 800 MHz 4x4x1 DDR3 1600 12910 28710
boris Yorkfield Core 2 Quad Q8300 2.5GHz 1x4x1 DDR3 1333 105420 221796
alpha Ivy Bridge i5-3570K 3.40GHz 1x4x1 DDR3 1600 (2 channels) 172413 410515
anton Sandy Bridge E i7-3820 3.60GHz 1x4x2 DDR3 1600 (4 сhannels) 185185 459399
thinker Haswell i5-4590 3.30GHz 1x4x1 DDR3 1600 (2 channels) 357143 653885
ibm Haswell i3-4160 3.60GHz 1x2x2 ???? 357142
rabbit Kaby Lake i3-7100 3.90GHz 1x2x2 DDR4 2133 (2 channels) 476190 830651
@platinumthinker
platinumthinker / dd.md
Last active July 19, 2017 06:58
Linix disk perfomance

Run in console:

dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync oflag=dsync
Disk SATA Gb/s Speed with oflag Mb/s Speep without oflag Mb/s
Intel SSD 540S 1.5 43.4 106
Intel SSD 530 ( SSDSC2BW12 ) 1.5 41 310
@platinumthinker
platinumthinker / kuber.md
Last active August 17, 2017 06:05
kubernates

Autorize from k8s pod:

export KUBE_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
curl -sSk -H "Authorization: Bearer $KUBE_TOKEN" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/$POD_NAMESPACE/

Connect to docker in minikube from host:

eval $(minikube docker-env)
[Unit]
Description=CAPWAP Datapath element
[Service]
ExecStart=/usr/local/bin/capwap-dp -c /etc/ergw-capwap-node/capwap-dp.conf
ExecStartPost=/bin/ip link set tap0 up
ExecStartPost=/bin/ip addr add 192.168.85.1/24 dev tap0
Restart=always
Type=simple
;User=thinker
@platinumthinker
platinumthinker / __recipe.md
Last active April 29, 2024 07:56
Cassandra backup/restore

Backup:

  1. Create snapshot:

> nodetool snapshot thingsboard (or you cat set you namespace) Requested creating snapshot(s) for [all keyspaces] with snapshot name [1522059918232] and options {skipFlush=false} Snapshot directory: 1522059918232

  1. Copy snapshot on another directory:
#!/usr/bin/env escript
-include_lib("kernel/include/inet.hrl").
-include_lib("kernel/include/inet_sctp.hrl").
main([Protocol, IP, Port, Len, Cnt]) ->
bench(list_to_atom(Protocol), inet:parse_address(IP),
list_to_integer(Port), list_to_integer(Len), list_to_integer(Cnt));
main(_) ->
io:format("invalid arguments~n~n"),
@platinumthinker
platinumthinker / sctp_exporter.py
Created February 19, 2019 12:35
Simple sctp prometheus info exporter
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import socketserver
import http.server
from http import HTTPStatus
regex = re.compile(r"^(\S+)\s*(\S+)$")
class Handler(http.server.SimpleHTTPRequestHandler):