3 ms·
> but like everything in PHP you have to half ass it. Shared memory extensions immediately come to mind. No, you do not have to half ass it and using an extens
by maratd 14y ago
> but like everything in PHP you have to half ass it. Shared memory extensions immediately come to mind.
No, you do not have to half ass it and using an extension that shares memory is not half assing it, either. You can use APC. You should have it installed already for bytecode caching, but here comes a surprise. Most people don't know that it also has an in-memory key/value store built-in. It works and it works very well. Extremely fast. You also have extensive control over how much and in what way APC uses RAM.
There has been talk of moving APC from PECL and into core for years.
- Osiris 14y agoThe problem is that if you're using APC on multiple webservers, there's a separate instance of APC running on each server. If you store data in one APC instance, there's no guarantee that the user's following request will hit that same server/instance. So this works very well for single server systems, but not when scaling to multiple servers, unless there's some process for replication that I'm not aware of? My team is thinking of using Redis or Memcached to provide a caching layer in front of the web app.
- maratd 14y ago> The problem is that if you're using APC on multiple webservers Yes. You have two solutions available. Use something like Redis or Memcached, as you noted. The other solution is to go virtual. At that point, you can scale a single instance to a fairly large size. If a single machine/instance isn't enough to handle your load, you'll end up using something like Redis/Memcached regardless of what platform you're on.