Results 1 to 3 of 3

Thread: Using memcached to store the opcodes

  1. #1
    Join Date
    Jan 2009
    Posts
    44

    Using memcached to store the opcodes

    Hello friends,

    I know all opcode caches run only with php as an module or with a FastCGI setup because only in this cases the compiled opcodes can be
    reused.But many hosters allow only CGI setups for security and stability reasons. If you want to use an opcode cache in such a setup
    you have to store the opcodes outside the current process so that they survive the process termination and can be read by the next
    process.With memcached there already exists a fast and stable in memory cache. So if XCache do its work but optionally use memcached
    as memory backend for CGI setups.But it will be slower than writing direct to memory but am guessing for large applications it should give better performance than compiling all files in every request.does it makes sense?what you think?

    thanks !!

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Using memcached to store the opcodes

    Normally APC uses shared memory to save its opcode cache. In the case of mod_php this memory is shared between all Apache processes.So a 30MB cache only takes up 30MB even if there are 5 Apache processes.However, when using mod_php, each Apache process does waste a lot of resources as each process contains the PHP interpreter. Thus, when Apache serves static content (html, css, js, image files, etc) it uses a process with the full PHP interpreter loaded. To get around this, some people use FastCGI via mod_fastcgi or mod_fcgi. Using an opcode cache with FastCGI becomes a bit trickier.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Using memcached to store the opcodes

    I wish to get the best caching thing available so that my application is really fast. Obviously I don't want to over cache but I need to at least choose the best thing out there. In that article it says memcached is slow and apc is fast so why is everyone choosing memcached.APC Cache is Fast but it is not distributed so you’re wasting cache and reducing possible hit rate by caching things locally if you have many web servers. MemcacheD is relatively slow but distributed and so you do not waste memory by caching same item in a few places, it is also faster to warmup as you need only one access to bring item into the cache, not access for each of web servers.

Similar Threads

  1. How to store mail files using apple mail store
    By Janya in forum Technology & Internet
    Replies: 3
    Last Post: 06-09-2011, 10:23 AM
  2. Unable to Connect iTunes Store/App Store from the Apple iPad
    By DougWison in forum Portable Devices
    Replies: 4
    Last Post: 22-08-2011, 09:56 AM
  3. When would be the Japanese PSN Store would be up?
    By Gaurika in forum Video Games
    Replies: 5
    Last Post: 16-07-2011, 10:53 AM
  4. Replies: 5
    Last Post: 01-03-2011, 10:14 AM
  5. Easyapache and memcached
    By Bricklayer in forum Networking & Security
    Replies: 6
    Last Post: 23-06-2010, 10:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,210,506.93303 seconds with 16 queries