logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: php APC issue, crashing on shutdown
Author
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Sat 03 Jun '06 14:31    Post subject: Reply with quote

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

PostPosted: Thu 08 Jun '06 20:37    Post subject: PHP Crash Reply with quote

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

PostPosted: Tue 13 Jun '06 9:56    Post subject: Reply with quote

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

PostPosted: Tue 13 Jun '06 15:32    Post subject: Reply with quote

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

PostPosted: Tue 13 Jun '06 17:08    Post subject: Reply with quote

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

PostPosted: Wed 14 Jun '06 12:30    Post subject: Reply with quote

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

PostPosted: Wed 14 Jun '06 12:46    Post subject: Reply with quote

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

PostPosted: Wed 05 Jul '06 13:32    Post subject: Reply with quote

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... Sad

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

PostPosted: Tue 18 Jul '06 20:52    Post subject: Reply with quote

I tried it with default stiings, and custom settings, and both ways my site had greatly improved speeds Very Happy

...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 Embarassed but I have tried to figure it out myself to no avail Sad

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

PostPosted: Tue 18 Jul '06 20:59    Post subject: Reply with quote

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

PostPosted: Tue 18 Jul '06 21:12    Post subject: Reply with quote

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.
Confused

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

PostPosted: Tue 18 Jul '06 21:20    Post subject: Reply with quote

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

PostPosted: Tue 18 Jul '06 21:33    Post subject: Reply with quote

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

PostPosted: Tue 18 Jul '06 22:32    Post subject: Reply with quote

thanks Steffen,

yep that worked, now I feel dumb for asking Very Happy

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

PostPosted: Thu 20 Jul '06 13:46    Post subject: Reply with quote

When you have a Apache crash on shutdown, you can use the .dll at www.apachelounge.com/viewtopic.php?t=565

Steffen
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sun 23 Jul '06 17:03    Post subject: Reply with quote

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

PostPosted: Sun 23 Jul '06 18:26    Post subject: Reply with quote

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


Reply to topic   Topic: php APC issue, crashing on shutdown View previous topic :: View next topic
Post new topic   Forum Index -> Other Software