数据库压测问题

来源:7-3 交易验证优化后jmeter压测验证

慕UI3035061

2020-07-14

这节引入了交易验证优化
但是我测试的时候jmeter并发线程数200的时候数据库直接锁超时了,所有配置和都老师一样,该怎么么解决那?

| 4053FF | LOCK WAIT | 2020-07-14 18:30:48 | 4053FF:0:341:3 | 2020-07-14 18:30:48 | 2 | 18 | update item_stock
set stock = stock-1
where item_id = 8 and stock>=1 | starting index read | 1 | 1 | 2 | 376 | 1 | 0 | 0 | REPEATABLE READ | 1 | 1 | NULL | 0 | 10000 |

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: update item_stock set stock = stock-? where item_id = ? and stock>=?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

; ]; Lock wait timeout exceeded; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction]

写回答

1回答

龙虾三少

2020-07-14

那就是性能有瓶颈

0
2
龙虾三少
回复
慕UI3035061
可以用分裤分表 解决数据库行锁
2020-07-21
共2条回复

聚焦Java性能优化 打造亿级流量秒杀系统(赠秒杀项目)

理解高流量电商网站性能构建思路 用高逼格技术解决性能提升问题

2174 学习 · 1009 问题

查看课程