Author |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Sat 03 Jun '06 14:31 Post subject: |
|
|
Do note that this gives an error when stopping apache but it seems harmless.
Running 2 diferent instances of Apache is also broke when using this... if both use PHP |
|
Back to top |
|
hoov
Joined: 08 Jun 2006 Posts: 1
|
Posted: Thu 08 Jun '06 20:37 Post subject: PHP Crash |
|
|
PHP appears to crash twice when it tries to unload its modules.
I've tested this with Apache 2.0.58, and Apache 2.2 combined with PHP 5.1.4.
Any ideas?
Does this happen for you? |
|
Back to top |
|
Lutz-R. Frank
Joined: 03 Dec 2005 Posts: 21 Location: Germany
|
Posted: Tue 13 Jun '06 9:56 Post subject: |
|
|
Same here - APC causes a crash on Apache shutdown... even during a not so gentle process kill via Task Manager.
Something else - I run a PHP Gallery (Gallery2 from Menalto.com - a lot of Smarty templates used) which looks to be quite considerably faster if APC is running - but - I not able to open the Single-Image page - they ended first in blank pages (until I cleared the OP cache) and displays broken images now for the Image but loads the page.
Any idea what I could tune to get APC up fully ?
Thanks,
Lutz |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Tue 13 Jun '06 15:32 Post subject: |
|
|
Lutz-R. Frank wrote: | Same here - APC causes a crash on Apache shutdown... even during a not so gentle process kill via Task Manager.
Something else - I run a PHP Gallery (Gallery2 from Menalto.com - a lot of Smarty templates used) which looks to be quite considerably faster if APC is running - but - I not able to open the Single-Image page - they ended first in blank pages (until I cleared the OP cache) and displays broken images now for the Image but loads the page.
Any idea what I could tune to get APC up fully ?
Thanks,
Lutz |
Have you tried the zend optimizer... haven't used it in a while... but IIRC it does give a boost aswel snce it cahces the pages in a mroe compact form that can get executed faster. |
|
Back to top |
|
Lutz-R. Frank
Joined: 03 Dec 2005 Posts: 21 Location: Germany
|
Posted: Tue 13 Jun '06 17:08 Post subject: |
|
|
Hi Jorge,
currently I'm running Zend Optimzer 3.0.1 - and get at least performance figures as with eAccelerator. I had the impression APC was a bit faster on the 'normal' pages - but have no benchmarks performed.
Lutz |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Wed 14 Jun '06 12:30 Post subject: |
|
|
Lutz-R. Frank wrote: | Hi Jorge,
currently I'm running Zend Optimzer 3.0.1 - and get at least performance figures as with eAccelerator. I had the impression APC was a bit faster on the 'normal' pages - but have no benchmarks performed.
Lutz |
I noticed that APC was a bit faster or so it seems... nto to mutch though about 2-3ms on a few pages i tried.
there isa huge gap between PHP and PHP+Zend though i its better than nothing ^^ |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Wed 14 Jun '06 12:46 Post subject: |
|
|
I am using now APC for some time and have no crashes, it only crashes when shutting down the server (but I stop/start the seldom).
I also had that when I clear the Opcode Cahse it crahses, so I do not use that feature.
I have reports that you need enough memory, I have 2 Gb and the APC cashe (apc.shm_size) is 128 MB here. Also I have set memory_limit = 64M in php.ini.
Steffen |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 05 Jul '06 13:32 Post subject: |
|
|
now I have testet apc. Works fine for me, as long I Don't use the acp.php for controlling. All stats are ok, but when I click the User Cache Entries button my apache crashes...
Also my seflmade phpOnlineEditor don't work exacly with acp. Caching is the death for it!
Is there a way to disable that for single scripts? Yes! So I had to disable apc!
Code: |
//before all disable apc
@ini_set("apc.enabled","0");
|
The editor and some other script work much slower with apc. |
|
Back to top |
|
snuggles
Joined: 05 Jul 2006 Posts: 11 Location: right here
|
Posted: Tue 18 Jul '06 20:52 Post subject: |
|
|
I tried it with default stiings, and custom settings, and both ways my site had greatly improved speeds
...but... is seemed to kill a few of my most dynamic pages, giving me white pages instead of the expected resault.
is there a way to "turn off" APC for specific pages?
I admit, I've very new to running a server, and I often find the documentation confusing but I have tried to figure it out myself to no avail
is it possible?
cheers,
snuggles
PS. I've also tried caching images via httpd.conf with:
ExpiresActive On
ExpiresByType text/css "access plus 1 day"
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
but I'm not sure if it's working. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 18 Jul '06 20:59 Post subject: |
|
|
You can try:
apc.filters =
See the manual at http://nl3.php.net/apc
Steffen |
|
Back to top |
|
snuggles
Joined: 05 Jul 2006 Posts: 11 Location: right here
|
Posted: Tue 18 Jul '06 21:12 Post subject: |
|
|
thanks for the fast reply, I've read that, but I guess I'm too n00bish to under stand that part...
Quote: | apc.filters string
A comma-separated list of POSIX extended regular expressions. If any pattern matches the source filename, the file will not be cached. Note that the filename used for matching is the one passed to include/require, not the absolute path. If the first character of the expression is a + then the expression will be additive in the sense that any files matched by the expression will be cached, and if the first character is a - then anything matched will not be cached. The - case is the default, so it can be left off. |
the page I don't want cached (amoung others) is called imdb_temp.php found in C:\web\imdb
but from the manual I just don't get what to add as a filter.... is it as simple as adding "imdb_temp" to the filters?
I hope not, or I will feel really dumb for posting this post lol
thanks,
snuggles |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 18 Jul '06 21:20 Post subject: |
|
|
Also speed up your PHP App's is to use pre-Inkrementoperators instead of post Inkrementoperators
Code: |
++$a is faster as $a++
|
Why that?
the pre Inkrementoperators count different! So you have to how to use them. But if you don't use it for math. functions, there is no difference
now to the why question: for that let's see asm code of the Inkrementoperators
Code: |
mov eax, [ebp + 4]
inc eax
xchg eax, [ebp + 4]
(i++)
mov eax, [ebp + 4]
inc eax
mov [ebp + 4], eax
(++i)
|
With the Postfix-Inkrement is the Variable inkremented,but the old Value must returned. Thats why there is a temporary variable is needed.
The prefix inkrement return the new value, so no temp variable is needed, faster! That is for all operators. This effect uses also the zend optimizer. http://www.zend.com/store/pdf/ZendOptimizer_TechFAQ.pdf
On small servers and with hightraffic it is recomment to use the prefix inkrement operator! |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 18 Jul '06 21:33 Post subject: |
|
|
Yep, the phrase "POSIX extended regular expressions" is maybe confusing.
"imdb_temp" should work, although I never used it, all my scripts are working with APC.
Maybe an include script is causing your issue, so when it is still not working search in imdb_temp for .php include file(s) which you exclude (comma seperated)
Steffen |
|
Back to top |
|
snuggles
Joined: 05 Jul 2006 Posts: 11 Location: right here
|
Posted: Tue 18 Jul '06 22:32 Post subject: |
|
|
thanks Steffen,
yep that worked, now I feel dumb for asking
and I must say APC is working great for me. I have no way to benchmark it, so it's just an observation, but the page load times are fantastac with it running, without it my site can slow down to a crawl at times.
thanks again,
snuggles |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 23 Jul '06 17:03 Post subject: |
|
|
I contacted one of the developers of APC, his answer:
No idea, I don't do Windows at all.
Not a very suprising answer from a php-guy, get mostly this kind of answers.
Steffen |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sun 23 Jul '06 18:26 Post subject: |
|
|
Did you told him about the "working" version without tsrm_shutdown() ?? Maybe apc uses resources this function want to free ´but can't caused by apc?? |
|
Back to top |
|