Saturday, March 20, 2010

Looks like memcached was freezing Apache 2.2

Very bad idea to have both php extensions - memcache and memcached to be loaded at the same time.

I think this was causing the unexplained freezing of Apache 2.2

It was very difficult to track down the cause of Apache just freezing - no timeout error, no errors at all, just sitting there waiting forever for page to load.

After trying everything else, I decided to comment out loading memcached php extension and only load and use the good old reliable memcache extension.

Some tests claim that memcached is faster than memcache, but the difference is basically in single milliseconds, like who cares.... Not important when you usually saving couple of seconds worth of complex sql selects (some long sql selects that have several LEFT JOINS sometimes take 15 seconds when mysql has to create temporary table).

Anyway, I don't know if the problem was that some of the sites on the server were using memcache and some were using memcached, so I needed to load both extensions in php.ini

After ditching the memcached and only using memcache, the problems with Apache seemed to go away. Keeping my fingers crossed, so far so good.

No comments:

Post a Comment