Sunday, March 22, 2020

FTP test network throughput

ftp> put "|dd if=/dev/zero bs=64k count=100000" /dev/null
200 PORT command successful.
150 Opening data connection for /dev/null.
100000+0 records in.
100000+0 records out.
226 Transfer complete.
6553600000 bytes sent in 170.2 seconds (3.761e+04 Kbytes/s)
local: |dd if=/dev/zero bs=64k count=100000 remote: /dev/null

Monday, March 9, 2020

10g NIC Tuning Up on Linux

# Maximum receive socket buffer size
net.core.rmem_max = 134217728

# Maximum send socket buffer size
net.core.wmem_max = 134217728

# Minimum, initial and max TCP Receive buffer size in Bytes
net.ipv4.tcp_rmem = 4096 87380 134217728

# Minimum, initial and max buffer space allocated
net.ipv4.tcp_wmem = 4096 65536 134217728

# Maximum number of packets queued on the input side
net.core.netdev_max_backlog = 300000

# Auto tuning
net.ipv4.tcp_moderate_rcvbuf =1

# Don't cache ssthresh from previous connection
net.ipv4.tcp_no_metrics_save = 1

# The Hamilton TCP (HighSpeed-TCP) algorithm is a packet loss based congestion control and is more aggressive pushing up to max bandwidth (total BDP) and favors hosts with lower TTL / VARTTL.
net.ipv4.tcp_congestion_control=htcp

# If you are using jumbo frames set this to avoid MTU black holes.
net.ipv4.tcp_mtu_probing = 1


udevadm info --query=path --path=/sys/class/net/ens8f0
ens8f0

Friday, March 6, 2020

Jenkins, BitBucket and Pipeline

https://bitbucket.goweekend.ca/scm/devo/jenkins_pipeline.git

# ps -ef|grep jenkins
jenkins   5483     1  0 Feb10 ?        01:31:33 /var/lib/jenkins/jre/bin/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -Djavax.net.ssl.trustStore=/var/lib/jenkins/.keystore/cacerts -Djavax.net.ssl.trustStorePassword=changeit -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 --httpsKeyStore=/var/lib/jenkins/jre/lib/security/castore --httpsKeyStorePassword=changeit -Dhudson.model.DirectoryBrowserSupport.CSP=


Running in /opt/build/weekend
[Pipeline] {
[Pipeline] pwd
[Pipeline] echo
Workspace dir is /opt/build/weekend
[Pipeline] checkout
using credential Jenkins
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://bitbucket.goweekend.ca/scm/weekend/weekend.git # timeout=10
Pruning obsolete local branches
Fetching upstream changes from https://bitbucket.goweekend.ca/scm/weekend/weekend.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Jenkins Builder
Setting http proxy: proxy.goweekend.ca:8888
 > git fetch --tags --progress https://bitbucket.goweekend.ca/scm/weekend/weekend.git +refs/heads/*:refs/remotes/origin/* --prune
 > git rev-parse origin/develop^{commit} # timeout=10
Checking out Revision y9c2d5162964b694f7472ccc81685705bcdccae4 (origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f y9c2d5162964b694f7472ccc81685705bcdccae4
Commit message: "Merge pull request #140 in weekend/weekend from feature/GAP-1160 to develop"
 > git rev-list --no-walk 86fa7e2023616b1813cd63e4be7e01912c082bfe # timeout=10


git rev-parse is an ancillary plumbing command primarily used for manipulation.

One common usage of git rev-parse is to print the SHA1 hashes given a revision specifier. In addition, it has various options to format this output such as --short for printing a shorter unique SHA1.

There are other use cases as well (in scripts and other tools built on top of git) that I've used for:

--verify to verify that the specified object is a valid git object.
--git-dir for displaying the abs/relative path of the the .git directory.
Checking if you're currently within a repository using --is-inside-git-dir or within a work-tree using --is-inside-work-tree
Checking if the repo is a bare using --is-bare-repository
Printing SHA1 hashes of branches (--branches), tags (--tags) and the refs can also be filtered based on the remote (using --remote)
--parse-opt to normalize arguments in a script (kind of similar to getopt) and print an output string that can be used with eval
Massage just implies that it is possible to convert the info from one form into another i.e. a transformation command. These are some quick examples I can think of:

a branch or tag name into the commit's SHA1 it is pointing to so that it can be passed to a plumbing command which only accepts SHA1 values for the commit.
a revision range A..B for git log or git diff into the equivalent arguments for the underlying plumbing command as B ^A


https://sysadmin@bitbucket.goweekend.ca/scm/weekend/weekend.git



 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://bitbucket.goweekend.ca/scm/weekend/weekend.git # timeout=10
Pruning obsolete local branches
Fetching upstream changes from https://bitbucket.goweekend.ca/scm/weekend/weekend.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Jenkins Builder
Setting http proxy: proxy.goweekend.ca:8888
 > git fetch --tags --progress https://bitbucket.goweekend.ca/scm/weekend/weekend.git +refs/heads/*:refs/remotes/origin/* --prune
 > git rev-parse origin/develop^{commit} # timeout=10
Checking out Revision b9c2d5162964b694f7472ccc81685705bcdccae4 (origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f b9c2d5162964b694f7472ccc81685705bcdccae4
Commit message: "Merge pull request #140 in weekend/weekend from feature/GAP-1160 to develop"
 > git rev-list --no-walk 96fa7e2023616b1813cd63e4be7e01912c082bfe # timeout=10
[Pipeline] step


git init

git config remote.origin.url  https://bitbucket.goweekend.ca/scm/iu/ithelpdesk.git

git fetch --tags --progress https://bitbucket.goweekend.ca/scm/iu/ithelpdesk.git +refs/heads/*:refs/remotes/origin/* --prune
git rev-parse origin/master^{commit}
git checkout -f 4feb053f9696122de7215969b4c3d1a3f67f7f44

Thursday, March 5, 2020

Java: Dump heap and thread

./jmap -dump:format=b,file=/var/tmp/heap_dump.hprof 13005

./jstack -l 13005 > /var/tmp/thread_dump.txt