Results 1 to 4 of 4
  1. #1

    nginx+apc+php-fpm+varnish, how to tell if APC and Varnish are really "working"

    Alright, so I installed nginx, php-fpm, apc and varnish and while it all "works" in terms of no errors, I'm unsure how to tell if/what they are caching...

    Now, I'm on CentOS 6 and I installed APC with:

    yum --enablerepo=remi,remi-php55 install php-pecl-apc
    so this might be why it's not working (if it isn't) at all, or at least seems like it's not working with the apc.php that comes with APC (as installing it like I did, I didn't get it, I had to extract it from the package and then upload it) but all I'm seeing is:

    1 Hit 0 Misses

    System Cache Entries shows nothing for Script Filename, nothing for Hits, Size 656 and surprisingly it's saying it was last accessed AND created at: 1970/01/01 00:00:00 and then last modified was at 2pm today?

    Per-directory resources has nothing for directory, 35 filenames, 0 hits, 421264 for size

    NOW, I also have a apc2.php which is just:

    <? php
    print_r(apc_cache_info()); ?>
    and that shows:

    [nslots] => 4099
    [ttl] => 7200
    [nhits] => 1208
    [nmisses] => 233
    [ninserts] => 53
    [nentries] => 35
    [nexpunges] => 0
    [stime] => 1382663331
    [mem_size] => 421264
    [file_upload_progress] => 1
    [memory_type] => mmap
    [cache_list] => Array
    and then lists a bunch of WP/W3TC related items

    I'm pretty sure APC is actually "working" as in caching, but any particular reason for the discrepancies there?

    Final question, is there anyway (outside of varnish simply inserting the header) to tell if varnish is actually caching anything?

  2. #2
    Hey, I've used this in the past to troubleshoot Varnish caching issues:

    Hopefully that helps you out.

  3. #3
    Join Date
    Dec 2005
    I've used a bit more sophisticated form of the same approach NinjaForms posted above. There are tools that allow you to see HTTP headers, and those may provide good tips on what's going on. Live HTTP Headers for Firefox is a free tool.

    apc.php was very helpful in determining if the caching was working. I've not used tools beyond that. The 1970's date you see is the Unix Epoch, and I guess something has slightly failed somewhere because it's using the "fallback" value. If it's working, I wouldn't worry about that.

  4. #4
    Join Date
    Apr 2013
    you can ssh into the varnish server and run the command


    which will show you in realtime the stats for varnish. You know it is working well if your lines look similar to...

    Hitrate avg: 0.7137 0.7061 0.7061

    Meaning that 70% of all hits are being served by varnish

Similar Threads

  1. Nginx + PHP-FPM + APC + Memcache + Drupal 7
    By gogoi in forum VPS Hosting
    Replies: 5
    Last Post: 11-30-2013, 06:00 AM
  2. VDS Apache(Fcgi) + APC Nginx And Varnish
    By adeministrator in forum Hosting Security and Technology
    Replies: 9
    Last Post: 02-09-2013, 08:17 PM
  3. Replies: 1
    Last Post: 12-31-2012, 02:01 PM
  4. Nginx + PHP-FPM + APC + Varnish for Wordpress website
    By explorator7 in forum Hosting Security and Technology
    Replies: 6
    Last Post: 12-30-2012, 03:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts