CLI APC not caching table schema

Hi We managed to get APC working for a system we built in phalcon but we also have crons running as cli tasks. And these tasks dont seem to save the meta data with apc. They keep running queries like this: SELECT IF(COUNT(*)>0, 1 , 0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='TABLENAME'; Does anyone know how to fix this? The apc is enabled in the cli php.ini. Thanx



83.2k

What version are you using?



3.1k

Hi We are using version 1.3



83.2k

Have you checked if apc_store/apc_fetch are working fine under CLI?



203

the response shows the test variable in the browser via a normal controller.

however the cli just returns empty value.



3.1k
edited Sep '14

As my colleague above mentions the apcfetch was returning empty. I have since made sure the cli.php had apc.enablecli on which it does now. Now it does return the aptfetch but the crons still return the same queries in my mysql log SELECT IF(COUNT(*)>0, 1 , 0) FROM INFORMATIONSCHEMA.TABLES WHERE TABLE_NAME='TABLENAME'; one for each cron thread.



83.2k

That's how APC works in CLI, it creates a new memory pool for every process created which could be a very unexpected behavior: http://stackoverflow.com/a/10423978/1022921



3.1k

I guess to some extent that does make sense, thanx. It still means that all these table metadata queries are seen as un-indexed queries and gets logged 100 times per minute. However, am I not correct in saying that even without APC phalcon will still run these queries each time my threads run?