Amazon RDS MySQL实例执行速度非常慢

编程入门 行业动态 更新时间:2024-10-21 14:42:36
本文介绍了Amazon RDS MySQL实例执行速度非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在Amazon EC2(新加坡地区)上发布了我的网站,并且已经使用MySQL RDS实例进行数据存储.除了性能之外,一切都工作得很好.

I have published my website on Amazon EC2 (Singapore region) and I have used MySQL RDS instance for the data storage. Everything is working very fine except performance.

我似乎所有查询,尤其是select语句的执行速度都很慢.如果我在本地PC上检查了此问题,则说明它运行良好.但是,当我尝试从RDS实例获取数据时,它非常慢.一些select语句需要2-3秒来获取数据.

I seems that, my all queries, especially the select statement, is performing very slowly. If I check this issue on my local PC, there it is working very well. But when I am trying to get data from RDS instance, it is very slow. Some of the select statements takes 2-3 seconds to fetch data.

我已经正确地调优了所有表索引,并根据需要进行了归一化/反归一化.我已经在RDS自定义参数组上进行了所有必要的设置(例如 max_connection , buffer 等).我不知道我是否缺少某些东西,但是对我来说不起作用-性能没有提高.

I have properly tuned up all table indexes, and normalized/de-normalized as required. I have made all necessary settings on RDS custom parameter group (eg. max_connection, buffer etc). I don't know if I am missing something, but it didn't work for me - performance didn't increase.

那么,有人可以帮我解决这个问题吗?

So, can someone please help me with this issue?

推荐答案

值得注意的是,由于某种原因,RDS中MySQL查询缓存默认为OFF.我们本周亲自了解到了这一点.

It is worth noting that, for whatever reason, MySQL query cache is OFF by default in RDS. We learned that the hard way ourselves this week.

这不会帮助您提高初始查询的性能,但总体而言可能会加快速度.

This won't help performance of your initial query, but it may speed things up in general.

要重新启用查询缓存,请执行以下操作:

To re-enable query cache:

  • 登录到RDS控制台
  • 单击您的RDS实例以查看其详细信息
  • 编辑数据库参数组
  • 请确保同时设置 query_cache_size 和 query_cache_type
  • (免责声明:我不是DBA,所以这里可能还缺少其他内容)

    (Disclaimer: I am not a DBA so there may be additional things I'm missing here)

    更多推荐

    Amazon RDS MySQL实例执行速度非常慢

    本文发布于:2023-11-29 00:42:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1644608.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:实例   速度   Amazon   RDS   MySQL

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!