rds

MySQL数据库调优经验

匿名 (未验证) 提交于 2019-12-02 22:02:20
?RDS for MySQL 由亚洲唯一WebScaleSQL团队维护内核源码,结合阿里巴巴多年MySQL数据库调优经验,从数据库源码层及数据库参数进行了性能优化,在相近规格配置下,RDS for MySQL性能值能达到自建数据库性能的3倍以上。 RDS for MySQL针对通用的场景,在内核做了一系列的优化: 1、 改进了InnoDB redo组提交功能,多线程并发写入的情况下能有10%以上的速度提升。 2、 优化锁,对一些会引起串行化的大锁进行了拆分,能够有效避免长时间的读锁等待,提升数据读取效率。 3、 log buffer拆分,使用多组log buffer交替工作,将buffer写入file的过程异步化,提升数据写入速度。 4、 优化了只读事务的执行过程,应对读多写少的使用场景,能有100%的吞吐能力提升。 5、 主备同步效率优化,主备实例间采用改进后的同步复制机制,提升20% 以上的数据同步效率 6、 另外还针对特定的行业场景,进行了深度定制:比如电商行业进行了秒杀场景的优化,应对高并发数据更新;金融行业提供了Double Binlog保护,大数据量的场景提供了TokuDB引擎压缩和IO优化。? 3层安全防护体系,为您抵御90%以上的网络攻击 DDOS防护:在网络入口实时监测,当发现超大流量攻击时,对源IP进行清洗,清洗无效情况下可以直接拉进黑洞。 IP白名单配置

AWS rds - How to read from a read replica inside of a Java application?

你说的曾经没有我的故事 提交于 2019-12-02 08:51:03
问题 I am new to aws. I have a mysql rds instance and I just created 2 read replicas. My application is written in Java, and what I have done up until now is using the JDBC I have connected to the one aws instance, but now how do I distribute the work around the 3 servers? 回答1: You can set up an internal Elastic Load Balancer to round robin requests to the slaves. Then configure two connections in your code: one that points directly to the master for writes and one that points to the ELB endpoint

MySQL Syntax error when locally importing dump from Amazon MySQL RDS?

跟風遠走 提交于 2019-12-02 06:06:32
When I create a database dump from Amazon RDS and then I try to import it locally, the result is ERROR 1064 (42000) at line 54 . At line 54 there is the following statement: CREATE TABLE account_emailconfirmation ( The command used for dump is: mysqldump -u user -h host.rds.amazonaws.com -p --default-character-set=utf8 --result-file=sync.sql database_name The command used for import is: mysql --user=root -p mpl -vv < sync.sql And here is the output (verbosity increased). -------------- CREATE TABLE `account_emailconfirmation` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` datetime(6) NOT

Stopping an RDS instance via CLI

感情迁移 提交于 2019-12-02 05:20:36
I am trying to use one of AWS's latest features where it allows you to stop an RDS instance. I followed this doc where it explains that I need to run the command: aws rds stop-db-instance --db-instance-identifier mydbinstance however, when I do that I get this: usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument operation: Invalid choice, valid choices are: add-role-to-db-cluster | add-source-identifier-to-subscription add-tags-to-resource | apply-pending

阿里云RDS数据库备份同步到自建库方法(SHELL脚本)

假如想象 提交于 2019-12-01 16:07:46
一、背景: 由于阿里云RDS生产库每天都需要备份且拷贝到自建读库,而如果使用阿里云的自动拷贝到只读实例, 费用太高, 故采用自编写同步脚本方法实现。 二、前提: 1). 已开通阿里云RDS, 且开启定期备份功能。(备份功能生成备份文件供下载) 2). 已在备份的目标服务器上安装mysql数据库。 3). 备份目标服务器已安装数据恢复工具Percona XtraBackup,您可以从Percona XtraBackup官网下载安装。 MySQL 5.6及之前的版本需要安装 Percona XtraBackup 2.3,安装指导请参见官方文档 Percona XtraBackup 2.3 。 MySQL 5.7版本需要安装 Percona XtraBackup 2.4,安装指导请参见官方文档 Percona XtraBackup 2.4 。 MySQL 8.0版本需要安装 Percona XtraBackup 8.0,安装指导请参见官方文档 Percona XtraBackup 8.0 。 三、脚本编写和测试 1. 编写SHELL脚本 #!/usr/bin/env bash #########数据库基础信息############# #输入参数 URL_PATH=$1 #定义时间格式 DATE=`date +%Y%m%d%H%M%S` #日志记录文件地址 LOG_PATH=/data

PostgreSQL RDS avoid hard coding the connection password when using dblink_connect()

烈酒焚心 提交于 2019-12-01 04:48:34
问题 I have an AWS RDS instance of PostgreSQL in which I need to execute an SQL statement within a function using dblink_connect(text) and dblink_exec(text) while logged in with the postgres role (that I created). CREATE OR REPLACE FUNCTION application.create_tenant_schemas(first integer, last integer) RETURNS void AS DECLARE tenant VARCHAR; sql VARCHAR; BEGIN FOR index IN first..last LOOP tenant := 'tenant_' || to_char(index, 'FM00000'); sql := 'CREATE SCHEMA ' || quote_ident(tenant); RAISE

一目了然 | 数据库实例性能调优利器:Performance Insights

一个人想着一个人 提交于 2019-11-30 18:41:57
Performance Insights是什么 阿里云RDS Performance Insights是RDS CloudDBA产品一项专注于用户数据库实例性能调优、负载监控和关联分析的利器,以简单直观的方式帮助用户迅速评估数据库负载,资源等待的源头和对应SQL查询语句,以此来指导用户在何时、何处、采取何种行动进行数据性能优化。 几个名词解释 Performance Insights:中文翻译过来叫性能洞察。 Active Session (AS):RDS数据库系统中,活跃的会话数量。 Average Active Session (AAS):一段时间内,RDS数据库中平均活跃会话数量。 Max Vcores:RDS数据库实例最大可以使用到的CPU Cores数量。 AAS和MaxVcores来量化系统瓶颈 在文章开始,我们希望能够把一个非常重要的问题解释清楚:为什么可以使用AAS (平均活跃会话数)与RDS数据库实例MaxVcores量化对比来作为系统瓶颈的判断依据?我们的理由是: 首先,RDS数据库系统中,我们认为最为重要的资源是CPU资源,因为其他所有资源都需要CPU来调度。 其次,CPU的并发处理能力,与CPU Cores的数量相关。假设在相当小的一个时间切片上,CPU对活跃会话(AS)处理能力瓶颈就是CPU Cores数量。即

pg_dump: how to install on Amazon Linux for PostgreSQL 9.5.2?

懵懂的女人 提交于 2019-11-30 14:20:02
I used to install and do: $ sudo yum install -y postgresql94-server postgresql94 $ pg_dump -h name-of-db.us-east-1.rds.amazonaws.com -U user dbName > dump After RDS upgrade to 9.5.2 I get this: pg_dump: server version: 9.5.2; pg_dump version: 9.4.5 pg_dump: aborting because of server version mismatch I can't find a proper package for Amazon Linux This didn't help me: http://tecadmin.net/install-postgresql-9-5-on-centos/ Can you? Amir Mehler Ok, found it. (1) Install the repo: $ sudo rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-ami201503-95-9.5-3.noarch

Contour 学习笔记(一):使用 Contour 接管 Kubernetes 的南北流量

有些话、适合烂在心里 提交于 2019-11-28 23:47:37
原文链接: Contour 学习笔记(一):使用 Contour 接管 Kubernetes 的南北流量 在 Kubernetes 中运行大规模以 Web 为中心的工作负载,最关键的需求之一就是在 L7 层实现高效流畅的入口流量管理。自从第一批 Kubernetes Ingress Controller 开发完成以来, Envoy (由 Matt Klein 和 Lyft 团队开发)已经成为云原生生态系统中的新生力量。Envoy 之所以受到支持,因为它是一个 CNCF 托管的项目,与整个容器圈和云原生架构有着天然的支持。 容器公司 Heptio 开源的项目 Contour 使用 Envoy 作为 Kubernetes 的 Ingress Controller 实现,为大家提供了一条新的 Kubernetes 外部负载均衡实现思路。 据 官方博客 介绍, Heptio Contour 可以为用户提供以下好处: 一种简单的安装机制来快速部署和集成 Envoy。 与 Kubernetes 对象模型的集成。 Ingress 配置的动态更新,而无需重启底层负载均衡器。 项目成熟后,将允许使用 Envoy 一些强大的功能,如熔断器、插件式的处理器链,以及可观测性和可调试性,可以非常方便地对接监控系统。 IngressRoute 之间可以级联,用来做蓝绿部署非常方便。 下面我们就来试用一下。 1