Opened 18 years ago
Closed 18 years ago
#9399 closed defect (worksforme)
RFC: php5 slow on ppc
Reported by: | jtktam@… | Owned by: | opendarwin-2006@… |
---|---|---|---|
Priority: | High | Milestone: | |
Component: | ports | Version: | 1.2 |
Keywords: | Cc: | markd@… | |
Port: |
Description
I have installed php5 with the following command:
port install php5 +fastcgi
on two macines.
machine A = macbook 13.3" intel core duo machine B = mac mini 1.42ghz G4
on both machines it compiles and installs fine.
on machine A, when I do this:
php -v
it takes less than 1 second to get back the version number
on machien B, when I do this:
php -v
it takes almost 12 seconds to get back the version number
I have not changed any of the port files and the installation does work on both machines, but the G4 is 12x slower (and hence i get time out errors) than the macbook.. it's getting really annoying :(
-joe
Change History (14)
comment:1 Changed 18 years ago by jtktam@…
comment:2 Changed 18 years ago by jtktam@…
on my macbook, this is what the result from 'time php -v' is:
PHP 5.1.4 (cgi) (built: Jun 10 2006 14:51:06) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m0.174s user 0m0.030s sys 0m0.016s
-joe
comment:3 Changed 18 years ago by jtktam@…
on my mac mini:
PHP 5.1.4 (cli) (built: Jun 11 2006 11:34:03) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m12.683s user 0m0.058s sys 0m0.035s
-joe
comment:4 Changed 18 years ago by mww@…
Owner: | changed from darwinports-bugs@… to opendarwin-2006@… |
---|---|
Summary: | php5 slowness → RFC: php5 slow on ppc |
(adjusted to match http://wiki.opendarwin.org/index.php/Darwinports:Bug_reports)
comment:5 Changed 18 years ago by opendarwin-2006@…
Status: | new → assigned |
---|
I am the maintainer of the php5 port. Although I have found the PHP CLI to start rather slowly myself, for me that means about half a second, not twelve seconds. Here is the result on my 1.5-GHz PowerBook G4:
$ time /opt/local/bin/php -v PHP 5.1.4 (cli) (built: Jun 4 2006 14:34:34) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m0.469s user 0m0.324s sys 0m0.062s
Note the following:
- I installed php5 +apache2 +mysql5. This means I have the CLI version of PHP (as you see above) and not the CGI or FastCGI versions.
- Your hand-built attempt on your G4 mini, and the one you installed via DP on the MacBook, seem to have given you the CGI version instead of the CLI version which should be there. The +fastcgi variant should also install the FastCGI version as "php-fcgi" (which is different from the CGI version). I will look into the DP +fastcgi variant to see why you might have ended up with the CGI version when you should have gotten the CLI version.
- The DP version you tested on your G4 mini is the CLI version as it should be.
Are you sure you're accessing the DP version in both tests? What's "which php" say? What if you access them explicitly as /opt/local/bin/php?
comment:6 Changed 18 years ago by jtktam@…
I am currently using Lighttpd as my webserver and I need the fastcgi version. Previously on my G3 ibook, with the same DP command 'port install php5 +fastcgi' I didn't run into this issue and that machine is way slower than this one.
Do you need me to run any commands to capture any output to solve this issue?
-joe
comment:7 Changed 18 years ago by jtktam@…
celery:/ root# port clean php5 ---> Cleaning php5 celery:/ root# port install php5 +mysql5 +fastcgi +apache2 ---> Fetching php5 ---> Verifying checksum(s) for php5 ---> Extracting php5 ---> Configuring php5 ---> Building php5 with target all ---> Staging php5 into destroot Error: Target com.apple.destroot returned: xinstall: Cannot stat: /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_www_php5/work/php-5.1.4/sapi/cgi/php, No such file or directory Error: /opt/local/bin/port: Status 1 encountered during processing.
-joe
comment:8 Changed 18 years ago by opendarwin-2006@…
Yes, you can't do +fastcgi and +apache2 at the same time. That's an unrelated problem. That's bug 8599.
comment:9 Changed 18 years ago by jtktam@…
celery:~ root# port clean php5 ---> Cleaning php5 celery:~ root# port install php5 +mysql5 +apache2 ---> Fetching php5 ---> Verifying checksum(s) for php5 ---> Extracting php5 ---> Configuring php5 ---> Building php5 with target all ---> Staging php5 into destroot ---> Packaging tgz archive for php5 5.1.4_3+apache2+darwin_8+macosx+mysql5 ---> Installing php5 5.1.4_3+apache2+darwin_8+macosx+mysql5
If this is your first install, you might want cd /opt/local/apache2/modules /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
- copy /opt/local/etc/php.ini-dist to /opt/local/etc/php.ini
---> Activating php5 5.1.4_3+apache2+darwin_8+macosx+mysql5 ---> Cleaning php5 celery:~ root# cd /opt/local/bin celery:/opt/local/bin root# time ./php -v PHP 5.1.4 (cli) (built: Jun 18 2006 14:17:13) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m12.592s user 0m0.061s sys 0m0.039s
still the same issue either way
-joe
comment:10 Changed 18 years ago by opendarwin-2006@…
I also tried installing "php5 +fastcgi" and it's still fast for me.
Are you using one of the standard php.inis or have you customized it? If the latter, can you try a standard one?
Still confused about why you're getting the CGI vesion of PHP on your MacBook, and when you build by hand on the G4 mini. I don't see a way for DP to create the CGI version. Are you sure you're accessing the DP version of PHP on the MacBook?
What version of Mac OS X on the G4 mini? What version of Xcode? How much RAM? How much hard drive space free?
comment:11 Changed 18 years ago by jtktam@…
Darwin ------ 8.6.0 Darwin Kernel Version 8.6.0: Tue Mar 7 16:58:48 PST 2006; root:xnu-792.6.70.obj~1/RELEASE_PPC Power Macintosh powerpc
Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/[cg][+.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
I have 1GB of ram and according to 'top' i have over 250mb free
the macbook only has 512mb of ram
i will post up the info from the other machine when i get a chance to later
-joe
comment:12 Changed 18 years ago by jtktam@…
from my macbook:
poppyseed:~ jtam$ cd /opt/local/bin poppyseed:/opt/local/bin jtam$ time php -v PHP 5.1.4 (cli) (built: Jun 10 2006 14:51:06) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m3.251s user 0m0.042s sys 0m0.054s poppyseed:/opt/local/bin jtam$ time php -v PHP 5.1.4 (cli) (built: Jun 10 2006 14:51:06) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m0.150s user 0m0.030s sys 0m0.018s
poppyseed:/opt/local/bin jtam$ uname -a Darwin ---- 8.6.2 Darwin Kernel Version 8.6.2: Thu Apr 13 18:48:29 PDT 2006; root:xnu-792.9.59.obj~1/RELEASE_I386 i386 i386 poppyseed:/opt/local/bin jtam$ gcc -v Using built-in specs. Target: i686-apple-darwin8 Configured with: /private/var/tmp/gcc/gcc-5250.obj~20/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/[cg][.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5250)
top showing 158mb free
and I used "port install php5 +fastcgi" to make this
-joe
comment:13 Changed 18 years ago by markd@…
Cc: | markd@… added |
---|
I can't duplicate this on my PowerBook using PHP5 5.1.6. I think this should be marked 'works for me'.
comment:14 Changed 18 years ago by markd@…
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
I just build php 5.1.4 from source by hand (instead of the port) and I got a better result from 'time php -v'
PHP 5.1.4 (cgi) (built: Jun 11 2006 11:21:22) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
real 0m0.193s user 0m0.023s sys 0m0.025s
-joe