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 6146035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:53:05+00:00 2026-05-23T18:53:05+00:00

I’ve just installed APC to cache my PHP code on my Ubuntu VPS server.

  • 0

I’ve just installed APC to cache my PHP code on my Ubuntu VPS server. Using

sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

This worked fine. However, I encounter some problems increasing the chunk of RAM allocated to APC. If I run apc.php it gives me this information about the shared memory.

Shared Memory   1 Segment(s) with 30.0 MBytes (mmap memory, pthread mutex locking) 

Even though I configured

apc.shm_segments    3

Not setting the default

apc.shm_size    30

In addition I’ve got the problem that as soon as I set apc.shm_size in apc.ini or php.ini apache hangs on restart/graceful and wont come up.

My questions:
1. If the memory allocated to APC is apc.shm_size * apc.shm_segments why can I only see 90M?
2. Has got anyone had the problem with the hanging Apache on setting of apc.shm_size? How would I fix that?

Many thanks!

  • 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-23T18:53:06+00:00Added an answer on May 23, 2026 at 6:53 pm

    You should check the kernel max size for shared memory. On debian-like distribution it’s quite low (and ubuntu is a debian-like).
    Altering it via sysctl.conf could help you.? Get current value with:

    sysctl -a  | grep shmmax
    

    It’s a value in Bytes.

    This could explain apache crash when you set a too big number (but you should have something about it in error.log).

    Seem for this response that apc.shm_segments is not always used by APC. We can see some explanations here: http://www.php.net/manual/fr/apc.configuration.php#94529:

    If you’ve configured APC to use memory mapped files (with the –enable-mmap option), the shm_segments setting is ignored unless you specify a file mask via the mmap_file_mask setting.
    Which could be fixed by giving a value to apc.mmap_file_mask configuration setting (see link).

    But as said in this comment, using several shared segments is certainly worst as using a big one. there is at least two big application which makes heavy use of big shared memory and which always needs an alteration of the kernel settings for that, it’s Varnish and PostgreSQL. Both made the choice of using a big shared segment instead of several.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker

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.