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

Page 2 of 4
APC setup
 
bluescrubbie
Jr. Member
 
Total Posts:  21
Joined:  2009-10-01
 

If APC gives you a blank page or errors, try turning off the Zend optimizer by commenting out the line in php.ini.  Example:

[Zend]
;zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcinmf
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-12-21
 

It is very important to set the memory size right.
By default the size is 32MB, from my experience for Magento it is way too low (95MB works for us).

The APC release contain apc.php file. Place it under your magento directory and access from browser.
It will give nice graphs and info. Check how many “Cache full counts” you have, if the number is growing it means that memory size is too low.
If the cache reaches default 32MB it will reset itself what defeats the purpose of cache.

Here is check list to see if your APC is working correctly.
1.  Upe apc.php file
2.  Hit & Miss should be at 99% Hits
3.  Cache full count should not increase rapidly

Good luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcinmf
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-12-21
 

It is very important to set the memory size right.
By default the size is 32MB, from my experience for Magento it is way too low (95MB works for us).

The APC release contain apc.php file. Place it under your magento directory and access from browser.
It will give nice graphs and info. Check how many “Cache full counts” you have, if the number is growing it means that memory size is too low.
If the cache reaches default 32MB it will reset itself what defeats the purpose of cache.

Here is check list to see if your APC is working correctly.
1.  Use apc.php file
2.  Hit & Miss should be at 99% Hits
3.  Cache full count should not increase rapidly

Good luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Here’s a working apc.ini file with some comments to help understand what the entries are doing

extension apc.so    #name dependent on your APC cache install

[APC]
apc
.enabled 1    # Turn APC cache on
apc.optimization  0    # Experimental keep off
apc.shm_segments 1    # Shared memory segments
apc.shm_size 128  # Increase until Cache Full Count remains at 0
apc.ttl 7200
apc
.user_ttl  7200
apc
.num_files_hint 8096
apc
.user_entries_hint 8096
apc
.mmap_file_mask = /tmp/apc.XXXXXX
apc
.enable_cli # Allow command line php to function
apc.cache_by_default  # Enabled, 0 for filters
apc.max_file_size 5M # Maximum cached file size
apc.stat # 1 for dev, 0 for production, whether the source file is checked for mod date
#apc.include_once_override = 1 # Use PHP5.3+ for include_once optimization

And remove the comments when you install this, APC isn’t as intelligent as most programs and includes them when it tries to run.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bart Simpson
Jr. Member
 
Total Posts:  14
Joined:  2010-03-11
 

When I load up apc.php to monitor my apc cache I can see lots of MAgento files. I can also login to apc.php and clear the opcode cache from there, to clear out these cached files. Now, when in Magento I do ‘clear cache’ I expect the same: the opcode cache to be cleared. But, if I go in on apc.php and then refresh the data I am still seeing lots of my Magento files. I tried both buttons.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

APC cache has nothing to do with Magento Cache, so clearing the Magento Cache clears only the Magento Cache.

Clear the Magento cache and then clear your APC cache.

 
Magento Community Magento Community
Magento Community
Magento Community
 
OpenCommerce
Sr. Member
 
Avatar
Total Posts:  84
Joined:  2009-05-28
Cincinnati, OH
 

Not to be off topic, but I can help but suggest a solution to those who have struggled with Magento Performance like myself.

Might I suggest:

Lightspeed - A whole-page caching utility that is on par with Magento Enterprise Edition’s whole-page caching (and in some ways better).

Whole-page caching, while it can be tricky at times, brings much better performance than PHP caching or block-level caching can by themselves.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

TinyBrick:: I just bought you ext, can I enable that with Admin as well?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

I added the APC cache tag to my local.xml and my cache stopped writing to my /var/cache directory? Is this normal?

......
<
cache>
            <
backend>apc</backend>
            <
prefix>alphanumeric</prefix>
        </
cache>
     </global>

I am using litespeedtech for my webserver, and I have verified that APC is working.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Not sure if that’s normal. I have APC enabled and showing a 99.6% hit rate and still have /var/cache directories being created and populated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

@Brent

After a little research, some people have the results you get, and some have the results I get.  ???

Anyone know how this is supposed to function when fully working? Does APC completely take over the Magento /var/cache functions, or only some of them? I’ve bumped up the cacheable system and user file limits to 10,000 and given APC enough space to not have a cache full count.

Running Apache 2 and FastCGI

 
Magento Community Magento Community
Magento Community
Magento Community
 
nabuhonodozor
Member
 
Avatar
Total Posts:  51
Joined:  2008-03-27
 

Hi,
I am encountering high fragmentiation over very short period. After 2 hours I have 20%.
It reach 100% after 6-8 hours. Ive tried many settings but it doesnt solve my problem.
Now, I need to restart apache every few hours - can You help me?

My php.ini entries:

[APC]
extension 
apc.so
apc
.enabled 1
apc
.shm_segments 1
apc
.shm_size 512M
apc
.optimization 0
apc
.num_files_hint 8096
apc
.user_entries_hint 8096
apc
.ttl 88200
apc
.user_ttl 88200
apc
.gc_ttl 88600
apc
.cache_by_default 1
apc
.filters "apc\.php$"
apc.slam_defense 0
apc
.use_request_time 1
apc
.mmap_file_mask = /tmp/apc.XXXXXX
apc
.file_update_protection 2
apc
.enable_cli 1
apc
.max_file_size 1M
apc
.stat 0
apc
.stat_ctime 0
apc
.write_lock 1
apc
.report_autofilter 0
apc
.include_once_override 0
apc
.rfc1867 0
apc
.rfc1867_prefix "upload_"
apc.rfc1867_name "APC_UPLOAD_PROGRESS"
apc.rfc1867_freq 0
apc
.localcache 1
apc
.localcache.size 2048
apc
.coredump_unmap 0

I am running Ubuntu 8.04LTE, Apache2, PHP 5.2.4-2ubuntu5.14, APC 3.1.6 and I don’t have Zend optimizer. I have magento 1.4.1.1.
Ive modified magento .xml and add APC support.

I found that If I use User_cache APC memory is quickly fragmented. If I disable entries in magento .xml thus stopping magento utilizing APC user_cache, situation is much better and fragmentation satys around 1-5%.

What I should do?

Image Attachments
FireShot Pro capture.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

@nabuhonodozor:: that is an excellent question, I am also in the same boat. I don’t have my apc enabled in my local.xml but it seems to be working fine?

anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nabuhonodozor
Member
 
Avatar
Total Posts:  51
Joined:  2008-03-27
 

It helps to modify /etc/sysctl.conf and add

kernel.shmmax=536870912

But still fragmentation is quite high and I need to restart Apache everyday to fix this.

@Brent W Peterson - Yes, it should work as expected w/o modifyng xml, but putting entries in XML should additionally offload some internal magento requests to cache (IMO).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kammalou
Sr. Member
 
Avatar
Total Posts:  285
Joined:  2009-01-20
Denmark
 

Just keep reading. - forgot this post.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 4