最近的测试,需要使用4.x及以上版本的Linux内核,而服务器上的CentOS 7.9还停留在3.x时代。因此,有必要升级下内核版本。本文总结了通过源码安装Linux内核的全过程。
网络性能Benchmark——Netperf
Netperf是惠普公司开发的一个网络性能Benchmark。
Currently, its focus is on bulk data transfer and request/response performance using either TCP or UDP, and the Berkeley Sockets interface.
Netperf is a benchmark that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional throughput, and end-to-end latency.
在Linux中存活下来之hash命令
hash是一个Shell内置命令。
1 | $ help hash |
If no arguments are given, information about remembered commands is displayed.
-l list
The -l option causes output to be displayed in a format that may be reused as input.
-p put
If the -p option is supplied, PATHNAME is used as the full pathname of NAME, and no path search is performed.
-t get
If the -t option is supplied the full pathname to which each NAME corresponds is printed.
If multiple NAME arguments are supplied with -t, the NAME is printed before the hashed full pathname.
-d delete
The -d option causes the shell to forget the remembered location of each NAME.
-r clear
The -r option causes the shell to forget all remembered locations.
Linux内存管理工具
查看内存信息
free
1 | hegongshan@hgs:~/Desktop$ free |
$$
\begin{aligned}
used
&= total - free - buffers - cache \\
&= 2028064 - 290904 - 969296 \\
&= 767864
\end{aligned}
$$
实际上,free的结果也是从/proc/meminfo中解析得到的。
/proc/meminfo
1 | hegongshan@hgs:~/Desktop$ cat /proc/meminfo |
free | /proc/meminfo | 值 |
---|---|---|
Mem total | MemTotal | 2028064 kB |
Mem free | MemFree | 290904 kB |
shared | Shmem | 8424 kB |
buff/cache | Buffers + (Cached + SReclaimable) = 50356 + (865900 + 53040) | 969296 kB |
available | MemAvailable | 1102548 kB |
Swap total | SwapTotal | 459260 kB |
Swap free | SwapFree | 457968 kB |