Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

/var/cache not being written to
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

/var/cache, even with chown apache:apache, which is the web user, is not being written to at all.

app/etc/use_cache.ser is also apache:apache and can be written to just fine. If I go to cache management and change anything in there, this file gets updated as expected.

ls -l on the var folder:

drwxr-xr-x 2 root root 4096 Jan 22 13:22 backups
drwxr-xr-x 2 apache apache 4096 Jan 29 13:48 cache
drwxr-xr-x 2 root root 4096 Feb 26 11:52 log
drwxr-xr-x 2 root root 4096 Feb 26 11:35 report
drwxr-xr-x 2 apache apache 4096 Jan 22 13:22 session

No difference if I make cache owned by root again. 755 should be enough but even on 777 I get nothing written. Same story with sessions.

How come my cache folder is empty, even after flushing the cache and browsing the site, as well as having seemingly correct permissions?

/etc/config.xml and local.xml have reference to these and they seem fine too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nileco
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2008-10-29
Virginia
 

I have the same issue, very odd.  Fortunately, I guess, the site does not seem to be slower.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nileco
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2008-10-29
Virginia
 

Have you learned anymore about this?  have any theories?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

No, only thought I have is that I used to write these folders into tmpfs but I umounted the tmpfs volumes so I could monitor how big these folders would actually grow so I could allocate proper tmpfs space to this and save the rest for apache/mysql.

So my only idea is that since umounting these folders, the systems has somehow forgotten to start writing this to the disk again instead of ram. #df confirms the tmpfs mounts are gone.

This article seems to suggest I may need a reboot:

http://centoshacker.com/kabir/tuning/tuning-tmpfs-filesystemdevshm-for-centos.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
nileco
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2008-10-29
Virginia
 

I’ve not had tmpfs set up.  I am using symlinks in my multi sites, including /var, and they all work just fine. 

This may have happened with a recent upgrade to 1.2.1.2 (just a guess).  My development install is still on the older 1.2.0.2 and it uses the cache folder.

I didn’t notice any changes to the cache setup in the recent release notes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

I’m on 1.2.1.1 still and have not symlinked to the var directory as I figured this wasn’t being access by the client front-end, only internally in Magento.

I’m reluctant to reboot now, maybe tonight.

My sites didn’t appear to slow down since umounting tmpfs either so it’s all very strange.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Conor
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2009-01-22
Amsterdam, Netherlands
 

I had the same problem recently. As far as I can remember it had to do with the permissions of var, not just var/cache. Make sure you have execute permission on var.

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Dankjewel!

That fixed it for the sessions but despite refreshing, and enabling cache items such as translations, I’m not yet getting any of those written in /var/cache but perhaps it needs a bit more time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nileco
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2008-10-29
Virginia
 

I never had a problem with sessions being written, just cache.  My permissions were already correct,still nothing written into var/cache.

This couldn’t all be now going to APC could it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

I use APC too but that’s not to do with it really. APC is a compiler before PHP executes, nothing to do with the end result of a PHP script executing.

No cache files for me yet despite messing a bit more with it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
romancapo
Jr. Member
 
Total Posts:  1
Joined:  2009-10-05
 

I fixed it!

Also spent a lot of time on this, besides the strangeness of not writing files to cache, it caused another trouble, but I’ve added some points about that to the move-the-website guide already: http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server

The main thing to understand here is that APC does indeed have everything to do with it.
Apparently, it is not just a cacher for opcodes, it also provides PHP functions for application cache management. That is, applications can save arbitrary cache entries “inside” apc, not in any files.

Magento can do this if you specify

<config>
    <global>
    <
cache>    
        <
backend>apc</backend>
in your local.xml

If that setting is there, all cache is saved in apc instead of the cache directory.

I had a problem where I copied a website, but forgot to change the cache prefix setting for apc, which caused both sites to sort of using the same cache, and that spawned a number of very strange problems.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top