https://igor.io/latency/ footnotes of https://igor.io/latency/
This file contains hidden or 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
| if [[ $(spotifycli --status) ]]; then | |
| SONG=$(spotifycli --song) | |
| SPOTIFY_WINDOWD_ID=$(wmctrl -l | grep -i "$SONG" | head -1 | awk '{ print $1 }') | |
| echo "<img>/home/yzdann/.scripts/spotify.png</img><click>wmctrl -i -a $SPOTIFY_WINDOWD_ID</click>" | |
| else | |
| echo "<img>/home/yzdann/.scripts/spotify-gray.png</img><click>spotify %U</click>" | |
| fi |
This file contains hidden or 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
| SPOTIFY_WINDOWD_ID=$(wmctrl -l | grep -i "spotify free" | head -1 | awk '{ print $1 }') | |
| if [[ "$SPOTIFY_WINDOWD_ID" ]]; then | |
| wmctrl -i -a "$SPOTIFY_WINDOWD_ID" | |
| else | |
| spotify %U | |
| fi |
This file contains hidden or 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
| WG="wgx" | |
| WG_UP=$(ip -o link show | awk -F': ' '{print $2}'| grep $WG) | |
| if [[ "$WG_UP" ]]; then | |
| echo "<img>/home/yzdann/.scripts/wg26.png</img><click>konsole -e wg-quick down $WG</click>" | |
| else | |
| echo "<img>/home/yzdann/.scripts/wg26-gray.png</img><click>konsole -e wg-quick up $WG</click>" | |
| fi | |
| # genmon bash /home/yzdann/.scripts/wg.sh |
This file contains hidden or 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
| TMUX_WINDOW_ID=$(wmctrl -l | grep -i tmux | grep -i konsole | awk "/$rx/"'{print $1}' | head -1 ) | |
| TMUX_CURRENT_FIRST_SESSION=$(tmux list-session | cut -d':' -f1 | head -1) | |
| echo $TMUX_WINDOW_ID | |
| # activate the window terminal with tmux if existed | |
| if [[ ! -z "$TMUX_WINDOW_ID" ]]; then | |
| wmctrl -i -a $TMUX_WINDOW_ID | |
| else | |
| # attach to current session |
This file contains hidden or 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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or 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
| If one of the servers needs to be temporarily removed from the load‑balancing rotation, it can be marked with the down | |
| server backend3.example.com down; | |
| With this configuration of weights, out of every 6 requests, 5 are sent to backend1.example.com and 1 to backend2.example.com. | |
| server backend1.example.com weight=5; | |
| server backend2.example.com; | |
| location /resources { |
mv /etc/haproxy/haproxy.cfg{,.original}
NewerOlder