Questions tagged [memcached]

Memcached is a simple distributed object cache that caches information in memory, and can be used to improve the performance of dynamic web applications by reducing access time and database load.

Memcached is open source easily deployable in-memory distributed cache, cross application and cross Platform Engine meaning the same server(s) can be accessed from a variety of languages - PHP, Java, and .NET and from Windows, Linux, etc. Memcached is currently distributed under a BSD-style open source license.

5184 questions
22
votes
4 answers

What is the best way to handle sessions for a PHP site on multiple hosts?

PHP stores its session information on the file system of the host of the server establishing that session. In a multiple-host PHP environment, where load is unintelligently distributed amongst each host, PHP session variables are not available to…
Simon Young
  • 281
  • 2
  • 9
22
votes
2 answers

Install Memcached on Windows

While doing some web development, I needed to have Memcached (source code) installed on my local machine to closely simulate what was going on my server. How to install Memcached on Windows?
Mahdi Bashirpour
  • 17,147
  • 12
  • 117
  • 144
22
votes
2 answers

Difference between Memcache, APC, XCache and other alternatives I've not heard of

At work, we've recently started designing an application to me "large scale" (we're engineering for the potential to serve up many millions of hits a day). One of the senior devs and the sysadmin have set up memcache on the server. As I…
Alex C
  • 16,624
  • 18
  • 66
  • 98
22
votes
3 answers

How does memcache with MySQL work?

I am trying to understand (and probably deploy) memcached in our env. We have 4 web servers on loadbalancer running a big web app developed in PHP. We are already using APC. I want to see how memcached works? At least, may be I don't understand how…
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
21
votes
4 answers

The memcache extension must be loaded for using this backend

I got memcached installed. This is from phpinfo(): But when using it like this: private static function getZendCacheMemcachedObject() { $frontendOpts = array( 'caching' => true, 'lifetime' => 3600, …
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
21
votes
4 answers

How does django handle multiple memcached servers?

In the django documentation it says this: ... One excellent feature of Memcached is its ability to share cache over multiple servers. This means you can run Memcached daemons on multiple machines, and the program will treat the group of…
Apreche
  • 30,042
  • 8
  • 41
  • 52
21
votes
4 answers

Share Sessions between tomcat instances (without using Sticky Sessions)

I'm going to have 3 Tomcat servers and a Load Balancer that dispatches the requests without using 'sticky sessions'. I want to share sessions' data between the servers and I'm thinking in persisting them in DB. I'd like to use memcached as a layer…
mickthompson
  • 5,442
  • 11
  • 47
  • 59
21
votes
1 answer

Comparison of memcache, redis and ehcache as distributed caching framework

One of the decisions I need to make is what caching framework to use in my system. With so many to choose from, I am currently investigating redis, ehcache and memcached. Can anyone point to performance benchmarks of these three particular…
user308808
21
votes
2 answers

PHP: Measure size in kilobytes of a object/array?

What's an appropriate way of measure a PHP objects actual size in bytes/kilobytes? Reason for asking: I am utilizing memcached for cache storage in my web application that will be used by non-technical customers. However, since memcached has a…
Industrial
  • 41,400
  • 69
  • 194
  • 289
21
votes
4 answers

Memcached, Locking and Race Conditions

We are trying to update memcached objects when we write to the database to avoid having to read them from database after inserts/updates. For our forum post object we have a ViewCount field containing the number of times a post is viewed. We are…
Micael
  • 6,950
  • 6
  • 25
  • 28
21
votes
6 answers

php_memcache.dll for PHP 5.3

I recently setup a server using the latest version of XAMPP for Windows. With it came PHP 5.3. I'm now looking for a memcache.dll file that works with PHP 5.3 I've used some of the previous .dll files and recieved an error message: "PHP Startup:…
whobutsb
  • 1,075
  • 4
  • 13
  • 28
21
votes
2 answers

If the data is constantly changing, what do you cache? (using Twitter as an example)

I've been spending some time looking into caching with (redis and memcached mostly) and am having a hard time figuring out where exactly to use caching when your data is constantly changing. Take Twitter for example (just read Making Twitter 10000%…
Lance
  • 75,200
  • 93
  • 289
  • 503
21
votes
3 answers

Google App Engine: Memcache or Static variable?

Well, I think I have a very basic doubt here: I'm developing an app on GAE (Java) and performing a query to the datastore that returns a lot of entities, so I need to cache it. I was using memcache and it was working great, but if I keep the list…
21
votes
3 answers

Why Use Redis instead of MongoDb for Caching?

I've seen many people using Redis as a cache lately, why not Mongo? As far as I could tell Redis can set an expire date on an index, like memcache but otherwise are there any reasons not to use Mongo for this? I ask as I'm doing a large join in…
jfountain
  • 3,715
  • 2
  • 24
  • 22
20
votes
4 answers

Avoiding Memcache "1000000 bytes in length" limit on values

My model has different entities that I'd like to calculate once like the employees of a company. To avoid making the same query again and again, the calculated list is saved in Memcache (duration=1day).. The problem is that the app is sometimes…
David Haddad
  • 3,796
  • 8
  • 32
  • 40