explicit_defaults_for_timestamp=off 时表结构

CREATE TABLE t (
x int(11) DEFAULT NULL,
y timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- y timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE

explicit_defaults_for_timestamp=on 时表结构

CREATE TABLE t6 (
x int(11) DEFAULT NULL,
y timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- y timestamp NULL DEFAULT NULL

https://projectlombok.org/features/all

val
Finally! Hassle-free final local variables.

var
Mutably! Hassle-free local variables.

@NonNull
or: How I learned to stop worrying and love the NullPointerException.

@Cleanup
Automatic resource management: Call your close() methods safely with no hassle.

@Getter/@Setter
Never write public int getFoo() {return foo;} again.

@ToString
No need to start a debugger to see your fields: Just let lombok generate a toString for you!

@EqualsAndHashCode
Equality made easy: Generates hashCode and equals implementations from the fields of your object..

@NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor
Constructors made to order: Generates constructors that take no arguments, one argument per final / non-nullfield, or one argument for every field.

@Data
All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!

@Value
Immutable classes made very easy.

@Builder
... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!

@SneakyThrows
To boldly throw checked exceptions where no one has thrown them before!

@Synchronized
synchronized done right: Don't expose your locks.

@With
Immutable 'setters' - methods that create a clone but with one changed field.

@Getter(lazy=true)
Laziness is a virtue!

@Log
Captain's Log, stardate 24435.7: "What was that line again?"

experimental
Head to the lab: The new stuff we're working on.

手动指定nginx 的 DNS服务和有效时间

Syntax: resolver address ... [valid=time] [ipv6=on|off] [status_zone=zone];
Default: —
Context: http, server, location

resolver 127.0.0.1 [::1]:5353 valid=30s;

Syntax: resolver_timeout time;
Default:
resolver_timeout 30s;
Context: http, server, location
Sets a timeout for name resolution, for example:

resolver_timeout 5s;

resolver 223.5.5.5 223.6.6.6 valid=30s;
resolver_timeout 5s;

server {
    listen 80;
    server_name xxx.xxx.net;

    resolver 223.5.5.5 223.6.6.6 valid=30s ipv6=off;
    resolver_timeout 5s;

    set $service_lb xxxxxx;

    location / {
        proxy_pass http://$service_lb;
    }
}

务必设置变量

set $company zdb.im;

location / {
    proxy_pass http://$company:81;
}

CentOS

yum install -y iperf

如果没有安装源则需要 手动下载安装 https://downloads.es.net/pub/iperf/

wget https://downloads.es.net/pub/iperf/iperf-3.8.1.tar.gz
tar xvf iperf-3.8.1.tar.gz
cd iperf-3.8.1
./configure
make
make install

注意, 不同大版本号, 命令名不同, 协议互不兼容, 必须使用相同的大版本号;

iperf -v
iperf version 2.0.13 (21 Jan 2019) pthreads

iperf3 -v
iperf 3.8 (cJSON 1.7.13)
Linux VM_0_5_centos 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, 
sendfile / zerocopy, socket pacing, authentication

有服务端和客户端, 需要交叉测试, 共两次, 以下是低版本 iperf2 的命令

服务端执行

iperf -s

客户端执行

iperf -c 服务端IP地址

测试结果: 带宽 105M 左右

[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec   127 MBytes   105 Mbits/sec

默认端口号, iperf2 使用 5001, iperf3 使用 5201, 如果被占用, 则增加命令行参数 "-c 具体服务端的端口号"