TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Can You Hack Your Own Site?

4 pointsby reazalunalmost 17 years ago

1 comment

ritalmost 17 years ago
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".