--EOF--
Recently in MySQL Category
在mysql 4.1中,无法设置是否启用自动重连机制,即默认总是会自动重连。
对于这个情况,我们的程序部署时可能需要注意(如果没有使用session变量等,问题还不是很大),但在某些情况下,因为字符集的问题,需要尽量避免mysql底层的自动重连,或者在配置中需要加上:
[mysqld] init_connect='SET NAMES utf8'
但这需要部署另外的mysql实例。
Google 后有相关资料:
http://blog.taragana.com/index.php/archive/how-to-enable-disable-auto-reconnect-in-mysql/
How to disable MySQL client auto reconnect
In view of the side-effects you may want to disable auto reconnect. In MySQL version 5.1 and above auto reconnect is disabled by default. In any version you can disable auto reconnect with the following PHP code:my_bool reconnect = 0;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
Mysql 4.1的手册中的相关说明:
17.7.13 . Controlling Automatic Reconnect Behavior
The MySQL client library can perform an automatic reconnect to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. In this case, the library tries once to reconnect to the server and send the statement again.
Some client programs might provide the capability of controlling automatic reconnection. For example, mysql reconnects by default, but the --skip-reconnect
option can be used to suppress this behavior.
Automatic reconnection can be convenient because you need not implement your own reconnect code, but if a reconnection does occur, several aspects of the connection state are reset and your application will not know about it. The connection-related state is affected as follows:
· Any active transactions are rolled back and autocommit mode is reset.
· All table locks are released.
· All TEMPORARY
tables are closed (and dropped).
· Session variables are reinitialized to the values of the corresponding variables. This also affects variables that are set implicitly by statements such as SET NAMES
.
· User variable settings are lost.
· Prepared statements are released.
· HANDLER
variables are closed.
· The value of LAST_INSERT_ID()
is reset to 0.
Locks acquired with GET_LOCK()
are released.
--EOF--
由于校验是在mysql4和mysql5之间,校验生成同一sql语句在mysql4和mysql5之间成生的校验码都不一样,原因:
MySQL 5.0 and later all retain trailing spaces in "VARCHAR", while previous versions would remove them.
mysql4 and pre ver 在保存一个后面有空格的值到varchar时会把后面的空格去掉,mysql5 会保存
--EOF--
年初进行后台DB版本升级:mysql 4.1.x -> mysql 5.0。有的机器是直接重新安装MySQL,然后按照dump的数据重做slave,再进行表数据校验(maatkit),一切正常。
后来服务逐渐迁移到新的MySQL5的版本后,升级原有的MySQL4.1的slave时,采取了偷懒的一种办法,直接覆盖安装MySQL,数据库文件不变,结果导致性能很差。
后跟进查原因,原来发现MySQL5.x之后的InnoDB默认行存储格式有了较大变化,下面列的就是相关资料了:
7.4.2. Make Your Data as Small as Possible
One of the most basic optimizations is to design your tables to take as little space on the disk as possible. This can result in huge improvements because disk reads are faster, and smaller tables normally require less main memory while their contents are being actively processed during query execution. Indexing also is a lesser resource burden if done on smaller columns.
MySQL supports many different storage engines (table types) and row formats. For each table, you can decide which storage and indexing method to use. Choosing the proper table format for your application may give you a big performance gain. See Chapter 13, Storage Engines.
You can get better performance for a table and minimize storage space by using the techniques listed here:
-
Use the most efficient (smallest) data types possible. MySQL has many specialized types that save disk space and memory. For example, use the smaller integer types if possible to get smaller tables.
MEDIUMINT
is often a better choice thanINT
because aMEDIUMINT
column uses 25% less space. -
Declare columns to be
NOT NULL
if possible. It makes everything faster and you save one bit per column. If you really needNULL
in your application, you should definitely use it. Just avoid having it on all columns by default. -
For
MyISAM
tables, if you do not have any variable-length columns (VARCHAR
,TEXT
, orBLOB
columns), a fixed-size row format is used. This is faster but unfortunately may waste some space. See Section 13.4.3, "MyISAM
Table Storage Formats". You can hint that you want to have fixed length rows even if you haveVARCHAR
columns with theCREATE TABLE
optionROW_FORMAT=FIXED
. -
InnoDB
tables use a compact storage format. In versions of MySQL earlier than 5.0.3,InnoDB
rows contain some redundant information, such as the number of columns and the length of each column, even for fixed-size columns. By default, tables are created in the compact format (ROW_FORMAT=COMPACT
). If you wish to downgrade to older versions of MySQL, you can request the old format withROW_FORMAT=REDUNDANT
.The presence of the compact row format decreases row storage space by about 20% at the cost of increasing CPU use for some operations. If your workload is a typical one that is limited by cache hit rates and disk speed it is likely to be faster. If it is a rare case that is limited by CPU speed, it might be slower.
The compact
InnoDB
format also changes howCHAR
columns containing UTF-8 data are stored. WithROW_FORMAT=REDUNDANT
, a UTF-8CHAR(
occupies 3 ×N
)N
bytes, given that the maximum length of a UTF-8 encoded character is three bytes. Many languages can be written primarily using single-byte UTF-8 characters, so a fixed storage length often wastes space. WithROW_FORMAT=COMPACT
format,InnoDB
allocates a variable amount of storage in the range fromN
to 3 ×N
bytes for these columns by stripping trailing spaces if necessary. The minimum storage length is kept asN
bytes to facilitate in-place updates in typical cases. -
The primary index of a table should be as short as possible. This makes identification of each row easy and efficient.
-
Create only the indexes that you really need. Indexes are good for retrieval but bad when you need to store data quickly. If you access a table mostly by searching on a combination of columns, create an index on them. The first part of the index should be the column most used. If you always use many columns when selecting from the table, you should use the column with more duplicates first to obtain better compression of the index.
-
If it is very likely that a string column has a unique prefix on the first number of characters, it's better to index only this prefix, using MySQL's support for creating an index on the leftmost part of the column (see Section 12.1.7, "
CREATE INDEX
Syntax"). Shorter indexes are faster, not only because they require less disk space, but because they also give you more hits in the index cache, and thus fewer disk seeks. See Section 7.5.2, "Tuning Server Parameters". -
In some circumstances, it can be beneficial to split into two a table that is scanned very often. This is especially true if it is a dynamic-format table and it is possible to use a smaller static format table that can be used to find the relevant rows when scanning the table.
7.4.2. 使你的数据尽可能小
最基本的优化之一是使表在磁盘上占据的空间尽可能小。这能给出巨大的改进,因为磁盘读入较快,并且在查询执行过程中小表的内容被处理时占用较少的主存储器。如果在更小的列上做索引,索引也占据较少的资源。
MySQL支持许多不同的存储引擎(表类型)和行格式。对于每个表,可以确定使用哪个存储引擎和索引方法。为应用程序选择合适的表格式可以大大提高性能。参见第15章:存储引擎和表类型。
可以使用下面的技术可以使表的性能更好并且使存储空间最小:
- 尽可能地使用最有效(最小)的数据类型。MySQL有很多节省磁盘空间和内存的专业化类型。
- 尽可能使用较小的整数类型使表更小。例如,MEDIUMINT经常比INT好一些,因为MEDIUMINT列使用的空间要少25%。
- 如果可能,声明列为NOT NULL。它使任何事情更快而且每列可以节省一位。注意如果在应用程序中确实需要NULL,应该毫无疑问使用它,只是避免 默认地在所有列上有它。
- 对于MyISAM表,如果没有任何变长列(VARCHAR、TEXT或BLOB列),使用固定尺寸的记录格式。这比较快但是不幸地可能会浪费一些空间。参见15.1.3节,"MyISAM表的存储格式"。即使你已经用CREATE选项让VARCHAR列ROW_FORMAT=fixed,也可以提示想使用固定长度的行。
- 在MySQL/InnoDB中,InnoDB表使用更紧凑的存储格式。在以前版本的MySQL中,InnoDB记录包含一些冗余信息,例如列数目和每个列的长度,即使对于固定大小的列。默认情况,创建的表为紧凑格式(ROW_FORMAT=COMPACT)。如果想要降级旧版本的MySQL/InnoDB,可以用ROW_FORMAT=REDUNDANT要求旧的格式。
- 紧凑的InnoDB格式也改变了包含UTF-8数据的CHAR列的保存方式。在ROW_FORMAT=REDUNDANT格式中,UTF-8 CHAR(n)占用3*n字节,假定UTF-8编码的字符的最大长度是3字节。许多语言可以主要用单字节UTF-8字符来编写,固定的存储长度通常会浪费空间。通过根据需要剥离尾部的空格,ROW_FORMAT=COMPACT格式为这些列分配可变数量的n..3*n字节。最小存储长度按顺序保存为n字节,以在典型情况下帮助更新。
- 每张表的主索引应该尽可能短。这使一行的识别容易而有效。
- 只创建你确实需要的索引。索引对检索有好处,但是当你需要快速存储东西时就变得糟糕。如果主要通过搜索列的组合来存取一个表,对它们做一个索引。第一个索引部分应该是最常用的列。如果从表中选择时总是使用许多列,应该首先以更多的副本使用列以获得更好的索引压缩。
- 如果很可能一个索引在头几个字符上有唯一的前缀,仅仅索引该前缀比较好。MySQL支持对一个字符列的最左边部分创建一个索引(参见13.1.4节,"CREATE INDEX语法")。更短的索引会更快,不仅因为它们占较少的磁盘空间,而且因为它们将在索引缓存中提供更多的访问,因此磁盘搜索更少。参见7.5.2节,"调节服务器参数"。
· 在一些情形下,将一个经常被扫描的表分割为2个表是有益的。特别是如果它是一个动态格式的表,并且可能使用一个扫描表时能用来找出相关行的较小静态格式的表。
The physical record structure for InnoDB tables is dependent on the row format specified when the table was created. For MySQL 5.1, by default InnoDB uses the COMPACT
format, but the REDUNDANT
format is available to retain compatibility with older versions of MySQL.
Records in InnoDB ROW_FORMAT=REDUNDANT
tables have the following characteristics:
-
Each index record contains a six-byte header. The header is used to link together consecutive records, and also in row-level locking.
-
Records in the clustered index contain fields for all user-defined columns. In addition, there is a six-byte field for the transaction ID and a seven-byte field for the roll pointer.
-
If no primary key was defined for a table, each clustered index record also contains a six-byte row ID field.
-
Each secondary index record contains also all the fields defined for the clustered index key.
-
A record contains also a pointer to each field of the record. If the total length of the fields in a record is less than 128 bytes, the pointer is one byte; otherwise, two bytes. The array of these pointers is called the record directory. The area where these pointers point is called the data part of the record.
-
Internally, InnoDB stores fixed-length character columns such as
CHAR(10)
in a fixed-length format. InnoDB truncates trailing spaces fromVARCHAR
columns. -
An SQL
NULL
value reserves 1 or 2 bytes in the record directory. Besides that, an SQLNULL
value reserves zero bytes in the data part of the record if stored in a variable length column. In a fixed-length column, it reserves the fixed length of the column in the data part of the record. The motivation behind reserving the fixed space forNULL
values is that it enables an update of the column fromNULL
to a non-NULL
value to be done in place without causing fragmentation of the index page.
Records in InnoDB ROW_FORMAT=COMPACT
tables have the following characteristics:
-
Each index record contains a five-byte header that may be preceded by a variable-length header. The header is used to link together consecutive records, and also in row-level locking.
-
The record header contains a bit vector for indicating
NULL
columns. The bit vector occupies (n_nullable
+7)/8 bytes. Columns that areNULL
will not occupy other space than the bit in this vector. -
For each non-
NULL
variable-length field, the record header contains the length of the column in one or two bytes. Two bytes will only be needed if part of the column is stored externally or the maximum length exceeds 255 bytes and the actual length exceeds 127 bytes. -
The record header is followed by the data contents of the columns. Columns that are
NULL
are omitted. -
Records in the clustered index contain fields for all user-defined columns. In addition, there is a six-byte field for the transaction ID and a seven-byte field for the roll pointer.
-
If no primary key was defined for a table, each clustered index record also contains a six-byte row ID field.
-
Each secondary index record contains also all the fields defined for the clustered index key.
-
Internally, InnoDB stores fixed-length, fixed-width character columns such as
CHAR(10)
in a fixed-length format. InnoDB truncates trailing spaces fromVARCHAR
columns. -
Internally, InnoDB attempts to store UTF-8
CHAR(
columns inn
)n
bytes by trimming trailing spaces. InROW_FORMAT=REDUNDANT
, such columns occupy 3*n
bytes. The motivation behind reserving the minimum spacen
is that it in many cases enables an update of the column to be done in place without causing fragmentation of the index page.
The presence of the compact row format decreases row storage space by about 20% at the cost of increasing CPU use for some operations. If your workload is a typical one that is limited by cache hit rates and disk speed it is likely to be faster. If it is a rare case that is limited by CPU speed, it might be slower.
--EOF--
上周日,一台服务器无故停止服务,不能ssh,只能重启后恢复服务,对业务影响很大。
今天,一台DB服务器再次服务SSH,ping不通,最后也只能重启解决。
重启服务器后,MySQL自动拉起,服务程序自动拉起,出现的一个不清楚的问题:
InnoDB在重启后进行bin log的恢复过程中,应用程序的连接请求被挂起,一直等到恢复完成,ready for connections后client才真正连接上,等待连接的这段时间发生了什么呢?有意思,接下来会抽空查查!
--EOF--
去年曾经协助同事做过一个Oracle的测试,虽然后来还是由于成本原因必须继续使用MySQL,但是当时进行一些测试的时候有个想法,就是使用Oracle的Standbye,同时也希望复制一份到MySQL,供前端应用实时读!
现在有了:
Tungsten Replicator 可以支持!
准备闲了就试试了!
--EOF--
Tips:
1)注意InnoDB总是一个事务引擎,如果你在自动提交模式,则每个语句都会作为一个事物提交:每次对数据库有改变的提交都会导致InnoDB刷新日志到磁盘。
当然,这个地方要看 innodb_flush_log_at_trx_commit 选项的设置:
参考:
http://dev.mysql.com/doc/refman/5.1/en/innodb-tuning.html innodb性能调节提示
http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#option_mysqld_innodb_flush_log_at_trx_commit
2)尽量将多个update语句放在一个事务中提交,但是也不能设置事务过大,原因:过大时如果回滚,会造成很大的磁盘开销
http://dev.mysql.com/doc/refman/5.1/en/innodb-tuning.html 这里说明:
InnoDB在插入中使用插入缓冲来节约磁盘I/O,但是在相应的回滚中没有使用这样的机制。一个磁盘绑定的回滚可以用相应插入花费时间的30倍来执行。
杀掉数据库进程没有是帮助的,因为回滚在服务器启动时会再次启动。除掉一个失控的回滚的唯一方法是增大缓冲池使得回滚变成CPU绑定且跑得快或者使用专用步骤。
http://marksverbiage.blogspot.com/2008/04/improve-reliability-and-maintainability.html
这里有个极端:用无状态的连接来保证可靠性,用MySQL API层就可以提供自动重连机制。
如果用无状态的连接,那连接相关的:事务,临时表,session变量就得慎用!
那如何可以继续使用事务呢?
自动提交事务:并且将每个事务用单条语句提交,或者用存储过程。
3)不用用表锁 -- 这个是为表级别锁的存储引擎设计工作的
4)主键
尽可能使用主键查找数据;
实际中遇到的问题:之前在一个应用的Master上有3个表,我们所有的UPDATE和INSERT都是使用PK来进行的,由于以前还部署了一些查询的应用,有很多联合索引,后来
迁移到SLAVE后,我们认为这些索引会占据更多的数据空间,而且现在也不会继续用到,因此在Master上删除了所有这些"无用"的索引,因为我们每个UPDATE操作都会直接使用PK,
这些索引本来应该是无用的?可导致的结果竟然是平均UPDATE操作由之前的100ms增长到180ms左右,WHY?
前天,另外一件事情,我们在某个表增加了一些联合索引后,表空间竟然变的更小了!
参考:
http://www.innodb.com/innodb/info/
http://www.innodb.com/wp/wp-content/uploads/2007/05/uc2007-innodb-performance-optimization.pdf
InnoDB Performance Optimization
InnoDB can perform extremely well or be your performance nightmare if you do not tune it right. This talk is about InnoDB performance optimization, covering a wide range of topics from Server Settings optimization, to InnoDB specific query optimization, including hardware configuration and OS tuning tricks. This presentation was delivered at the 2007 MySQL User Conference by Peter Zaitsev of Percona, Ltd. and Heikki Tuuri. You will find this and other presentations and articles about MySQL and InnoDB performance on the MySQL Performance Blog.
--EOF--
Record every Referral for Flickr Realtime
可以看到大师强烈推荐使用整型ID作为主键和索引。
从实际应用的情况中,之前曾有过一次使用28byte的字符串做主键的例子,只有200w数据的时候,竟然比一个700w数据的有更多列但使用整形主键的表慢很多,特别是进行批量操作时,很多时候更是有SQL执行超过1分钟,导致系统抖动非常厉害。
Start over
• Converted the URL into a 64-bit ID
• CONV(SUBSTR(MD5(Url),0,16),16,10)
• ==
• 64-bit number
• For added protection its unique for the
owner
• Reduced Primary key size to 8 bytes +
owner, object, object-type
INNODB & Strings
• Indexing a string takes a lot of space
• Indexing a large string takes even more
space
• Each index has its own 16KB page.
• Fragmentation across pages was hurting
the app - chewing up I/O
• That's a lot of disk space chewed up per
day
INNODB & High Concurrency of
String Writes
• Requirement: 300 ms for total db access
FOR ALL Apps
• Writes when the datafile(s) are greater
then the buffer_size slow down at high
concurrency
• 10 ms to 20 seconds sometimes for the
full transaction
• Noticed replication keeping up
--EOF--
http://blog.arabx.com.au/?p=1053
The 20 second summary from the Scaling MySQL - Up or Out? from our panel of experts at 2008 MySQL Conference and Expo.
* Paul Tuckfield from YouTube -- The answers to everything is replication, you just have to rephrase the question.
* Jeff Rothschild from Facebook -- Memory, the source of all problems is your developers.
* Domas for Wikipedia -- You should be afraid that 10 min structural change may answer detailed problems.
* Fahan Mashraqi from Fotolog -- Architect property, the most optimized schema may not be enough, what is the cost of serving the data, no just the time to run the SQL.
* John Allspaw from Flickr -- There is nothing more permanent then a temporary solution
matt Sun Performance tuning/Scaling increases is key
* Monty Taylor from MySQL -- You have to know what's happening on every piece of your technology stack.
http://www.paragon-cs.com/wordpress/?p=144
Scaling MySQL - - Up or Out? Panel @ UC
April 16th, 2008 | Category: MySQL
I would recommend that you download the video of this!! Sheeri posted it here.
The numbers in parentheses are Alexa rankings.
Moderator - Kaj Arno
(1317) Monty Taylor - MySQL
(905) Matt Ingenthron - Sun
(39) John Allspaw - Flickr
(13) Frank mash - Fotolog
(9) Domas Mituzas - Wikipedia
(6) Jeff Rothschild - Facebook
(2) Paul Tuckfield - YouTube
Question One: Number of MySQL servers
MySQL one master/three slaves
Sun four servers
Flickr 166
Fotolog 37
Wikipedia
Facebook 1,800 (900m/900s)
YouTube
Question Two: Number of MySQL DBAs
MySQL 1/10th
Sun 1.5
Flickr 0 (normally 1)
Fotolog 1
Wikipedia Technical Team
Facebook 2
YouTube 3
Question Three: Number of Web Servers
MySQL 2
Sun 160
Flickr 244
Fotolog 70
Wikipedia
Facebook 10,000
YouTube
Question Four: Number of Memcached servers
MySQL 2
Sun 8
Flickr 14
Fotolog 40
Wikipedia 79
Facebook 805
YouTube
Question Five: Version of MySQL
MySQL 5.23-2rc
Sun 5.0.21
Flickr 5.0.51
Fotolog 4.11
Wikipedia 4.4
Facebook 5.0.44
YouTube 5.0.24
Question Six: Operating System on Server
MySQL Fedora
Sun OpenSolaris
Flickr Linux
Fotolog Solaris 10
Wikipedia Fedora/Ubuntu
Facebook Fedora/RHEL
YouTube SuSE 9
Question Seven: What happens if a server fails?
Flickr - Federated setup for failover. Can loose any one side of the shard.
Wikipedia - if a master fails they replace with slave
Facebook - archive binlogs, promote slave
Fotolog - mount snapshots?
Youtube - SAN; shards with a master and multiple slaves so they promote slaves
Question Eight: What is Their Crucial Scaling Technology
Facebook doesn't use SAN - they do use RAID 10 with 2.5″ drives
Fotolog -- UltraSparc T1 -- excellent master UltraSparc T2 -- excellent slave -- uses SAN
This was interesting to me. Frank (Fotolog) said they use a SAN to keep things manageable (only two dbas with the second one just hired). Facebook says they don't use SAN because they didn't want to limit themselves.
Next they got off on discussion about power. This varied quite a bit with YouTube pretty much dismissing power concerns. Of course Frank from Fotolog then pointed out that when they (Fotolog) want to expand in a datacenter -- the datacenter has to get Google's approval...hmmm..no wonder Google isn't worried about it. Fotolog and Facebook were very much in favor of power savings. I think there is more than just saving a little power, you get cooling and space (if smaller of course) savings.
http://venublog.com/2008/04/16/notes-from-scaling-mysql-up-or-out/
Notes from Scaling MySQL - Up or Out
Here is the quick notes from the session Scaling MySQL - Up or Out ? moderated by Kaj Arno as part of the todays keynote.
Here is the list of panelists are ordered by Alexa ranking.
- Monty Taylor (MySQL)
- Matt Ingerenthron (Sun)
- John Allspaw (Flickr)
- Farhan Mashraqi (Fotolog)
- Domas Mituzas (Wkipedia)
- Jeff Rotheschild (Facebook)
- Paul Tuckfield (YouTube)
Here is the list of questions and answers from panelists:
 | How many servers | Number of DBAs | How many web servers | Number of caching servers | Version of MySQL | Language, platform | Operating System |
MySQL |
1 M, 3 S |
1/10 |
2 |
2 |
5.1.23 |
Perl,php and bash |
Linux fedora |
Sun |
2 clustered, 2 individual |
1.5 |
160+ |
8 |
5.0.21 |
Lots of stuff (java mostly) |
Open Solaris |
Flickr |
166 |
At present 0 |
244 |
14 |
5.0.51 |
Php and some Java |
Linux |
Fotolog |
140 databases on 37 instances |
10 instances a DBA |
70 |
40 ( 2 on each, 80 total) |
4.11 and 4.4 |
Php, 90% Java |
Solaris 10 |
Wikipedia |
20 |
None, but everybody is kind of a DBA |
70+200 |
40 ( 2 on each, 80 total) |
 |
Php, c++, python |
Fedora / Ubuntu |
30000 (1800 db servers) |
2 |
1200 |
805 |
5.0.44 with relay log corruption patch |
Php, python, c++ and enlang |
Fedora / RHEL | |
Youtube |
I can’t say |
3 |
I can’t say |
I can’t say |
5.0.24 |
python |
SuSE 9 |
Few more misc questions ...
Number of times re-architected ?
- MySQL: 2 - 1 time slave, 1 time memcached
- Sun: site depend (many times over the year)
- Flickr: Ummm...2.5 (various clusters federated)
- Fotolog: many cached replacements (about to do one change now)
- Wiped: Never (Spaghetti)
- Facebook: Every Tuesday, continual
- Youtube: Pretty continual, 2-3 times (replication, sharding, federation)
What happens if server fails ? what actions you will generally take ..
- Flickr: All of our 7 are federated, pairs of servers, we can loose any one side of shard, we can loose boxes.. traffic goes to either side of shard, now it goes to one, and we will get another one (very transparent to user) .. for offline, sites are affected
- Wikipedia: Users shout at them on IRC then they moderate fixed in seconds
- Facebook: one of 1800-1900 will always fail, just operate well, minor impact, with data going away for a while...we restore from binlog and start the server quickly, promote slave to master and number of ways
- Fotolog: we simply mount the snapshots to different servers and get
- Youtube: SAN etc, very important data.. recover the server, mirrored disk ...mirrored hard drive is crucial
Any recommendation of scaling technology that you wanted to bring
- Fotolog: UltraSPARC-T1 (excellent master, multi threaded) and UltraSPARC-T2 for slave (single threaded)
- Wikipedia: good n/w switch
- Facebook: cheap switch, we dont use SAN, neatly partitioned, they scale independently and fail independently
- mysql: cluster very sad
Server virtualization ?
- nobody uses at this time
- ETL cluster, we may run more than one in the future (facebook)
Anything to worry at present ?
- Facebook: app design is the key to use resources, data center power supply and consumption
- Fotolog: Google has to approve it for our power (cut app servers by 1/2 by moving from php to java)
- Youtube: not at all
Any reco, lessons to DBA
- better you know what the systems are, then you can
- performance, scaling taking it serious
- nothing more permanent than temp solutions (if u don't know when u will fail, then u will )
- architect properly in start, schema, cost of serving data
- 10 mts biggest architectural change
- memory, resource
--EOF--
从MySQL 5.0.3版本就有了,可以看看:
http://dev.mysql.com/doc/refman/5.1/en/index-merge-optimization.html
--EOF--