netty 写的异步tcp服务器,测试建立3000个tcp连接,每秒向服务器发送一次数据,服务器收到数据后解析,插入到mysql。 现在发现cpu的占用率过高,该如何优化? 是否需要添加redis缓存层,缓存数据库的数据,做队列然后插入? (ps: 查看mysql线程池发现很多mysql连接在sleep。 通过spring org.apache.commons.dbcp.BasicDataSource 配置的线程池 )
光阴似箭催人老,日月如移越少年。
If the data size of the written data does not exceed 10KB, use Redis MQ directly. Let it reduce concurrent requests to the database. If the data size is relatively large and the data volume is larger, use RabbitMQ.
If the data size of the written data does not exceed 10KB, use Redis MQ directly. Let it reduce concurrent requests to the database.
If the data size is relatively large and the data volume is larger, use RabbitMQ.