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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Getting Web Scale with PHP & Memcached

13 点作者 vital101超过 14 年前

5 条评论

terryjsmith超过 14 年前
The term "web scale" needs to go away; it just doesn't make sense. No one site will ever need to be "web scale" by its definition since it's highly unlikely one site will get all of the web's traffic. The term could only apply to a crawler or something similar that actually consumes the whole web. Your website will either scale or it won't and there are various levels of magnitude, but the term "web scale" is confusing and buzzwordy.
Udo超过 14 年前
Pretty basic article, but yes, Memcache is awesome. With a PHP/Memcache/Nginx stack I was able to make a massive traffic site work on the smallest-possible EC2 server. But there are two things that are even more important when running PHP: a good FastCGI server (such as PHP-FPM) and an opcode cache like APC. Without those two, the PHP CGI execution model would be pure insanity; not only would it restart the entire process for each request, it would also recompile every file. I think it's sad that those measures are not standard in every PHP environment, but then again they're not particularly difficult to configure...
methodin超过 14 年前
To anyone else that might start with Memcache it should be noted that it does not fail gracefully if your servers decide to crap out. We deployed a group of 8 Memcache servers to our production environment and due to a mis-configuration all the webservers were brought to their knees since the get/set would wait for the Memcache server to respond even with the PHP specific settings (timeout etc..) set to appropriate values. For a safe use you should implement a simple home-grown "active memcache server" list so in the event of utter failure only the first couple requests to Memcache will try to request from the server list and as they fail you can knock them out of the pool. It's worth the 10 minutes it takes to implement and will save your ass if things go wrong.
Mikushi超过 14 年前
Sums it up pretty good. Only thing is, memcached is kinda outdated, it's not safe, can put very easily your environment at risk in case of crash. For anybody starting to wander in the world of caching with PHP, i'd recommend Redis, much better, safer and on an other planet when it comes to features available.
评论 #2197973 未加载
yuvadam超过 14 年前
Caching 101.