php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58819 Specifying apc.shm_size
Submitted: 2009-08-20 05:50 UTC Modified: 2009-08-25 18:51 UTC
From: apc at tequilasolutions dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.1.6 OS: Centos 5
Private report: No CVE-ID: None
 [2009-08-20 05:50 UTC] apc at tequilasolutions dot com
Description:
------------
Hi,

I noticed my apc was cache fulling all the time so tried to up the shm_size but could not get it to be higher than the default 30M.

extension=apc.so
apc.enabled=1
apc.shm_size=128M

This results in shm still being 30M. After hunting around checking my kernel max shm size I found actually the problem is the 'M'.

extension=apc.so
apc.enabled=1
apc.shm_size=128

works as expected. Other config such as :

apc.max_file_size = 1M

works as expected so I though this was a bit inconsistent.

Cheers,

Steve


Reproduce code:
---------------
See description.

Expected result:
----------------
APC should parse memsizes with the 'M' or 'G' suffixes.

Actual result:
--------------
APC requires an int value for shm_size to work as expected.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-20 10:56 UTC] kalle@php.net
Hi

apc.shm_size has to be an integer, the size defined is megabytes since we do a manual multiply and dont use atoi on it internally. I don't know if it makes sense to use atoi, since theres probably a design decision behind it
 [2009-08-21 09:49 UTC] gopalv82 at yahoo dot com
This is "expected behaviour".

But the expected behaviour is confusing... we should fix this to behave consistently with the other size params.

Added this to the 3.1.4 TODO.
 [2009-08-25 18:51 UTC] gopalv82 at yahoo dot com
http://news.php.net/php.pecl.cvs/12845

Mmm... I like your bug reports.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC