Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 657979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:53:00+00:00 2026-05-13T22:53:00+00:00

My setup: 4 webservers Static content server (NFS mount) 2 db servers 2 do

  • 0

My setup:

  • 4 webservers
  • Static content server (NFS mount)
  • 2 db servers
  • 2 “do magic” servers
  • An additional 8 machines designated multi-purpose.

I’m writing a wrapper for three caching mechanisms so that they can be used in a somewhat normalized manner: Filesystem, Memcached and APC. I’m trying to come up with examples for use (and what to actually put in each cache).

File System

Handles content that we generate and then statically serve. RSS feeds, old report data, user specific pages, etc… This is all cached to the static server.

Memcached

PHP session data, MySQL query results, generally things that need to be available across our systems. We have 8 machines that can be included in the server pool.

APC

I have no idea. The two “do magic” servers are not part of any distributed system, so it seems likely that they could cache query results in APC and work from there. Past that, I can’t think of anything.

Query Caching

Given the nature of our SQL use, query caching reduces performance. I’ve disabled this.

In general, what types of data should be stored where? Does this setup even make sense?

Is there any use for an APC data cache in a distributed system (I can’t think of one)?

Is there something that I’m missing that would make things easier or more efficient?

Edit: I’ve figured out what Pascal was saying, finally. I had it stuck in my head that I would only be moving a portion of my config / whatever to APC, and still loading the rest of the file from disk. Any other suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:53:00+00:00Added an answer on May 13, 2026 at 10:53 pm

    I’m using the same kind of caching mecanism for some projects ; and we are using APC + memcached as caching systems.

    There are two/three main differences between APC and memcached, when it comes to caching data :

    • APC access is a bit faster (something like 5 times faster than memcached, if I remember correctly), as it’s only local — i.e. no network involved.
    • Using APC, your cache is duplicated on each server ; using memcached, there is no duplication accross servers
      • whic means that memcached ensures that all servers have the same version of the data ; while data stored in APC can be different on each server

    We generally use :

    • APC for data that has to be accessed very often, is quick to generate, and :
      • either is not modified often
      • or it doesn’t matter if it’s not identical on all servers
    • memcached for data that takes more time to generate, and/or is less used.
      • Or for data for which modifications must be visible immediatly (i.e. when there is a write to the DB, the cached entry is regenerated too)

    For instance, we could :

    • Use APC to store configuration variables :
      • Don’t change often
      • Are accessed very often
      • Are small
    • Use memcached for content of articles (for a CMS application, for example) :
      • Not that small, and there are a lot of them, which means it might need more memory than we have on one server alone
      • Pretty hard/heavy to generate

    A couple of sidenotes :

    • If several servers try to write to the same file that’s shared via NFS, there can be problems, as there is no locking mecanism on NFS (as far as I remember)
    • APC can be used to cache data, yes — but the most important reason to use it is it’s opcode caching feature (can save a large amount of CPU on the PHP servers)
    • Entries in memcached are limited in size : you cannot store an entry that’s bigger than 1M (I’ve sometimes run into that problem — rarely, but it’s not good when it happens ^^ )
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It is simple, really. B = -1/2 * A, or… May 15, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer If I understand your question correctly may be this example… May 15, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer _id field is reserved for primary key in mongodb, and… May 15, 2026 at 10:54 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.