摘要: 目录Momory Ordering9.2.3.2 Neither Loads Nor Stores Are Reordered9.2.3.3 Stores Are Not Reordered With Earlier Loads9.2.3.4 Loads May Be Reordered with 阅读全文
posted @ 2024-05-19 23:25 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 前提:多台压测服务器时间同步 xdate="$(date +%F) 16:05:00";sleep $(( $(date -d "$xdate" +%s) - $(date +%s) )) && echo "666" 如果希望测试命令执行一段时间之后自动结束,再命令前加timeout: xdate= 阅读全文
posted @ 2024-05-17 23:32 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 目录TCP 连接限制配置(压测客户端和服务器)问题1:压测3w个请求(长连接),caps 1000,有一半的请求超时优化 配置网卡中断分配到多个cpuwireshark 查看rtt查看系统每秒收到的TCP请求数附:服务器网络参数配置 linux内核优化(百万级别长连接,并发测试指南) 百看不如一练, 阅读全文
posted @ 2024-05-17 09:57 LiYanbin 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 对于数据读取和发送的,水平触发和边缘触发的区别: 参考:彻底搞懂epoll的LT模式和ET模式 关于数据的读比较好理解,无论是LT模式还是ET模式,监听到读事件从socket开始读数据就好了,只不过读的逻辑有些差异,LT模式下,读事件触发后,可以按需收取想要的字节数,不用把本次接收到的数据收取干净, 阅读全文
posted @ 2024-05-14 10:38 LiYanbin 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 系统配置: 多网口情况下,假设各个网口ip在同一网段;此时,由于默认路由规则,从不同网口的ip访问,服务器依旧会返回默认网口的mac地址,配置方式如下: sysctl -w net.ipv4.ip_forward=1 # 开启ip转发规则 net.ipv4.conf.X.rp_filter = 0 阅读全文
posted @ 2024-05-13 21:32 LiYanbin 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 参考:云网络丢包故障定位全景指南 ip -s ip -s link show eth0 while true; do sleep 1s; date +"%F %T"; ip -s link show eth0; sleep 1; done 阅读全文
posted @ 2024-05-13 21:25 LiYanbin 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 停止docker服务 1、停止自定义的监控如果有,比如: systemctl stop check_docker_service.service 2、停止所有容器 docker stop $(docker ps -aq) 3、停止系统服务 systemctl stop docker.socket d 阅读全文
posted @ 2024-05-13 21:21 LiYanbin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: aliyun os centos 9 docker-ce install sudo wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sud 阅读全文
posted @ 2024-05-13 21:13 LiYanbin 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 目录Mysql命令登录命令在命令行直接执行命令查看表数据/修改表数据/清空数据查看表结构/增加列/删除列/删除表wireshark 抓mysql的报文Redis命令登录并执行命令/查看数据批量删除数据sqlite命令 Mysql命令 登录命令 mysql -uroot -p'root' -h127. 阅读全文
posted @ 2024-05-13 21:09 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 客户端与服务器建立tcp连接后,在服务器上执行ss -im dst 目标IP地址来检查skmem rb值: tcp ESTAB 0 0 192.168.99.124:ssh 192.168.99.86:48270 skmem:(r0,rb369280,t0,tb87040,f0,w0,o0,bl0, 阅读全文
posted @ 2024-05-13 17:44 LiYanbin 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 一台主机上只能保持最多 65535 个 TCP 连接吗? - 文礼的回答 - 知乎 https://www.zhihu.com/question/361111920/answer/1199952447 Q: 两个确定的ip地址.一个端口只能对应一个端口.怎么能64k*64k连接.明显只有64k链接吧 阅读全文
posted @ 2024-05-13 10:59 LiYanbin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 摘自:使用strace命令跟踪系统调用 strace -tt -T -v -f -e trace=file -o /data/log/strace.log -s 1024 -p 23489 -c 统计每一系统调用的所执行的时间,次数和出错的次数等. -d 输出strace关于标准错误的调试信息. - 阅读全文
posted @ 2024-05-12 20:03 LiYanbin 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 【1】查看包信息 how to get package info for same lib on centos $rpm -qf /usr/lib64/libmicrohttpd.so.10 libmicrohttpd-0.9.33-2.el7.x86_64 $rpm -qi libmicrohtt 阅读全文
posted @ 2024-05-12 20:02 LiYanbin 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 应用打开的文件描述符: lsof -p pid 应用消息队列状态: ipcs -qp | awk '/3193/{print "ipcs -qp -i "$1}' | bash 阅读全文
posted @ 2024-05-12 19:58 LiYanbin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 目录观察应用CPU、内存使用情况实时打印(一般用于观察变化)打印应用占用CPU大于阈值的线程观察系统cpu、内存使用最多的应用一般方式其他方式 观察应用CPU、内存使用情况 实时打印(一般用于观察变化) $xpid=$(pidof gdb);top -p $xpid -b -d 1 | awk '/ 阅读全文
posted @ 2024-05-12 19:56 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: sed 打印某两行之间的文件 sed -n '128754,128929p' xx-log-file sed 正则匹配提取文本 $ cat 1.txt port=888 $ sed -n 's/port=\(.*\)/\1/p' 1.txt # '\1'表示括号的匹配项 888 sed 替换 sed 阅读全文
posted @ 2024-05-12 19:44 LiYanbin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: windterm https://github.com/teaper/windterm-nord-theme https://windowsterminalthemes.dev/ 阅读全文
posted @ 2024-05-12 13:55 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 转载-https://m.weibo.cn/status/5031218725257887 这个讲解 ChatGPT 提示词技巧的视频值得一看,播主将常见的提示词技巧分成了10个级别,最后一级的 CO-STAR 框架,来源自新加坡政府科技局(GovTech)组织的首届 GPT-4 提示工程大赛冠军总 阅读全文
posted @ 2024-05-07 22:46 LiYanbin 阅读(54) 评论(0) 推荐(0) 编辑
摘要: perf on-cpu xpid=$(cat /var/run/xx.pid); perf record -F 99 -p $xpid --call-graph dwarf -- sleep 60 直接在控制台上查看:perf report 或者生成火焰图: perf script --header 阅读全文
posted @ 2024-05-07 22:04 LiYanbin 阅读(16) 评论(0) 推荐(0) 编辑
摘要: valgrind进行内存越界检查 valgrind --log-file='valgrind_report.log' --time-stamp=yes –track-origins=yes --tool=memcheck --leak-check=full --show-leak-kinds=all 阅读全文
posted @ 2024-05-07 21:49 LiYanbin 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 目录观察内存是否持续上涨案例:TDengine 3.0“内存泄露”实录案例:Linux内存泄露定位5:gdb+python篇案例:查找 Postgres C 代码中的内存泄漏mtrace (初步定位,如果代码没有对malloc free进一步封装, 那么可以直接得到内存未释放的位置,如果进行了封装, 阅读全文
posted @ 2024-05-07 10:17 LiYanbin 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 目录一、基本理论二、制作自签证书第一种第二种(使用不同参数) 一、基本理论 参考:理解HTTPS协议的交互过程-CSDN博客 前置条件: 服务器向正规CA机构 将自己的公钥 进行数字签名,制作出数字证书 交互流程: 主要流程1:服务端发送数字证书给客户端,证书内容包含服务器的公钥 主要流程2:客户端 阅读全文
posted @ 2024-04-13 11:46 LiYanbin 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 目录免密上传文件 mup免密下载文件 mxz免密登录服务器 mssh 免密上传文件 mup 利用shift支持多个文件 usage: mup file1 file2 ... 192.168.78.123 passwd(可选) ssh端口号(可选) mup() { local file=() loca 阅读全文
posted @ 2024-04-12 17:09 LiYanbin 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 目录基础特性this指针1) xobj->func() 实际是OBJ::func(xobj);2) 成员函数第一个参数默认都为指向对象的this指针,函数内部访问成员变量实际是this->xxx这样的形式return this与return *this:return *this - 若返回类型为A, 阅读全文
posted @ 2024-03-22 14:26 LiYanbin 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 按照线性回归的方法:梯度计算如下,那么需要求w1的偏导数(整个系统关于w1的偏导数)才能算: 怎么算:使用chain-rule来算: 上面的文章计算过程没有加入激活函数,《彻底弄懂,神经网络的误差反向传播算法 》这篇文章的计算过程是加入了的激活函数 点击查看原文 反向传播算法详解(手算详解传播过程) 阅读全文
posted @ 2024-03-20 22:21 LiYanbin 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 一个高并发项目开发到落地的心酸路 https://juejin.cn/post/7346021356679675967 https://mp.weixin.qq.com/s/Ou8h9YKblKl7ncf95grEvg 首先,我们没有去设计表,没有去设计接口,而是先去测试 测试: Mysql: 单节 阅读全文
posted @ 2024-03-18 13:40 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 同事对读写锁增加了一个支持嵌套的功能 原先的问题: 1、同一个线程已经获取到写锁,再去上一次写锁就会卡死; (重复上read lock不会有问题) 解决方式: 1、上写锁时保存当前代码流的thread-id,锁虽然会被多个线程拿,但是上写锁是唯一的,所以某一时刻只会被某个线程持有 2、当前线程代码流 阅读全文
posted @ 2024-03-15 17:50 LiYanbin 阅读(0) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2024.cnblogs.com/blog/2679005/202403/2679005-20240310164054083-1783859578.png) ![](https://img2024.cnblogs.com/blog/2679005/202403/2679005-20240310164040374-1035399508.png) 阅读全文
posted @ 2024-03-10 16:43 LiYanbin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 目录gdb 带参数gdb attachgdb 条件断点gdb 打印$pid进程所有线程的堆栈并退出gdb 打印内存数据gdb 设置调试中间变量gdb ctrl-c无法退出gdb 设置断点提示Function "xxx" not defined. TODO: [100-gdb-tips](https: 阅读全文
posted @ 2024-03-07 10:27 LiYanbin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: rpm_packaging_guide:Working with SPEC files:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/rpm_packaging_guide/i 阅读全文
posted @ 2024-02-02 10:20 LiYanbin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 目录HPC1 计算CPU频率HPC2 优化循环HPC3 使用SIMD指令 HPC1 计算CPU频率 文章 高性能计算(HPC)系列之二:深入基础软件开发第一篇 方法:执行时长/周期数 约等于 1/lscpu 查看到的频率 [1/2] 实验和实验结果 代码: main.c: view #include 阅读全文
posted @ 2024-01-15 21:04 LiYanbin 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 下载RDPwrap并安装 RDPwrap:https://github.com/stascorp/rdpwrap/releases 解压后执行install.bat,安装文件位于C:\Program Files\RDP Wrapper,成功后运行RDPConf.exe进行检查 FAQ: Servic 阅读全文
posted @ 2024-01-11 00:05 LiYanbin 阅读(316) 评论(0) 推荐(0) 编辑
摘要: docker-compose.yml version: "3" services: python-dev-env: image: python:3.6.15-slim-buster restart: always container_name: py3-dev-env network_mode: h 阅读全文
posted @ 2023-12-23 12:11 LiYanbin 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 需要在服务器安装一些工具,除了安装脚本还需要安装文件,可以打包成一个文件方便管理 示例: . ├── makefile └── pushgateway ├── gtw_install.sh └── pushgateway-1.4.3.linux-amd64.tar.gz makefile: PRJ_ 阅读全文
posted @ 2023-12-23 12:01 LiYanbin 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 目录gcc内嵌汇编查看汇编代码栈变量分配规则[gcc compiler]函数调用过程和参数传递 https://www.godbolt.org/ gcc内嵌汇编 byeyear: gcc内嵌汇编详解 查看汇编代码 disassemble a single function using objdump 阅读全文
posted @ 2023-11-19 17:18 LiYanbin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 测量函数执行时长: 查找函数符号 很多情况下,代码在执行时,其函数符号并不一定是代码中写的名称,因此我们可以使用以下脚本打印 出应用程序中在调用的函数符号 echo.stp probe process("/data0/app").function("*") { println(probefunc() 阅读全文
posted @ 2023-11-17 23:27 LiYanbin 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 摘自:SystemTap Beginners Guide Chapter 2. Using SystemTap This chapter instructs users how to install SystemTap, and provides an introduction on how to 阅读全文
posted @ 2023-11-13 22:58 LiYanbin 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 【A1】某一时间点开始执行某一命令 view xdate="$(date +%F) 16:05:00";sleep $(( $(date -d "$xdate" +%s) - $(date +%s) )) && echo "666" 【A2】日志分析 对于有日志分割 使用 tail -F view 阅读全文
posted @ 2023-10-16 22:17 LiYanbin 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 目录【01】服务器网卡性能配置、系统配置【02】测量两点之间的带宽 iperf【03】查看网卡流量 net_stat.sh(/proc/net/dev)【04】查看某IP流量 iftop【00】 查看服务器tcp连接数【05】NetworkManager 命令行网络配置工具 nmcli 【01】服务 阅读全文
posted @ 2023-10-16 19:27 LiYanbin 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 常见导致偶现崩溃原因(且堆栈位置非实际异常位置,不易排查): ※※※※※ 内存释放后又继续使用 (常见于多线程临界资源,或者单线程事件队列堆积(比如两个delete事件)) ※※※ 写越界 (常见于指针类型强转,数组写越界) ※※ 内存(链表未初始化) ※※ 使用memcpy拷贝链表 ※ 代码某业务 阅读全文
posted @ 2023-10-09 16:20 LiYanbin 阅读(11) 评论(0) 推荐(0) 编辑