<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Opening Tables  scalability</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/</link>
	<description>Everything about MySQL Performance</description>
	<pubDate>Tue, 02 Dec 2008 12:40:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-280461</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 17 Apr 2008 16:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-280461</guid>
		<description>MySQL only opens tables once you access them.</description>
		<content:encoded><![CDATA[<p>MySQL only opens tables once you access them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: art</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-280106</link>
		<dc:creator>art</dc:creator>
		<pubDate>Thu, 17 Apr 2008 11:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-280106</guid>
		<description>Does mysql open all innodb tables at startup or only with query on that particular table?</description>
		<content:encoded><![CDATA[<p>Does mysql open all innodb tables at startup or only with query on that particular table?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sysadm</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-90484</link>
		<dc:creator>Sysadm</dc:creator>
		<pubDate>Tue, 20 Mar 2007 19:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-90484</guid>
		<description>We have forum hosting community - around 3 500 000 myisam tables per each server. Each forum gets it's own database (~90 tables in one database) . We have similar issue - when server is overloaded, status of all threads in "show processlist" is "opening tables". We have many php and system tweaks but this problem seems to be hard to resolve without MySQL source code rewrite -we have not enought knowledge to do it. It's MySQL 4.0.

We have tried to increase table_cache but it doesn't make any sense with such many useable tables - best performance setting for us is table_cache=0.

Now it's hosted on Linux 2.6 &#38; XFS which supports more than 32K subdirectories in one directory. Reiserfs supports too, but it's terribly unstable within such load and brokes it's journal itself very often, and reiserfs is not visible faster in this than XFS.

I'm afraid of putting such many tables into one database - this cause worse performance problems - like hosting &#62;10 000 000 files in one directory (3 files per table)...</description>
		<content:encoded><![CDATA[<p>We have forum hosting community - around 3 500 000 myisam tables per each server. Each forum gets it&#8217;s own database (~90 tables in one database) . We have similar issue - when server is overloaded, status of all threads in &#8220;show processlist&#8221; is &#8220;opening tables&#8221;. We have many php and system tweaks but this problem seems to be hard to resolve without MySQL source code rewrite -we have not enought knowledge to do it. It&#8217;s MySQL 4.0.</p>
<p>We have tried to increase table_cache but it doesn&#8217;t make any sense with such many useable tables - best performance setting for us is table_cache=0.</p>
<p>Now it&#8217;s hosted on Linux 2.6 &amp; XFS which supports more than 32K subdirectories in one directory. Reiserfs supports too, but it&#8217;s terribly unstable within such load and brokes it&#8217;s journal itself very often, and reiserfs is not visible faster in this than XFS.</p>
<p>I&#8217;m afraid of putting such many tables into one database - this cause worse performance problems - like hosting &gt;10 000 000 files in one directory (3 files per table)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-78513</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sun, 11 Mar 2007 12:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-78513</guid>
		<description>This actually was always curious for me why Wordpress MU was not fixed to operate with smaller amount of tables rather than create single table set for each users.

You can blame MySQL for certain performance problems but generally dealing with a lot of files is slower with most of file systems.</description>
		<content:encoded><![CDATA[<p>This actually was always curious for me why Wordpress MU was not fixed to operate with smaller amount of tables rather than create single table set for each users.</p>
<p>You can blame MySQL for certain performance problems but generally dealing with a lot of files is slower with most of file systems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hakan</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-78344</link>
		<dc:creator>Hakan</dc:creator>
		<pubDate>Sun, 11 Mar 2007 10:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-78344</guid>
		<description>Wordpress.com hosts a free blog system running WordPress Mu (multiuser wordpress) and it creates a new set of tables for every new blog.

/Hakan</description>
		<content:encoded><![CDATA[<p>Wordpress.com hosts a free blog system running WordPress Mu (multiuser wordpress) and it creates a new set of tables for every new blog.</p>
<p>/Hakan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-74056</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 08 Mar 2007 08:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-74056</guid>
		<description>Steven,

Alexey is saying MySQL Privilege system may be slow with so huge number of databases and a lot of grants on database level. 

Regarding Matt, as I understand Matt is using standard software as a base which has its own set of tables for each user.  If you have something custom having so many tables is of course not good idea.</description>
		<content:encoded><![CDATA[<p>Steven,</p>
<p>Alexey is saying MySQL Privilege system may be slow with so huge number of databases and a lot of grants on database level. </p>
<p>Regarding Matt, as I understand Matt is using standard software as a base which has its own set of tables for each user.  If you have something custom having so many tables is of course not good idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Roussey</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-73593</link>
		<dc:creator>Steven Roussey</dc:creator>
		<pubDate>Thu, 08 Mar 2007 00:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-73593</guid>
		<description>The 32000 limit is in ext2 and ext3 (still not fixed for ext4, although there is an old patch to make it 64000). If you happen to be using ext as a file system with a lot of either databases or file systems, you might try adding dir_index and then do a tune. Don't know what the speed up is, your mileage may vary.

Matt: why 5 million tables? We host 500,000 forums and don't give each one its own set of tables, it was just too much work and too slow and complex.</description>
		<content:encoded><![CDATA[<p>The 32000 limit is in ext2 and ext3 (still not fixed for ext4, although there is an old patch to make it 64000). If you happen to be using ext as a file system with a lot of either databases or file systems, you might try adding dir_index and then do a tune. Don&#8217;t know what the speed up is, your mileage may vary.</p>
<p>Matt: why 5 million tables? We host 500,000 forums and don&#8217;t give each one its own set of tables, it was just too much work and too slow and complex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25643</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 28 Dec 2006 12:46:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25643</guid>
		<description>Alexey, 

OK This is different story when privilege check system comes into play.  I guess it was not optimized well to handle such large amount of tables. I remember seeing quite a few of list scans when I worked with code few years ago. 
I would suggest to post it as a bug and hope it would be fixed sometime.</description>
		<content:encoded><![CDATA[<p>Alexey, </p>
<p>OK This is different story when privilege check system comes into play.  I guess it was not optimized well to handle such large amount of tables. I remember seeing quite a few of list scans when I worked with code few years ago.<br />
I would suggest to post it as a bug and hope it would be fixed sometime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25275</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sun, 24 Dec 2006 10:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25275</guid>
		<description>If anyone is interested in improving the way MySQL deals with a ton of table we (WordPress.com) would happily sponsor that development. We have about 5 million tables today and it's going up constantly. I'm reachable on my site.</description>
		<content:encoded><![CDATA[<p>If anyone is interested in improving the way MySQL deals with a ton of table we (WordPress.com) would happily sponsor that development. We have about 5 million tables today and it&#8217;s going up constantly. I&#8217;m reachable on my site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexey</title>
		<link>http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25155</link>
		<dc:creator>Alexey</dc:creator>
		<pubDate>Fri, 22 Dec 2006 20:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/11/21/opening-tables-scalability/#comment-25155</guid>
		<description>Here's a piece of profiling data from live system, running lot of DBs without too much load (about 80 qps, select-heavy with pretty good hit rate):
root@titanic [/var/lib/mysql]# ls -la&#124;wc -l
24547
root@titanic [/var/lib/mysql]# opreport -l *mysqld&#124;head
warning: /oprofile could not be found.
CPU: AMD64 processors, speed 2394.07 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0x00 (No unit mask) count 100000
samples  %        image name               symbol name
10174899 26.6171  libc-2.3.4.so            strcmp
5460631  14.2848  mysqld                   acl_getroot(THD*, user_resources*, char const*, unsigned int)
2592977   6.7831  libc-2.3.4.so            memcpy
1956617   5.1184  vmlinux-2.6.17.7         copy_user_generic_c
1797812   4.7030  mysqld                   Query_cache::insert_into_free_memory_list(Query_cache_block*)
1685928   4.4103  mysqld                   my_lengthsp_8bit
1066380   2.7896  mysqld                   anonymous symbol from section .plt

First two functions are privilege-system related (strcmp is used for comparing logins, filenames etc., mysql uses it's own functions for matching data). As you can see those two functions alone consume more than 40% of cpu time. That's after fixing show databases problem, with show databases the number would be more like 95%. :)</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a piece of profiling data from live system, running lot of DBs without too much load (about 80 qps, select-heavy with pretty good hit rate):<br />
root@titanic [/var/lib/mysql]# ls -la|wc -l<br />
24547<br />
root@titanic [/var/lib/mysql]# opreport -l *mysqld|head<br />
warning: /oprofile could not be found.<br />
CPU: AMD64 processors, speed 2394.07 MHz (estimated)<br />
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0&#215;00 (No unit mask) count 100000<br />
samples  %        image name               symbol name<br />
10174899 26.6171  libc-2.3.4.so            strcmp<br />
5460631  14.2848  mysqld                   acl_getroot(THD*, user_resources*, char const*, unsigned int)<br />
2592977   6.7831  libc-2.3.4.so            memcpy<br />
1956617   5.1184  vmlinux-2.6.17.7         copy_user_generic_c<br />
1797812   4.7030  mysqld                   Query_cache::insert_into_free_memory_list(Query_cache_block*)<br />
1685928   4.4103  mysqld                   my_lengthsp_8bit<br />
1066380   2.7896  mysqld                   anonymous symbol from section .plt</p>
<p>First two functions are privilege-system related (strcmp is used for comparing logins, filenames etc., mysql uses it&#8217;s own functions for matching data). As you can see those two functions alone consume more than 40% of cpu time. That&#8217;s after fixing show databases problem, with show databases the number would be more like 95%. <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
