Announcement

Collapse
No announcement yet.

Whats the trick?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Whats the trick?

    mod_fcgid & APC.

  • #2
    HI,

    Off the beaten path. Some of us do follow closely your words on your blog

    Anywhos. I had gone ahead and built a server with this post in mind.


    Following your advice as close as possible. Everything works except for one combination. mod_fcgid & APC. I just cannot get these two to play together as APC uptime never exceeds 1 minute at which point it restarts and clears all the cache entries (both system and user).

    Did I miss something?

    Thanks
    Frank

    Comment


    • #3
      Frank,

      Something for me to run. TBH: I tested eAccelerator, but given that eAccelerator wasnt updated in ages -- just assumed that APC would work. Will test (within 2 weeks) and do another post.

      Comment


      • #4
        I look forward to reading the results of your tests, Igor. We are always looking for better/more stable/optimised ways to configure our cloudlinux servers.

        Comment


        • #5
          I think I might know why this is happening. When APCs cache gets full it empties itself.

          I wonder if the 4 to 8 MB limit isn too low for it to function correctly.

          We are thinking about paying the extra and instead of 128GB ram go fo 256GB ram and try running APC with a 64MB limit thus limiting the number of times the cache gets full.

          If you haven got too many sites on the server yet, could you try increasing APCs memory limit to at least 32MB to see if this solves the problem ?

          Comment


          • #6
            Hi,

            I already had adjusted for that:

            Runtime Settings
            apc.cache_by_default 1

            apc.canonicalize 1
            apc.coredump_unmap 0
            apc.enable_cli 1
            apc.enabled 1
            apc.file_md5 0
            apc.file_update_protection 2
            apc.filters
            apc.gc_ttl 3600
            apc.include_once_override 0
            apc.lazy_classes 0
            apc.lazy_functions 0
            apc.max_file_size 1M
            apc.mmap_file_mask /tmp/apc.g8R04l
            apc.num_files_hint 1000
            apc.preload_path
            apc.report_autofilter 0
            apc.rfc1867 0
            apc.rfc1867_freq 0
            apc.rfc1867_name APC_UPLOAD_PROGRESS
            apc.rfc1867_prefix upload_
            apc.rfc1867_ttl 3600
            apc.serializer default
            apc.shm_segments 1
            apc.shm_size 64M
            apc.slam_defense 1
            apc.stat 1
            apc.stat_ctime 0
            apc.ttl 0
            apc.use_request_time 1
            apc.user_entries_hint 4096
            apc.user_ttl 7200
            apc.write_lock 1

            Comment


            • #7
              Have you tried using xcache instead? We switched all our servers that were using apc to xcache, and have found it significantly more stable.

              Comment


              • #8
                Thanks for the suggestion. I am going to hang out and see what Igor comes up with.

                Thanks
                Frank

                Comment


                • #9
                  Try changing this line :

                  apc.mmap_file_mask /tmp/apc.g8R04l

                  Should be (to use memory and not disk…) :

                  apc.mmap_file_mask=/apc.shm.XXXXXX

                  Comment


                  • #10
                    Ive just noticed, you say APC doesnt keep cache more then 1 minute…

                    Could it be this fastcgid setting ? :

                    FcgidIdleTimeout 60

                    If a fastcgi process is destroyed then its cache will be too…

                    With this set to 60, on a busy site the cache will do its job well but on a site with only a few visits per day the cache will work so long as the visiters dont spend more then 60s before reloading or changing page.

                    Can you try setting it to 180s and see if the cache lasts longer then two minutes ?

                    Comment


                    • #11
                      Hi,

                      I believe this is the main issue:
                      APC is not very effective when using mod_fcgid. It just can share its memory across subsequent requests to the same php code if those requests get routed to seperate php-cgi processes.

                      Chances are there is a work around. Its just above my pay scale LOL

                      Comment

                      Working...
                      X