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.

Making Highrise faster with memcached

15 pointsby bdotdubover 16 years ago

2 comments

mdasenover 16 years ago
A lot of the time, memcached won't make things faster: it's meant to make things more scalable. On small sites, memcached won't increase your speed, but when you start getting lots of users, it's wonderful!<p>Memcached allows for O(1) lookups. Your database server probably uses b-tree indexes which are great, but they're log(n) lookups. If you aren't dealing with a large number of hits per second, your database will do very well. Once you start getting a lot of lookups per second n * log(n) starts looking a good bit slower than n * 1.<p>Memcached also allows you to scale effortlessly simply by adding servers. Databases can do replication, but only to a point. Remember, even in multi-master replication schemes, every write must be done on every server. Memcached shards your data so that the writes are only done on one server and the load is distributed and knows where to read based on the hash. And every time you're able to read from memcached, you're lowering the load on the piece that is less easily scaled - your database. So, even non-cached loads should get better simply because some of the lookups that would have gone to the database are now hitting memcached.
评论 #422522 未加载
soundsopover 16 years ago
<i>People are not going to feel the difference between a page rendered in 50ms and one rendered in 100ms.</i><p>I don't think that every 50ms difference is unimportant, but the difference between a 50ms render time and 100ms render time may be unimportant. Anyone have a feel for what the maximum render time is for a page to feel fast?
评论 #422374 未加载