Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #15660

Re: APC Questions Regarding "Unable to allocate memory for pool."

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: APC Questions Regarding "Unable to allocate memory for pool."
Date 2015-09-10 16:17 -0400
Organization A noiseless patient Spider
Message-ID <mssodq$3ck$1@dont-email.me> (permalink)
References <d3a952c8-cf4a-4789-94cf-723c193263c1@googlegroups.com>

Show all headers | View raw


On 9/10/2015 3:45 PM, mojorising00@gmail.com wrote:
> Hello!
> 
> On two different environments (one Drupal, one Wordpress) on different server environments, I have been seeing the same PHP warning -- "Unable to allocate memory for pool.".
> 
> The message appears intermittently (for an estimated 10 - 20 minutes at a time) and first started popping up less than a week ago. No PHP or APC changes have been made around that time.
> 
> I have searched the web fairly extensively and in cases where this message appears, the usual advice has been to verify all the APC parameters. That's good advice and seems to have worked for others. The problem is that everything has been working fine for years in these environments until the last week and a review of the APC settings tells me they look appropriate.
> 
> We saw it again this morning and at that time, noticed that memory in the APC cache was just short of the shm_size limit. This made us think we were hitting that limit and the next operation to insert an object into that cache pool failed, triggering the warning message.
> 
> So I adjusted apc.shm_size from 512MB to 768MB and the message has yet to appear again, though only a few hours have passed since then.
> 
> This brings me to a few questions I have for you:
> 
> * In a situation where an application attempts to insert an object into an APC cache and the item to be inserted can not be, due to a constraint set in the APC configuration (e.g. there is no more room for it based on apc.shm_size, object exceeds 'apc.max_file_size', etc), shouldn't operations continue without error? My thinking is that the item can't be cached in such a situation but it can still be processed by PHP.
> 
> * Is there any way to see exactly what objects are not being cached due to this condition?
> 
> * Is there anything else I might be missing that can be adjusted here. Bringing apc.shm_size up does appear to have resolved the issue, though I feel that shouldn't be absolutely necessary. In a situation where that option is not available, system memory is limited, it seems I should still be able to use APC without this warning appearing.
> 
> * Could this problem be a result of a bug in APC or PHP?
> 
> 
> Thanks so much for any insught you may be able to provide! My apologies if this has already been addressed somewhere or is not the best place to pose this question.
> 
> Here are the APC parameters for reference:
> 
> apc.enabled=1
> apc.shm_segments=1
> apc.shm_size=768M (was 512MB at time of warnings)
> apc.num_files_hint=7000
> apc.user_entries_hint=4096
> apc.ttl=7200
> apc.use_request_time=1
> apc.user_ttl=7200
> apc.gc_ttl=3600
> apc.cache_by_default=1
> apc.filters
> apc.mmap_file_mask=/tmp/apc.XXXXXX
> apc.file_update_protection=2
> apc.enable_cli=0
> apc.max_file_size=4M
> apc.stat=1
> apc.stat_ctime=0
> apc.canonicalize=0
> apc.write_lock=1
> apc.report_autofilter=0
> apc.rfc1867=0
> 
> 
> Best,
> Mike
> 

It's not an error - it's a warning.  A big difference.  An error
terminates processing; a warning does not.  PHP is continuing to run,
however at a reduced efficiency due to the inability to cache the object.

I don't know of a way to tell what objects are not cached, but then I
haven't looked into it.  However, IMHO the warning is valid, and I think
it should be issued because it is affecting the processing on your web site.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

APC Questions Regarding "Unable to allocate memory for pool." mojorising00@gmail.com - 2015-09-10 12:45 -0700
  Re: APC Questions Regarding "Unable to allocate memory for pool." Jerry Stuckle <jstucklex@attglobal.net> - 2015-09-10 16:17 -0400
    Re: APC Questions Regarding "Unable to allocate memory for pool." Mike <mojorising00@gmail.com> - 2015-09-10 13:32 -0700
      Re: APC Questions Regarding "Unable to allocate memory for pool." Jerry Stuckle <jstucklex@attglobal.net> - 2015-09-10 20:21 -0400
        Re: APC Questions Regarding "Unable to allocate memory for pool." Mike <mojorising00@gmail.com> - 2015-09-10 23:39 -0700

csiph-web