View Issue Details

IDProjectCategoryView StatusLast Update
0000617PHP for OS/2, ArcaOS & eComStation (PHP versions v8.x v7.x v5.x)Feature Requestpublic2022-05-14 06:46
ReporterLewisR Assigned Topsmedley  
PrioritylowSeverityminorReproducibilityN/A
Status resolvedResolutionno change required 
Summary0000617: Investigate building Zend OPcache for PHP 5.3 - 5.5
DescriptionIt looks like APC is becoming passé. According to:

https://wiki.php.net/rfc/optimizerplus

OPcache is to be merged with the 5.5 distro, and Zend is offering the code under their license.
Additional InformationI'm not necessarily convinced that any of my sites (mainly WordPress, a couple Joomla installs, and now, TYPO3, with some Mantis and MediaWiki thrown in for good measure) would benefit, though I'll try some isolated testing on a *nix box.

Meanwhile, if you're bored, Paul, here's the link to the source, which is supposed to be good for PHP 5.2 on up (though they say that 5.2 support is likely to be orphaned):

https://github.com/zendtech/ZendOptimizerPlus/

Cheers

Lewis
TagsNo tags attached.
Attached Files
00C3_01.TRP (56,205 bytes)
008F_05.TRP (41,790 bytes)

Activities

psmedley

2014-07-20 09:20

administrator   ~0002783

I have my hands full with apr-unix right now - but will try get to it...

psmedley

2014-08-01 09:54

administrator   ~0002792

You are running PHP 5.3?

LewisR

2014-08-01 14:10

developer   ~0002793

Indeed, I am, Paul (5.3.28).

psmedley

2014-08-01 21:08

administrator   ~0002794

Not tested at all, but please try http://smedley.id.au/tmp/opcache.zip

Needs mmap.dll and pthr01.dll from rpm

LewisR

2014-08-02 02:18

developer   ~0002795

Not quite there yet, Paul. ;-)

[Fri Aug 01 22:04:28 2014] [info] mod_ssl/2.2.27 compiled against Server: Apache/2.2.27, Library: OpenSSL/1.0.1h
Fri Aug 1 22:04:30 2014 (537390048): Fatal Error Unable to allocate shared memory segment of 134217728 bytes: mmap: Permission denied (13)
Creating 00C3_01.TRP

The above is with php.ini configured as:

zend_extension=j:/APPS/php5/modules/opcache.dll

[opcache]
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

(The same error occurs if using the default memory consumption of 64MB.)

[j:\apps\apache2]dir j:\usr\lib\mmap.dll

11-02-11 12:14 8,574 124 mmap.dll

[j:\apps\apache2]dir j:\usr\lib\pthr01.dll

 4-25-14 15:49 7,879 124 pthr01.dll

PMdll reports intermittent issues loading gcc444.dll (even after I have libpath set as I normally do to start Apache), but I don't think that's it. Both mmap.dll and pthr01.dll are in libpath. Is there any way to test mmap to make sure that it is working as expected? Both modules seem to load their dependencies (according to PMdll).

TRP file, attached.

LewisR

2014-08-02 02:22

developer   ~0002796

I should add the following:

The above was run on my ThinkPad t43, using the 14.105_UNI kernel(though I got similar results on my test server).

and

THANK YOU for taking the time and effort to build (and hopefully debug) this!

Cheers

LewisR

2014-08-02 02:30

developer   ~0002797

Possible help for the permission denied message (WAG):

http://stackoverflow.com/questions/17202741/why-does-mmap-fail-with-permission-denied-for-the-destination-file-of-a-file-c

psmedley

2014-08-02 09:46

administrator   ~0002798

http://smedley.id.au/tmp/opcache.zip is refreshed - no idea if it works, bu apache2/php starts now

It was a limitation of our mmap implementation.

I had to add code to make it work with out mmap

LewisR

2014-08-02 16:25

developer   ~0002799

Thanks, Paul. Testing now (late start on the day).

Did you mean "make it work with *our* mmap," or "make it work *without* mmap," BTW?

;-)

LewisR

2014-08-02 17:01

developer   ~0002800

Scratch that last question, Paul. Please see 008F_05.TRP, attached.

Apache starts, and non-PHP requests respond fine. As soon as PHP is called, we get an "uncommitted memory allocated by MMAP" error thrown from LIBC065.

Getting closer, though (I think). At least we can start, now.

Thanks!

psmedley

2014-08-02 22:14

administrator   ~0002801

hmmm... I going to have a crack at building a PHP 5.5 built with opcache enabled - at least then configure will try detect which mmap features are implemented rather than me hacking things manually... will let you know how I go.

fyi I can repeat the failure you're seeing here too

LewisR

2014-08-14 04:54

developer   ~0002815

Paul, my mmap seems to be:

Name : mmap
Arch : i386
Version : 20111102
Release : 8.oc00
Size : 778 k
Repo : installed
From repo : netlabs-rel-2rosenthals
Summary : A memory mapped emulation for OS/2-eComStation
License : unknown
Description: A memory mapped files emulation library.

Is this the same one against which you are building (or trying to build) the opcache module? I'm wondering if Yuri might be of some help in this regard, as I am coming up empty even trying to find sources for this.

Here's a quick snippet from a conversation earlier today concerning performance improvement with opcache (on Linux x64) with a local copy of a WordPress 3.9.2 site currently hosted on my box:

<snip>

I then installed Opcache (http://pecl.php.net/package/ZendOpcache) which
made quite a difference. Generation times of pages dropped to 0.3-0.5
seconds [from >2], with an occasional long load on the first hit and some
operations after that, but overall the site felt a lot more responsive.

<snip>

It seems that WordPress is a pig (well, that's not news), and static file cache only gets us part of the way. The PHP itself is just bulky (bloated).

Anyway, please let me know if I can help in any way, other than leaving you to get to this as time permits. ;-)

Cheers

psmedley

2014-08-15 21:33

administrator   ~0002818

I don't understand right now why opcache isn't working.

Is it worth revisiting apc in the meanwhile?

LewisR

2014-08-15 21:46

developer   ~0002819

As a stopgap measure, it might be worth trying - as long as you do not have to invest significant time and energy, which would both be better spent here, for longer term reward.

I don't recall whether you looked at APC previously.

http://php.net/manual/en/apc.requirements.php seems to indicate that "all" that should be required to build APC is pcre (famous last words...LOL). If that is truly the case, then I say let's give it a shot, as *some* optimizer is better than *no* optimizer, and this code isn't getting any slimmer (sad to say).

Thanks!

psmedley

2014-08-15 22:18

administrator   ~0002820

well i got an apc.dll pretty quickly.... but it crashes pthreads on startup.

Will have another look this afternoon - gotta get outta bed soon as we're off to dad's for lunch :)

LewisR

2014-08-15 22:22

developer   ~0002821

FYI, Yuri dropped a new pthreads just yesterday. Might be worth trying later on.

Enjoy lunch!

psmedley

2014-08-17 07:13

administrator   ~0002824

I spoke with Dmik on IRC last night about the Permission Denied error using anonymous mmap. As he's currently working on mmap, he's suggested he should be able to take a look soon. I've given him a simple testcase that shows the issue.

psmedley

2014-08-17 09:34

administrator   ~0002825

to be clearer:
[21:18:17] <dmik> Smedles: re
[21:18:38] <dmik> re mmap, I only implemented support for the offset field so far - and this works now
[21:19:16] <dmik> if you mail me more details about your failing mmap case - there is a good chance I'll look at it within the current update cycle as well

LewisR

2014-08-19 03:45

developer   ~0002826

Last edited: 2014-08-19 03:45

Sometimes, it really pays to know the right people at the right time, and to try to do right by them (all the time). Thanks so much for bringing this up to him, and I'll drop him a note, as well.

This looks like we're moving in the right direction. Kind of like when Andy and I were working on getting a usable OpenVPN, and finally (as you may recall), it came down to the tap/tun driver only having tap support and no tunneling support; we could have tried different compilers and different options 'til the cows came home, and still we would have been all dressed up with nowhere to go. :-O

Cheers

psmedley

2014-08-19 09:54

administrator   ~0002827

<Smedles> btw any time yet to look at my mmap issue?
<truedmik> yes, I will do it this week while updating wpstk and mmap SVNs

diver

2014-08-22 07:43

reporter   ~0002828

see ticket http://trac.netlabs.org/ports/ticket/32 for progress

psmedley

2022-05-14 06:46

administrator   ~0004257

opcache is included in PHP 7 and above

Issue History

Date Modified Username Field Change
2014-07-19 06:28 LewisR New Issue
2014-07-20 09:20 psmedley Note Added: 0002783
2014-08-01 09:54 psmedley Note Added: 0002792
2014-08-01 14:10 LewisR Note Added: 0002793
2014-08-01 21:08 psmedley Note Added: 0002794
2014-08-02 02:18 LewisR Note Added: 0002795
2014-08-02 02:19 LewisR File Added: 00C3_01.TRP
2014-08-02 02:22 LewisR Note Added: 0002796
2014-08-02 02:30 LewisR Note Added: 0002797
2014-08-02 09:46 psmedley Note Added: 0002798
2014-08-02 16:25 LewisR Note Added: 0002799
2014-08-02 16:58 LewisR File Added: 008F_05.TRP
2014-08-02 17:01 LewisR Note Added: 0002800
2014-08-02 22:14 psmedley Note Added: 0002801
2014-08-14 04:54 LewisR Note Added: 0002815
2014-08-15 21:33 psmedley Note Added: 0002818
2014-08-15 21:46 LewisR Note Added: 0002819
2014-08-15 22:18 psmedley Note Added: 0002820
2014-08-15 22:22 LewisR Note Added: 0002821
2014-08-17 07:13 psmedley Note Added: 0002824
2014-08-17 09:34 psmedley Note Added: 0002825
2014-08-19 03:45 LewisR Note Added: 0002826
2014-08-19 03:45 LewisR Note Edited: 0002826
2014-08-19 09:54 psmedley Note Added: 0002827
2014-08-22 07:43 diver Note Added: 0002828
2022-05-14 06:46 psmedley Assigned To => psmedley
2022-05-14 06:46 psmedley Status new => resolved
2022-05-14 06:46 psmedley Resolution open => no change required
2022-05-14 06:46 psmedley Note Added: 0004257