1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to setup APC with 1.1?

Discussion in 'XenForo Questions and Support' started by kuyenmotdivad, Nov 22, 2011.

  1. kuyenmotdivad

    kuyenmotdivad Active Member

    Hi,

    Do we still have to use the same setup as we did with 1.0?

    Code:
      $config['cache']['enabled'] = true;
     
      $config['cache']['frontend'] = 'Core';
     
      $config['cache']['frontendOptions'] = array ( 'caching' => true, 'automatic_serialization' => true, 'lifetime' => 10800, 'cache_id_prefix' => 'ds' );
     
      $config['cache']['backend'] = 'Apc';
     
  2. Floris

    Floris Guest

    This is how I run XenFans.com with APC

    [​IMG]
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Floris likes this.
  4. kuyenmotdivad

    kuyenmotdivad Active Member

    If I enable debug mode it keeps jumping to the homepage if I goto http://mysite.com/?_debug=1

    How can I check if APC as loaded if I cant load the debug page?
     
  5. Floris

    Floris Guest

    APC comes with apc.php, put that file inside your public_html/ and load it from the browser.
     
  6. kuyenmotdivad

    kuyenmotdivad Active Member

    You mean APC in XF? as I cant find no apc.php file?

    UPDATE - it looks as if I need to upgrade my PHP/APC
     
  7. Gene Steinberg

    Gene Steinberg Well-Known Member

    I'm using the latest APC, 3.1.9 (warning: 3.1.8 has a nasty conflict with WordPress). I set up your config file to use 'Apc' as backend cache.

    But I have this phenomenon: Since setting up APC, whenever I navigate around the Admin panels, I am constantly forced to login again. Anyone with a solution, an APC setting change, anything?

    This is my current setup:

    Code:
    extension="apc.so"
    apc.enabled=1
    apc.shm_segments=3
    apc.optimization=0
    apc.shm_size=256M
    apc.ttl=7200
    apc.user_ttl=7200
    apc.num_files_hint=1024
    apc.mmap_file_mask=/tmp/apc.XXXXXX
    apc.enable_cli=1
    apc.slam_defense=Off
    apc.cache_by_default=1
    suhosin.apc_bug_workaround=1
    If someone has a better idea, do let me know. I copied this one from someone who said it'd work great in WordPress.

    One More Thing: This problem only happens on one of our forums: http://forum.theparacast.com. The others are free of the symptom, yet. The only difference that I can see is the use of the Product-XenFans.com-Popular-Content add-on with our largest forum. Anyone else see that as a potential conflict? Or should I be changing my APC setup any?
     
  8. dieketzer

    dieketzer Well-Known Member

    i had the cp relog issue and it was due to the fact that too little memory was allocated to apc. i suspect each of your relogs increases the cache full count by 1.
     
  9. Gene Steinberg

    Gene Steinberg Well-Known Member

    I think 256MB is more than sufficient (default is 32M). And, as I said, it happens in only one of my three forums.
     
  10. Deebs

    Deebs Well-Known Member

    Have you checked and confirmed by browsing to apc.php ? That script can also allow you to browse the cache.

    One thing, you are using a different cache prefix for each site?
     
  11. Gene Steinberg

    Gene Steinberg Well-Known Member

    Checked and confirmed what?

    I'm not using any custom cache prefixes.
     
  12. Deebs

    Deebs Well-Known Member

    That 256mb is sufficient, ie confirm by using apc.php that you are not running out of memory.

    If you are hosting all three sites on the same server with APC and not using a cache prefix you will run into problems.
     
  13. Gene Steinberg

    Gene Steinberg Well-Known Member

    It is not running out of memory. And this is the only problem I've seen. How do you set a cache prefix and where?
     
  14. Gene Steinberg

    Gene Steinberg Well-Known Member

    So nobody have an answer?
     
  15. Deebs

    Deebs Well-Known Member

    How to set a prefix is in the config posted in the first post of this thread.
     
  16. Gene Steinberg

    Gene Steinberg Well-Known Member

  17. Gene Steinberg

    Gene Steinberg Well-Known Member

    So far I changed the prefixes, but nothing changed.
     
  18. Deebs

    Deebs Well-Known Member

    To be able to really debug this I would like access to apc.php including the login. (You are using APC for the backend?)
     
  19. Gene Steinberg

    Gene Steinberg Well-Known Member

    I will open a conversation with you on this, OK?

    I am using APC on the backend.
     
  20. Gene Steinberg

    Gene Steinberg Well-Known Member

    I had pleasant conversations with Deebs, who has tried to be very helpful.

    FYI: I got this suggestion from cPanel support if you're running into troubles with an PHP cache utility. Recompile Apache and remove mod_deflate. That is a potential troublemaker.
     

Share This Page