tollmanz / wordpress-pecl-memcached-object-cache

A WordPress object cache that uses the memcached (not memcache) PECL extension.
233 stars 114 forks source link

Possible memory leak #56

Closed shmuel-krakower closed 9 years ago

shmuel-krakower commented 9 years ago

Hi @tollmanz Following some work on my side to test this plugin under load tests I thing I see an issue when non of the memcached servers are available. When running the load test and stopping the memcached instance(s), over time, the usage of memory on the php server is increasing.

Once I start the memcached instance(s) again, the memory utilization is kept on the same level.

My setup is apache 2.4 with mod_php. Memory is used by the apache/php processes.

I'll try to make sure this issue is not only due to my PR #54 #55 and if it isn't, I'll try to look into PHP memory dumps to troubleshoot that. Are there any known memory issues?

tollmanz commented 9 years ago

Are there any known memory issues?

No. Doesn't mean there are not any though.

I'm having trouble figuring out whether this is really an issue or not. The problem is that memcached has failed, causing unexpected behavior in code that has memcached as a dependency. The fix is to make sure that the dependency is actually there.

I'm half tempted to say that the fix is to just make sure your memcached instances are running (e.g., via monit, nagios, or some other system); however, I can also see an argument for falling back to the built-in runtime cache if memcached fails.

Can you tell me more about the issue that you are experiencing? What memory is increasing? How can I actually experience the same problem?

shmuel-krakower commented 9 years ago

I'll be working on that in the next couple of weeks, so I'll share my findings here, hopefully you'll be able to assist.

On Mon, Apr 27, 2015, 6:27 PM Zack Tollman notifications@github.com wrote:

Are there any known memory issues?

No. Doesn't mean there are not any though.

I'm having trouble figuring out whether this is really an issue or not. The problem is that memcached has failed, causing unexpected behavior in code that has memcached as a dependency. The fix is to make sure that the dependency is actually there.

I'm half tempted to say that the fix is to just make sure your memcached instances are running (e.g., via monit, nagios, or some other system); however, I can also see an argument for falling back to the built-in runtime cache if memcached fails.

Can you tell me more about the issue that you are experiencing? What memory is increasing? How can I actually experience the same problem?

— Reply to this email directly or view it on GitHub https://github.com/tollmanz/wordpress-pecl-memcached-object-cache/issues/56#issuecomment-96708356 .

shmuel-krakower commented 9 years ago

Hi @tollmanz - I've been trying to reproduce that issue for few days now... I'm sure that this wasn't a memory leak, so I have one less concern.

Let me clarify the issue I had: Originally I seemed to me like a high memory consumption taking place once none of the backend memcached servers is available.

After looking into it, it happens due to the fact that the application response time is getting terribly slow (while all memcached nodes are unavailable) which in turn, cause more active apache processes to run in parallel (to deal with the traffic), which in turn increase the memory consumption.

I guess it is only a local issue with my apache configuration, as I had apache configured to create more processes than my system could handle with, in terms of memory. Adjusting my apache configuration to have fewer worker processes resolved the allegedly, memory issue I was seeing.

FYI - servers which had the same config + same unavailable memcached nodes + my fix in PR #55 - didn't respond slowly, thus this issue was not visible there and the system was more stable.