因磁盘IO性能低导致程序An I/O error 报错

文章目录

环境

系统平台:UOS(鲲鹏)

版本:4.5.8

症状

1、程序出现如下报错:

复制代码
1、An I/O error occurred while sending to the backend
2、JDBC rollback;This connection has been closed.;nested exception is
com.highgo.jdbc.util.PSQLException:This connection has beenclosed.

问题原因

1、经过了解,程序查询一张2000万的表,只要操作的人多了就会出现相关报错;

2、数据库运行在机械盘上,vmstat对服务器磁盘进行监控输出信息如下:

vmstat监控,b列等待I/O的阻塞进程数过多,考虑机械盘升级固态。

解决方案

1、与客户讨论提供如下解决方案

方案1:2千万的表进行拆表。

方案2:升级磁盘硬件配置

方案3:读写分离(提升多大,是否满足需求,有待验证)

2、客户决定采用升级磁盘硬件解决

3、测试新升级磁盘正常

01、fio随机写

复制代码
fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/hgdata/testdir/fiotestfile -name=Rand_Write_Testing

02、fio随机读

复制代码
fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/hgdata/testdir/fiotestfile -name=Rand_read_Testing

03、dd测速8kb读写

复制代码
写测速:
time dd if=/dev/zero of=output1.file bs=8k count=128000 oflag=direct,nonblock
读测速:
time dd if=output1.file of=/dev/null bs=8k count=128000 iflag=direct,nonblock

04、dd小文件写(不满足20MB/s磁盘性能不达标)

复制代码
dd if=/dev/zero of=/hgdata/testio1 bs=32k count=20k oflag=dsync

05、dd大文件写(不满足200MB/s磁盘性能不达标)

复制代码
dd if=/dev/zero of=/hgdata/testio2 bs=8192k count=100 oflag=dsync
相关推荐
AIgorithmGEEK7 小时前
MySQL 索引全解(下):建、查、删实战与知识速查表
数据库·mysql·b+树·索引
m0_587383008 小时前
广州 24 小时自助健身房解决方案技术实现与实战指南
java·spring·小程序·架构·需求分析
·云扬·8 小时前
Prompt 工程与安全:从 System 设计到注入防御
java·人工智能·安全·ai·prompt
代码不停9 小时前
自动化测试(java)
java·开发语言·selenium·自动化
唠点键盘之外的10 小时前
26 向量数据库实战:从 0 搭一条能用的检索链路(pgvector + Spring AI)
数据库·人工智能·spring
云和恩墨10 小时前
数据库监控简史:监控不止于告警——从图表大爆发到健康管理闭环
数据库
ly768910 小时前
MongoDB 事务开销实测:快照隔离下的写冲突、重试与分片事务边界
数据库·mongodb·事务·分片集群·快照隔离·写冲突
豆角焖肉10 小时前
Spring AOP 自定义注解实现系统操作日志
数据库·自定义注解·springaop·操作日志·aop 切面
鬼手点金11 小时前
opencode-rules 插件
java·开发语言·前端·人工智能·chrome·git·github
金伟API102411 小时前
不会写复杂SQL怎么办?
数据库·sql