FAQ
The PHP4 java extension has problems when running inside a threaded
webserver.
http://bugs.php.net/bug.php?id=16690

This is due to the fact that the JavaVM pointer was a Thread Safe
Resorce Manager Global (TSRMG). This pointer is meant to be shared
by all threads, and so should be a real global. The other java TSRM
globals are correct as each thread will get it's own JNIEnv from the
JavaVM. Credit goes to Momchil Georgiev for figuring this out.

My CVS account doesn't appear to have write access, so here are where
the patch and new java.c can be found:

http://tjw.org/php_java/java.c.thread_patch
http://tjw.org/php_java/java.c

I tested this on Apache 2.0 (with MPM worker) on Linux only. It should
be noted that running the PHP Java extension from inside of a threaded
webserver gives a HUGE performance benefit. This is becasuse in non-threaded
webservers (e.g. Apache 1.3) each child process spawns its own completely
seperate JVM instead of just having one shared JVM . In my simple testing
running siege to compare Apache 1.3 and 2.0 (with threads), the threaded
webserver produced a 0.3 load average while apache 1.3 produced a 30.0
load average. I was running 'siege -n 30 -i' on Example 1 from the
PHP manual page for the java extenstion.

-Tony

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedNov 26, '03 at 7:42p
activeNov 26, '03 at 7:42p
posts1
users1
websitephp.net

1 user in discussion

Tony J. White: 1 post

People

Translate

site design / logo © 2022 Grokbase