Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

Discuz能有多快? 见识下postgreSQL的强悍,对比下mysql的低能

[复制链接]
tearszhu 发表于 2012-7-31 11:28:22 | 显示全部楼层
mark35 发表于 2012-7-28 18:58
数据库负载和IP没直接关系。只看查询请求并发量。
现在平均每秒500次数据库操作,pg只开了10个左右进程( ...

每秒500次,在线人数不是达到30万/15分钟?
回复

使用道具 举报

 楼主| mark35 发表于 2012-8-2 10:08:39 | 显示全部楼层
本帖最后由 mark35 于 2012-12-3 20:53 编辑
tearszhu 发表于 2012-7-31 11:28
每秒500次,在线人数不是达到30万/15分钟?

应该没那么高。
用户每次刷新页面平均产生10条SQL查询。每条500条大概折合成50个客户端并发。15分钟计算下来应该约45K。
回复

使用道具 举报

Aoi天空 发表于 2012-8-2 12:02:59 | 显示全部楼层
路过看下,论坛一直没什么流量所以也没有需求。。
回复

使用道具 举报

520tsmg 发表于 2012-8-5 21:44:03 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| mark35 发表于 2012-8-6 16:27:54 | 显示全部楼层
本帖最后由 mark35 于 2012-12-3 20:53 编辑
bugx 发表于 2012-7-30 16:07
弱不弱可以测试下,我在mysql5.5里测试了1000万数据,count并不是很慢到无法想象的地步。myisam把总数进行 ...

1000万记录, innodb count(*) 估计要数十秒以上。这个时间本身倒不太恐怖,就当是个慢查询。但问题是在这期间会阻塞对表的更新,对于 关联了 threads+posts表的count,这种阻塞带来的后果才是真正的恐怖——无法编辑帖子,主题浏览数无法更新。如果再关联个members表,那就歇菜吧。哈哈~
回复

使用道具 举报

无效楼层,该帖已经被删除
 楼主| mark35 发表于 2012-8-6 16:32:27 | 显示全部楼层
本帖最后由 mark35 于 2012-12-3 20:54 编辑
sanalex 发表于 2012-7-25 20:20
呵呵,你那mysql的描述都哪年的老黄历了

时不时是不只个笼统的说法,还是不负责任的,否则TB、 ...
再说论坛是什么呢,就是个留言板,要ACID做什么呢?myisam本身就不支持这玩意

是啊,论坛就是个留言板,搞这么多功能,搞什么积分、充值、兑换干嘛呢?
什么?会员积分和RMB关联,丢了钱怎么办? 一个论坛,搞什么ACID搞什么金钱挂钩马……
回复

使用道具 举报

whiskoy 发表于 2012-8-7 10:24:34 | 显示全部楼层
见识了!!
回复

使用道具 举报

netys 发表于 2012-8-7 10:56:35 | 显示全部楼层
真是好人啊~~
回复

使用道具 举报

bugx 发表于 2012-8-7 12:37:13 | 显示全部楼层
本帖最后由 bugx 于 2012-8-7 13:00 编辑
mark35 发表于 2012-8-6 16:27
1000万记录, innodb count(*) 估计要数十秒以上。这个时间本身倒不太恐怖,就当是个慢查询。但问题是在这 ...

就不能 count(pid)吗?非要count(*)
count(pid),不会超过3秒。因为post表已经改为myisam,所以我刚才拿 收藏表测试了一下,  6888377  ,600多万收藏。1-2秒左右。

SELECT COUNT( favid )
FROM `pre_home_favorite`

这种语句,在PgSQL里也不会很快的,包括MAX这种,都是遍历的。

Transactional databases which implement MVCC such as PostgreSQL and InnoDB perform COUNT(*) in a way that is very slow compared to non-transactional databases like MyISAM. The MyISAM engine in MySQL uses an index scan for COUNT(*) and also caches the result of the count, thus it is much faster. PostgreSQL and InnoDB require a table scan to locate all visible rows. These MVCC capable engines implement COUNT(*) this way because MVCC stores transaction visibility in the row data as opposed to the index. With MVCC capable databases, caching the COUNT(*) would result in incorrect data being returned. PostgreSQL 9.2 will have index-only scan support which uses the visibility map feature to determine whether a row is visible to the current transaction rather than visiting the page. This means dramatically faster COUNT(*) results.

况且这种都是可以做缓存的,根本不是什么性能瓶颈关键所在。这个真不会导致极端的现象。我用innoDB跑dz已经2年了,性能比myisam强大多了。升级2.5后,post表没有办法只能改为myisam。
facebook都有用到mysql,我们这些站长又担心什么。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 19:16 , Processed in 0.158766 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表