php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38678 APC docs need mmap infos
Submitted: 2006-09-01 09:49 UTC Modified: 2010-10-24 16:29 UTC
From: thomas-lists at mysnip dot de Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2006-09-01 09:49 UTC] thomas-lists at mysnip dot de
Description:
------------
coming from
http://news.php.net/php.pecl.dev/4095
pointed here from
http://news.php.net/php.pecl.dev/4096

The APC docs don't tell anything about how memory is used in mmap mode.
e.g. that 
- maximum shm-segment-size told in /proc/sys/kernel/shmmax isn't in effect here
- mmap uses only one segment and currently uses only the size specified in apc-config for the shm-segments (see bug http://pecl.php.net/bugs/bug.php?id=8609 , maybe that changes) 
- currently one can only guess which mode is used but I think the phpinfo tells at least "mmap is enabled" ( see bug http://pecl.php.net/bugs/bug.php?id=8608 at pecl.php.net) 

As mmap-mode is the default nowadays in apc it would be good to tell some more about its configuration :).

If one could add the pros/cons of using mmap over shm it would be great too!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-17 15:45 UTC] bjori@php.net
Gopal: could you help us out here?

 [2010-10-23 17:52 UTC] gopalv@php.net
The shmmax limit is the reason there was a need for multiple segments in the first place.

phpinfo() does mention that MMAP Support is enabled & the locking type used for an install.

mmap() is a nicer and easier way to overcommit memory (i.e the OS will only use physical pages once you read/write a block) reducing the impact of memory allocation at startup.

Also mmap() in that fashion ensures that the system reclaims memory quickly and easily when apache is shut down & restarted.

It also lends itself to some nice tricks

http://notmysock.org/blog/hacks/memory-rowr

Shm mode is kept around just for one reason. It's the SysV standard to do this kind of thing.
 [2010-10-24 16:29 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304704
Log: Fixed bug #38678 (APC docs need mmap infos) with notes from Gopal
 [2010-10-24 16:29 UTC] kalle@php.net
-Status: Assigned +Status: Closed -Assigned To: gopalv +Assigned To: kalle
 [2010-10-24 16:29 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=dee2b4077517137cdeccc0257a4957a98673acec
Log: Fixed bug #38678 (APC docs need mmap infos) with notes from Gopal
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Nov 21 03:00:01 2025 UTC