I have written before - MyISAM Does Not Scale, or it does quite well - two main things stopping you is table locks and global mutex on the KeyCache.
Table Locks are not the issue for Read Only workload and write intensive workloads can be dealt with by using with many tables but Key Cache Mutex will still hunt you. If you aware of MySQL history you may think Key Cache scalability was fixed with new Key Cache in MySQL 4.1, and indeed previously it did not even scale with one CPU as global lock was held during IO duration, In MySQL 4.1 the lock is held only when key block (1KB to 4KB) is being copied from Key Cache to thread local buffer, which is terrible contention spot in particular on systems with many CPU cores.
Happily there is solution, or at least half of it.
If you have chosen a way of using Multiple Tables to solve Table Locks problem you can also use multiple Key Caches to reduce or virtually eliminate key cache contention. Too bad you can only map single table to single key cache - it would be so much more helpful if you could use multiple key caches for the same table, for example caching even/odd key blocks or something similar, or actually just keep hash of locks instead of one.
When you decide to use Multiple Key Caches the question is how many to use, what sizes to allocate and how to map tables to them. One simple solution I use - create separate key cache for all actively accessed tables (assuming there are only few of them), allocating key_cache proportional to their size and load, but no more than the index size (assuming table sizes are relatively static)
To get accurate information about table usage I will use Percona Patches:
For table sizes we can use traditional TABLES table:
Now with a bit of INFORMATION_SCHEMA magic and a bit of waiting on "efficient" Information Schema Query Execution (as you may guess we just need to join two previous results sets here) we can get the information about relative table index sizes and their relative use activity. I just summed rows modified and updated but you can surely use different formula if you like.
A bit more query hacking and we get a query which will return statements to initialize key buffers according to table sizes and activity (in this case taken with 50-50 weight though you may use other formula), while maintaining the restriction on the sum key buffer size (4000000000 in this case) and actual index size:
Pass this via SELECT INTO OUTFILE or pipe it to mysql directly as explained here to create key caches.
Now you can use much more simple command to assign tables to the key caches:
So going through complex or not multiple key cache creation exercise you probably wonder how much performance gains should you expect. In fact it can be very significant.
For CPU bound workload with 16 Cores Inserting data to about 20 tables I've seen performance gains as much as 10x compared to using single shared key cache of the same size.
Entry posted by peter | No comment
请参阅Jason Morrison最近发表的一篇帖子《让垃圾留言远离您的网站和用户》, 从一开始就阻止垃圾的产生。
网 站的访问者在开始的时候会离开您的网站以查看相关的信息。但是,您还记得当您遇到一个网站链向其他网站的好文章时您是怎么做的吗?对于我个人来说,如果网 站提供了有价值的评述和额外资源的话,我总是会回到这个网站的。有时候,我会留在初始网站上,而在浏览器的不同标签中打开那些有意思的链接。所以,拥有导 出链接的网站是很有可能赢得重复访问者的,您也不会永远失去这些用户。上一篇帖子提到描述性的锚文本(anchor text)对于内部链接有帮助,那对于导出链接是不是也是很重要?
描述性的锚文本(超级链接的可见文本)有助于网络间的准确互联。它可以同时让用户和Googlebot更好地了解他们在跟随一个链接到达另外一个页面时将会看到什么内容。所以如果不是太麻烦的话,请尽量生成描述性的锚文本。
如果您相信您链向的内容会让您的用户感兴趣的话,请不用担心该网站的PageRank。作为一个网站管理员,关于导出链接我们应当注意的事项上文中已经向您介绍了,比如链向垃圾网站会降低您的可信度等。其他的话,我们无须为导出链接殚精竭虑,只要把它作为一种向您的用户提供更多价值的自然而然的方式就好了。
WordPress 2.6.5 is immediately available and fixes one security problem and three bugs. We recommend everyone upgrade to this release.
The security issue is an XSS exploit discovered by Jeremias Reith that fortunately only affects IP-based virtual servers running on Apache 2.x. If you are interested only in the security fix, copy wp-includes/feed.php
and wp-includes/version.php
from the 2.6.5 release package.
2.6.5 contains three other small fixes in addition to the XSS fix. The first prevents accidentally saving post meta information to a revision. The second prevents XML-RPC from fetching incorrect post types. The third adds some user ID sanitization during bulk delete requests. For a list of changed files, consult the full changeset between 2.6.3 and 2.6.5.
Note that we are skipping version 2.6.4 and jumping from 2.6.3 to 2.6.5 to avoid confusion with a fake 2.6.4 release that made the rounds. There is not and never will be a version 2.6.4.
十一月 2008 | ||||||
一 | 二 | 三 | 四 | 五 | 六 | 日 |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |