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

Changing cache directory location - want to put it on tmpfs
 
Simon King
Member
 
Avatar
Total Posts:  46
Joined:  2008-01-10
 

Hi

Could anyone let me know how I should go about changing the location of Magento’s cache (or var) directory? I’m trying to move these files into shared memory. So far I’ve tried:

1. Changing the var_dir value in System -> Configuration
2. Changing the <var> setting in app/etc/config.xml

I even reset the cache each time but my cache files are still being written to magento/var/cache

Any ideas?

Thanks,
Simon

 
Magento Community Magento Community
Magento Community
Magento Community
 
Simon King
Member
 
Avatar
Total Posts:  46
Joined:  2008-01-10
 

I’ve symlinked my tmpfs drive to magento/var/cache for now, avoiding the need to change config

 
Magento Community Magento Community
Magento Community
Magento Community
 
vincenzo
Member
 
Avatar
Total Posts:  39
Joined:  2008-01-08
Roma
 

I tried to do the same on windows xp and get the same problem, the cache is still in the same place. I just was able to get cache on ramdisk only by modifying the

app/code/core/Mage/Core/Model/App.php

replacing the line

‘cache_dir’=>Mage::getBaseDir(’cache’),

with

‘cache_dir’=>’b:/var/cache’,

where b: is my ramdisk. I think there is some configuration problem and cache_dir value is someway overridden by php code and not read by configuration file.

regards.
Vincenzo.

 
Magento Community Magento Community
Magento Community
Magento Community
 
codenamejeff
Jr. Member
 
Total Posts:  29
Joined:  2008-02-04
 

Would any of this apply to changing where cache is saved on two different stores? For example, to make a different store on the same server use different cache?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanb
Sr. Member
 
Total Posts:  91
Joined:  2008-02-15
 

In the Blog post on Performance it says “Use a memory-based filesystem for Magento’s var directory.”

My question here is two fold I guess:

1) What is safe to put in tmpfs - if the system looses power can you stand to loose the contents of var?

Does this mean that we should put all of the /var sub-directories (cache, tmp, backups, report, session) on tmpfs?

2) Would it help performance to put all of the /var sub-directories (cache, tmp, backups, report, session) on tmpfs? For example I am guessing that /var/backup is not necessary.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sdb
Sr. Member
 
Avatar
Total Posts:  223
Joined:  2007-11-13
coastal California, USA
 
ryanb - 19 May 2008 04:33 AM

In the Blog post on Performance it says “Use a memory-based filesystem for Magento’s var directory.”

My question here is two fold I guess:

1) What is safe to put in tmpfs - if the system looses power can you stand to loose the contents of var?

Generally when one uses a memory based filesystem, one runs battery backup as well, so that if the power runs out a quick dump of the memory to a disk can occur.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanb
Sr. Member
 
Total Posts:  91
Joined:  2008-02-15
 

Does anyone know if loosing the contents of the /var directory would screw up Magento or is it all just temp files?

 
Magento Community Magento Community
Magento Community
Magento Community
 
blakew
Sr. Member
 
Total Posts:  107
Joined:  2008-06-20
 

@ryanb: http://www.magentocommerce.com/boards/viewthread/8758/

update: nvm, you have already posted in that thread, just thought I would help

 
Magento Community Magento Community
Magento Community
Magento Community
 
ixoster
Member
 
Total Posts:  51
Joined:  2008-08-06
 

how change var directory to ramdisk in windows?

Simon King - 05 April 2008 10:06 AM

1. Changing the var_dir value in System -> Configuration

didn’t find any config var directory in admin panel

Simon King - 05 April 2008 10:06 AM

2. Changing the <var> setting in app/etc/config.xml

didn’t help

 
Magento Community Magento Community
Magento Community
Magento Community
 
MI
Sr. Member
 
Total Posts:  172
Joined:  2008-12-11
Spain
 

hello

i need to change var/cache directory to ramdisk in windows too. How do you get it?
Could you help me, please?

thanks!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Melchior5
Member
 
Total Posts:  49
Joined:  2009-03-25
Montréal, Québec
 

Same problem. Help would be nice.
See here: http://www.magentocommerce.com/boards/viewreply/168696/

 
Magento Community Magento Community
Magento Community
Magento Community
 
RCPower
Jr. Member
 
Total Posts:  4
Joined:  2009-10-08
 

I found another way, maybe it would be better than above.

go to /code/core/Mage/core/Model/config/Option.php

find the line 61
“ $this->_data[’var_dir’] = $this->getVarDir();”.

change it to your ramdisk path ,such as mine :” f:/ “

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