Caching file_get_contents output inside APC (Performance improvement).
Hi,
APC creates a mmap which is used for caching compiled php response. Besides
this APC provides API to cache user data into this mmap. There are many php
apps which uses file_get_contents to read the static files. If APC can cache
these files in it's mmap, it will improve file_get_contents performance.
Based on the above idea, I developed a patch which stores the file_get_contents
output in APC's cache. In this patch, APC intercepts the calls of
file_get_contents and replaces it with apc_file_get_contents function. If file
is a full path and entire file is requested then APC cac
|
10/26/2009 8:36:45 PM
|
0
|
basant.kukr...@gmail.com (Basant Kukreja)
|
fix inode/device usage for win32, take #1
--00c09ffb4d2ee7d4e80476257ee7
Content-Type: text/plain; charset=ISO-8859-1
hi,
This is a first attempt (draft) to fix the pecl bug #16860
(http://pecl.php.net/bugs/bug.php?id=16860).
Here are the changes I made so far:
- add apc_ino_t and apc_dev_t
- native ino_t/dev_t on non windows platform
- unsigned int64 on windows
- use string for the inode and device key (cache info and iterator)
- device uses now the volume serial number (part of the file information)
- inode uses now the file id (part of the file information)
- add zend_file_handle support to apc_cache_make_
|
10/17/2009 6:15:21 PM
|
0
|
pierre....@gmail.com (Pierre Joye)
|
Updates to 4.0 TODO
Added what I have in my notes for 4.0 items/research: http://wiki.php.net/pecl/apc/todo/40
-shire
|
10/10/2009 9:15:18 PM
|
0
|
sh...@tekrat.com (shire)
|
apc(4), php4 support?
Hi All!
Do we really support php4 for APC? Reading the recent commits in APC4
I was surprised to read php4 fixes :)
Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
|
10/10/2009 1:12:25 AM
|
0
|
pierre....@gmail.com (Pierre Joye)
|
APC + Apache SIGHUP
Apologies in advance if this isn't the right list to use for support,
but it's the only APC-specific list I could find.
I did some digging around, and I couldn't find any mention of this on
the web or in the APC documentation (outside of one person causing
this behavior intentionally).
We do some pretty standard Apache log rotation on our web cluster with
logrotate; move the file to an archival point, send a SIGHUP to Apache
so it releases the open file handle, and then bzip2 up the data for
archival purposes.
However, what we're seeing happen is that when Apache receives the
S
|
10/7/2009 10:20:37 PM
|
0
|
nat...@livemocha.com (Nathan Clemons)
|
Time for a Meeting?
Hi,
I've been out of the whole conference thing for a year and I haven't
talked to enough people about apc & what it needs, what works and
what doesn't in a while.
So how about a meeting on irc? I'm OK with a US afternoon slot,
so how does 2 PM PST on thursday sound?
The code in SVN pretty much works to most of the requirements I have
in mind, but I'd like to steal as much of apc-4.0 features into the
3.1.x branch without breaking api BC.
Rest of the agenda is wide open :)
Cheers,
Gopal
--
If I learn from my mistakes, pretty soon I'll know everything.
|
10/6/2009 6:36:14 PM
|
0
|
gop...@php.net (Gopal V)
|
Accessing Shared Memory of the webserver from CLI?
--000e0cd4cd763246f604681673a8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi,
Is there a way to access the same shared memory segment from the cli as the
webserver? What I'm trying to accomplish is updating keys from the command
line.
Thanks
Ben
--000e0cd4cd763246f604681673a8--
|
4/21/2009 8:25:38 PM
|
0
|
benoit.aubuc...@gmail.com (Benoit Aubuchon)
|
remove apc.include_once_override ?
I like the original intent and have found this useful in the past but currently I feel like there's a lot of issues with the apc.include_once_override option, and it's not always obvious what these are. Considering that there's similar optimizations in later versions of PHP, and that I don't see any good way to fix the concurrency issues with this optimization, I vote that we just remove it or at least disable it and make it a non-obvious option? Any objections or interest in salvaging it?
http://pecl.php.net/bugs/bug.php?id=15356
http://pecl.php.net/bugs/bug.php?id=16086
-shire
|
4/6/2009 8:09:59 PM
|
0
|
sh...@tekrat.com (shire)
|
[RFC] APC/PHP Lazy Loading
I've just checked into APC CVS preliminary support for Lazy Loading classes and functions. This means that rather than copying function entries into EG(function_table) and EG(class_table) when an include happen it will mark the functions/classes as available and only actually insert them into the tables when they are called. This is done via hooks added into the various hash table lookups in PHP. I've placed a patch for PHP_5_3 at:
http://tekrat.com/downloads/bits/apc_lazy_php53.patch
You should be able to apply the above patch to the latest PHP_5_3 branch, and recompile the latest
|
2/22/2009 12:10:38 AM
|
0
|
sh...@tekrat.com (shire)
|
pcre dependencies on php-5.2.2+
It looks like pcre header files were not being installed for us prior to php-5.2.2 when compiled against the non-bundled library.
http://pecl.php.net/bugs/bug.php?id=15968&thanks=1
Do we want to try and hack-up the code further to support php-5.2.2 or should we just make a hard dependency on this? Alternatively we could add an option to disable pcre support in APC so it would compile, or they can recomplie older versions with the bundled pcre libraries to get APC working. I'm not a big fan of trying to get the broken installs to work with APC, as it'll just make things more compli
|
2/16/2009 11:34:18 PM
|
0
|
sh...@tekrat.com (shire)
|
atomaticity/thread safeness of apc shared memory functions + mutexes
Couldn't find it in the docs, so I hope you know it:
Are the userland apc cache functions (apc_add, apc_fetch, apc_delete
etc) *thread-safe/atomic*?
Also: I need to ensure that conncurrent access to shared memory doesn't
get me in race conditions. Wouldn't it be nice if apc could offer mutex
functions and the like? There is a semaphore extension for php, but it
is *nix-only according to the docs. The need for synchronization
mechanisms arise almost allways when using shared memory.
|
12/24/2008 10:45:23 PM
|
0
|
excepti...@hotmail.com (Exception e)
|
atomaticity/thread safeness of apc shared memory functions + mutexes
Couldn't find it in the docs, so I hope you know it:
Are the userland apc cache functions (apc_add, apc_fetch, apc_delete
etc) *thread-safe/atomic*?
Also: I need to ensure that conncurrent access to shared memory doesn't
get me in race conditions. Wouldn't it be nice if apc could offer mutex
functions and the like? There is a semaphore extension for php, but it
is *nix-only according to the docs. The need for synchronization
mechanisms arise almost allways when using shared memory.
|
12/24/2008 10:13:12 PM
|
0
|
excepti...@hotmail.com (Exception e)
|
[Fwd: Re: [PECL-DEV] [ANNOUNCEMENT] APC-3.1.2 (beta) Released.]
PECL Announce wrote:
> The new PECL package APC-3.1.2 (beta) has been released at http://pecl.php.net/.
How's the PHP 5.3 support in this version - or what are the plans for support?
Chris
--
Email: christopher.jones@oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/f8jad
|
12/18/2008 5:11:02 AM
|
0
|
christopher.jo...@oracle.com (Christopher Jones)
|
Feature request: ability to filter out entire directories/folders
I would like to suggest a new feature: ability to exclude php files from
entire folders. This is useful when we have limited RAM on the host machine
and would then like to exclude the admin panels for the CMS or blogging
software installed on the system. At the moment the filtering parameter only
looks at the file name and ignores the folder or the full path - hence there
is no real way to achieve this setup.
I hope this is posted in the right place, otherwise let me know where and I
appologize.
Thank you!
-Ron Peled
|
12/10/2008 6:53:13 PM
|
0
|
ron.pe...@activoinc.com ("Ron Peled")
|
APC-3.1.0?
What's our new release schedule for APC-3.1.0? Maybe we should do an
Alpha release to initiate some user testing?
-shire
|
11/11/2008 9:25:31 PM
|
0
|
sh...@tekrat.com (shire)
|
Politics
silliness fido offering flying lewiss twotothen weenie floating threetimeslonger
|
10/26/2008 11:03:34 PM
|
0
|
...@carpinterialuque.com (Amy)
|
Politics
darkness watched presenting noted blinking rparen gestures straightfaced counterculture
|
10/25/2008 4:00:42 PM
|
0
|
...@carpinterialuque.com (Amy)
|
Politics
cancellation quarter tucked termed incorporated frobnitz partisans diablo nuke
|
10/23/2008 10:00:54 PM
|
0
|
...@carpinterialuque.com (Amy)
|
Politics
overrunning commandline thenhead consoles sieberpuhnk birkenstocks teletypes nyet religions
|
10/21/2008 10:02:54 AM
|
0
|
...@carpinterialuque.com (Amy)
|
Politics
mahnjed weapons diverging pufferfish wokked protections semantics circling supposed
|
10/8/2008 10:01:47 AM
|
0
|
...@carpinterialuque.com (Amy)
|
Politics
snarf feynmans smashed firechild execlp evaluations comicstrip understandable commanders
|
10/4/2008 10:00:58 PM
|
0
|
...@carpinterialuque.com (Amy)
|
APC Wiki
I've taken the liberty of creating an APC wiki like we discussed.
I've added all the stuff I could think of that's on my plate. I've
forgotten the date Gopal tossed out for the next release so we'll
probably want to tag that on along with everyone else's todo's.
http://wiki.php.net/pecl/apc
Let me know if this should be in another location/URL.
-shire
|
7/26/2008 11:08:22 PM
|
0
|
sh...@facebook.com (shire)
|
my_log vs. zend_error
my_log() (called by apc_[ewn]print() functions) in apc.c currently
prints directly to stderr, my preference would be to have this go
through the standard error handling functionality, but I want to make
sure there's not a reason for this or functionality that might break
for others ?
-shire
|
7/2/2008 9:55:28 PM
|
0
|
sh...@tekrat.com (shire)
|
RFC: APCIterator class
Here is a rough patch of what I have currently in my working copy for
an APCIterator class. Check out the tests for some examples but it
looks something like:
<?php
$it = new APCIterator('user', $regex, $chunk_size);
foreach($it as $key=>$value) {
echo $key."\n";
}
?>
Some code probably needs to be cleaned up and I need to add a delete
() method along with the ability to only dump entry values rather
than the full entry info (which it does by default currently).
Locking names also conflict with sma.c which I'll need to resolve.
The primary purpose here is to all
|
6/29/2008 6:33:36 PM
|
0
|
sh...@tekrat.com (shire)
|
Locking mechanism cleanup
I'm thinking we could probably remove some of the locking mechanisms
like Futex Locks and TSRM locks to tidy up the code a bit. Let me
know if you have any objections/thoughts on this, otherwise I'll
clean house on a couple of these.
I haven't heard of anyone using SEM locks, but it seems like we
should keep those for compatibility reasons (?), any thoughts?
-shire
|
6/17/2008 6:42:39 PM
|
0
|
sh...@tekrat.com (shire)
|
APC for PHP 5.3 on Windows
--------------060202040005060005040503
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
the attached patch should repair the compilation of APC for PHP 5.3 on
Windows.
Regards
Jaroslav Hanslik
--------------060202040005060005040503
Content-Type: text/plain;
name="apc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="apc.diff"
--- apc.c 2008-05-13 17:51:46.000000000 +0200
+++ apc-patched.c 2008-06-09 20:17:30.375000000 +0200
@@ -32,7 +32,12 @@
/* $Id: apc.c,v 3.22 2008/05/13 15:51:46 gopalv
|
6/9/2008 6:29:26 PM
|
0
|
konfere...@kukulich.net (=?ISO-8859-2?Q?Jaroslav_Hansl=EDk?=)
|
apc_store and apc_fetch between apache processes
Is APC cache memory shared by all apache httpd child processes or does
each httpd process have its own APC cache memory?
If I call apc_add('foo','bar') from httpd child 1
And later call apc_fetch('foo') from httpd child 2 (a different linux
process)
will the apc_fetch return 'bar' ?
Sorry to post this here (probably not the appropriate venue). My
comp.lang.php newsgroup posting went unanswered, and I could not find any
APC documentation which would answer this question.
Andrew
|
5/20/2008 10:37:06 AM
|
0
|
lyc...@m2s.com ("Andrew Lyczak")
|
apc_delete_file() ?
I'd like to add a function that removes a specific compiled file from
the cache. My initial thought is to have the function, given a
filename:
- use apc_cache_make_file_key() to determine the cache key for the filename
- use apc_cache_find_slot() to determine the slot for the cache key
- call remove_slot() on the slot to either free it immediately or put
it on the deleted list if its refcount is > 0
- and optionally have the function call process_pending_removals() to
flush the deleted list (if possible)
Another possibility, more useful for bulk deletes (at least on
fullpath entr
|
5/14/2008 3:39:31 PM
|
0
|
david.sk...@gmail.com ("David Sklar")
|
APC 3.0.17 - regression?
Hi,
I saw the security notice and updated 3.0.17 release today, so I decided
to upgrade my installation. Now Wordpress (the only PHP application I
have installed to test) works correctly on the first page load, but the
second (presumably cached) load cuts the HTML document half way. This is
in Apache's error log:
zend_mm_heap corrupted
zend_mm_heap corrupted
[Wed Mar 26 15:47:22 2008] [notice] child pid 386 exit signal
Segmentation fault (11)
If I go back to 3.0.16 I have no problems. The precise server setup is:
Ubuntu 7.10 AMD64
Apache 2.2.4-3ubuntu0.1
PHP 5.2.3-1u
|
3/26/2008 8:44:52 PM
|
0
|
...@esuna.co.uk ("Jay L. T. Cornwall")
|
3.0.x vs. 3.1.x
It looks like we have a regression:
http://pecl.php.net/bugs/bug.php?id=13505
The largest change from 3.0.16 was the expunge callback stuff. Gopal
has new code for 3.1.0 that will make cache expunges much easier and
this code will need to change completely. And since we don't actually
use it in 3.0.x, I think we should just pull it from the 3.0 tree and
see if that fixes the MediaWiki issue.
We should also fix:
http://pecl.php.net/bugs/bug.php?id=13504
Probably means we need a 3.0.18 sometime soon.
-Rasmus
|
3/26/2008 4:12:29 PM
|
0
|
ras...@lerdorf.com (Rasmus Lerdorf)
|
3.0.17
Anyone have anything they want to squeeze into 3.0.17?
We need a quick release to address CVE-2008-1488
-Rasmus
|
3/25/2008 5:45:32 AM
|
0
|
ras...@lerdorf.com (Rasmus Lerdorf)
|
Support for multiple memory segments.
I'm working on multiple memory cache support which has been on my
todo for a long time now (used for different cache behavior, testing,
lock performance, smaller coredumps with meaningful information, and
larger user caches).
Do we still need to support the multiple segments to work around
system memory limitations with traditional shared memory segments? I
believe everyone can use mmap now to get around this, but perhaps
there's some system out there that I'm not aware of that requires this??
If we don't need it I'll drop support in my patch as multiple-within-
mu
|
3/24/2008 12:47:03 AM
|
0
|
sh...@php.net (Brian Shire)
|
Head fails to compile on Windows
--------------080402000003090908020503
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
The latest CVS Head fails to compile on Windows using VC6. It appears to
be caused by the signal system on Windows being completely different to
that of POSIX compliant operating systems.
I've attached the build log.
Scott
--------------080402000003090908020503
Content-Type: text/plain;
name="apc compile.log"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="apc compile.log"
Qzpcd29ya1xwaHBfNV8yLWRldj5ubWFrZ
|
1/10/2008 6:37:29 PM
|
0
|
scott...@php.net (Scott MacVicar)
|
APC b0rkage upcoming
Hi,
I'm going to take a week or two slap up apc-3.1. My rewrite is in an
un-mergeable mess, but I have a good idea on how to do it again quickly.
The first bit of code is already pushed in
http://cvs.php.net/viewvc.cgi/pecl/apc/apc_pool.c?view=log
Feel free to review it/fix bugs if you find any. I'll be pushing
it into sma land and on top of apc_compile.c by friday.
Cheers,
Gopal
--
Yea from the table of my memory
I'll wipe away all trivial fond records.
-- Hamlet
|
1/8/2008 6:00:56 PM
|
0
|
gop...@yahoo-inc.com (Gopal V)
|
3.0.16
I plan on rolling APC 3.0.16 today. Christian Seiler finally fixed that
damn cache-full allocator bug that has been annoying us for ages. See
http://news.php.net/php.pecl.dev/4951 for details. I have also rolled
Lucas signal unmap patch in. If anybody is actually online and want to
do some final testing, please do so and let me know if I missed anything.
-Rasmus
|
12/26/2007 10:41:32 PM
|
0
|
ras...@lerdorf.com (Rasmus Lerdorf)
|
[PATCH] APC signals + coredump shared memory unmapping
--B_3281224808_9444842
Content-type: text/plain;
charset="US-ASCII"
Content-transfer-encoding: 7bit
Hi,
I would like to propose the attached patch against APC CVS HEAD. It provides
the configurable ability to trap coredump related signals and unmap the APC
shared memory segment while still calling any previously installed signal
handlers. This feature would be enabled via a new apc ini entry,
apc.coredump_unmap, which is defaulted to disabled.
Although this will technically work in production environments the
functionality was engineered to solve a problem in shared developme
|
12/23/2007 11:20:05 AM
|
0
|
lu...@facebook.com (Lucas Nealan)
|
APC Binary Dump patch
I've made the patch for dumping and loading the APC cache available.
If you're interested take a look and see what you think, I'm looking
for any problems and what other use cases people might have for it.
http://tekrat.com/apc_bindump/
Thanks,
-shire
|
11/13/2007 6:27:51 AM
|
0
|
sh...@php.net (Brian Shire)
|
apc.stat_ctime
Is it possible to add apc.stat_ctime to the php.net documentation? I
just kicked myself looking through the source code to make a similar
patch and found it was already there but undocumented.
--
Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/
Windows is the path to the darkside...Windows leads to Blue Screen. Blue
Screen leads to downtime. Downtime leads to suffering...I sense much
Windows in you...
|
6/30/2007 8:33:39 AM
|
0
|
i...@a-wing.co.uk (Andrew Hutchings)
|
Ideas for APC 3.0.15/16
Hi,
I'm sort of playing around with a lot of ideas for apc 3.0.15,
to be planned out slowly now and done in the 1st week of Jul.
First up, how about a persistant APC user cache ? Something which
dumps everything without a TTL into a serialized data dump
on MSHUTDOWN and re-loads it in MINIT.
Second, a way to compile a large number of files and throw them
into cache in one go. sort of like apc_compile(), but in batch
mode, without inserting them as and when they are compiled ?
This in combination with the nostat mode should make it relatively
easy to avoid cache slams.
And th
|
6/20/2007 5:37:15 AM
|
0
|
gop...@yahoo-inc.com (Gopal V)
|
Spurious writes to /tmp
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I'm in the process of setting up a CentOS 5 installation, which ships
with a tightened SELinux policy. APC is installed and working well,
however I notice that on any access to a PHP script - or, confusingly,
any CGI script also - these warnings are generated:
avc: denied { read, write } for comm="test.sh" dev=dm-0 egid=48 euid=48
exe="/bin/bash" exit=0 fsgid=48 fsuid=48 gid=48 items=0
name=".apc.ZEAkwD"
Elaborated by sealert:
Source Context user_u:system_r:httpd_sys_script_t
Target Context
|
5/6/2007 3:19:25 PM
|
0
|
...@esuna.co.uk ("Jay L. T. Cornwall")
|
Compile error
Hello,
APC does not compile on Windows currently due to undefined variable
len (seen in the patch). Does this patch look like a correct fix?
http://phpfi.com/230624
Edin
|
4/29/2007 4:52:57 PM
|
0
|
e...@krug.dk (Edin Kadribasic)
|
APC showing wrong pages
------=_Part_12570_21496387.1174225315035
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello,
I noticed APC returning the cached values of the wrong pages. I'd bring up
x.php in my browser and see (apparently cached) content from y.php, then
reload again and see the (correct) content from x.php.
Is this a known problem? Is the current version of APC recommended for prod
environments?
Thanks,
--Craig
Version info:
- APC 3.0.13
- Apache/2.0.55 (Ubuntu)
- PHP/5.1.2
------=_Part_12570_21496387.
|
3/18/2007 1:41:55 PM
|
0
|
cr...@memorizable.org ("Craig Muth")
|
Apc path canonicalization patch
Hi,
It is really annoying to have to change each and every file in
all libs you use to have absolute include paths, so I've got a
quick patch to "work around" that. I've so far tried not to
cache anything differently from what Zend throws out, so
anybody care to comment on this patch ?
http://t3.dotgnu.info/code/apc-path-canonicalize.patch
It converts include ("x.php") into include("/..fullpath/x.php")
before caching the opcodes if apc.stat = 0. Put it into the
"will be checked in eventually" optimizer or just wrap it
with yet another ini check ?
Cheers,
Gopal
--
The dif
|
3/16/2007 6:41:28 AM
|
0
|
gop...@yahoo-inc.com (Gopal V)
|
3.0.13 Released
I just pushed out 3.0.13 so we can start breaking things again. There
are a bunch of internal fixes from Gopal and Brian Shire in this release
and a couple of user-visible features as well. The user-visible stuff
being:
Pthread mutex and spin locks
Brian Shire did all the legwork on this. We stole (with permission) the
spin locking code from PostgreSQL after I had a chat with Bruce Momjian
about PostgreSQL internals. It turns out PostgreSQL has a very similar
shared memory locking requirement and they had already done all the work
of writing a cross-platform spin lock implemen
|
2/24/2007 11:27:33 PM
|
0
|
ras...@lerdorf.com (Rasmus Lerdorf)
|