TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Can You Hack Your Own Site?

4 点作者 reazalun将近 17 年前

1 comment

rit将近 17 年前
There is some ... flawed arguments here.<p>Specifically the article extorts that you should always use mysql_pconnect because "unique connections simply don't scale". This will provide performance improvements in certain situations, but once you scale to higher levels, persistent connections hamstring you. (High Scalability - <a href="http://highscalability.com" rel="nofollow">http://highscalability.com</a> has plenty of articles talking about many of the big, scaled sites not using persistent connections).<p>When you pass a certain number of connections you end up not only wasting RAM on your web server, but resources on the MySQL database that could be better used. Building and tearing down connections in MySQL is incredibly fast.<p>The best option is to use UNIQUE connections, and tune certain parameters in mysql - specifically wait_timeout. By default, MySQL leaves connections open for EIGHT HOURS. Set it to 5 - 30 seconds, and it will scale nicely for you. You'll need a lot less RAM on both the DB and the webserver end and you won't likely hit any "too many open connections issues".