You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-dev@incubator.apache.org by Xuekun Hu <xu...@gmail.com> on 2009/10/13 06:16:20 UTC

Is thread pool technology used in Olio/java?

Hi, Guys

In Olio/PHP, each user will usually create one connection to web
server, and then one connection to mysql end. With more than 20k
users, the number of connections are huge from mysql view I thought.
It will consume lots of memory and meet the potential lock contention,
thus the scaling should be bad if supporting huge number of users. I
thought in real setup, middleware usually is implemented a thread
pool, with limit number of connections to db end. All the user
requests will go through the thread pool to db end. With this
architecture, db could do higher throughtput than
one-user-one-connection-one-thread model.

I wonder is it possbile to implment a thread pool in Olio/java?

Thx, Xuekun

Re: Is thread pool technology used in Olio/java?

Posted by Shanti Subramanyam <Sh...@Sun.COM>.
Typically, Java app servers do support JDBC connection pools in addition 
to incoming thread connection pools. So you should see dramatically 
lower #connections to the database when you run the Java version.

Shanti

Xuekun Hu wrote:
> Hi, Guys
>
> In Olio/PHP, each user will usually create one connection to web
> server, and then one connection to mysql end. With more than 20k
> users, the number of connections are huge from mysql view I thought.
> It will consume lots of memory and meet the potential lock contention,
> thus the scaling should be bad if supporting huge number of users. I
> thought in real setup, middleware usually is implemented a thread
> pool, with limit number of connections to db end. All the user
> requests will go through the thread pool to db end. With this
> architecture, db could do higher throughtput than
> one-user-one-connection-one-thread model.
>
> I wonder is it possbile to implment a thread pool in Olio/java?
>
> Thx, Xuekun
>   

Re: Is thread pool technology used in Olio/java?

Posted by Xuekun Hu <xu...@gmail.com>.
Thank you all guys. I am looking forward to Olio/Java release.
Now, I will try SWS7.0 first with thread pool. :-)

Thx, Xuekun

On Wed, Oct 14, 2009 at 5:42 AM, Richard Smith <Ri...@sun.com> wrote:
> Its also possible to use a thread pool with Olio/PHP--its just a
> question of the choice of webserver and PHP implementation. In
> recent testing, I was using a single instance of Sun Java System
> Web Server (SWS7.0) with a thread pool of 210 threads on a box
> with 128 vcpus. There's still a large number of connections to
> the webserver, but only a moderate number to the backend MySQL
> database.
>
> In terms of memory usage, if you were using Apache and prefork
> MPM, then you end up having to reserve swap space for all the
> pages that *could* need to be created via Copy-On-Write, even
> if most of them aren't modified. Therefore a substantial amount
> of swap space needs to be provided. Performance can be diabolical
> if you don't have enough. The multithreaded, single-process
> approach of SWS is very memory-efficient.
>
> In a real setup, I'm guessing that a reverse proxy cache server
> would be desirable to offload a lot of the static content traffic
> from the webserver. I don't know though what proxy cache servers
> implement a thread pool concept.
>
> Richard.
>
> Xuekun Hu wrote:
>>
>> Hi, Guys
>>
>> In Olio/PHP, each user will usually create one connection to web
>> server, and then one connection to mysql end. With more than 20k
>> users, the number of connections are huge from mysql view I thought.
>> It will consume lots of memory and meet the potential lock contention,
>> thus the scaling should be bad if supporting huge number of users. I
>> thought in real setup, middleware usually is implemented a thread
>> pool, with limit number of connections to db end. All the user
>> requests will go through the thread pool to db end. With this
>> architecture, db could do higher throughtput than
>> one-user-one-connection-one-thread model.
>>
>> I wonder is it possbile to implment a thread pool in Olio/java?
>>
>> Thx, Xuekun
>
>
> --
> ============================================================================
>  ,-_|\   Richard Smith Staff Engineer PAE
>  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
> richard.smith@Sun.COM                        Direct : +61 3 9869 6224
>  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
>      v   Melbourne Vic 3004 Australia
> ===========================================================================
>

Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
Hi Xuekun,

The author of the changes to overcome the PDO race condition tells me
that a patch targetting his modified PHP stack is publically available.
It sounds like similar patches for 5.2.9 and 5.3.0 will follows [I'm
guessing that the patch below doesn't apply cleanly to them, but
then again I haven't tried it.]

> Here is the PDO crash patch (It is public):
> http://hg.genunix.org/php-experiment.hg/rev/73022b24276d
>
> There is a porting effort to 5.2.9 and 5.3.
> I am planning to port it today.

Richard.

-- 
============================================================================
   ,-_|\   Richard Smith Staff Engineer PAE
  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                        Direct : +61 3 9869 6224
  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
       v   Melbourne Vic 3004 Australia
=========================================================================== 


Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
Basant advises me that his bug fix for the PHP race condition is
incomplete; that he has updated the filed bug with additional
comments; and is working on a more complete fix.

-- 
============================================================================
   ,-_|\   Richard Smith Staff Engineer PAE
  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                        Direct : +61 3 9869 6224
  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
       v   Melbourne Vic 3004 Australia
=========================================================================== 


Re: Is thread pool technology used in Olio/java?

Posted by Xuekun Hu <xu...@gmail.com>.
Hi, Richard

I'm afraid the below patch couldn't resolve my php crash issue.
However I do find some interesting stuff.

1. php5.2.11 + below patch, php5.2 svn branch + below patch, original php5.2.11
    php were compiled with
CC="gcc" CFLAGS="-O3 -fPIC" ./configure
--with-mysql=/usr/local/mysql
--with-gettext --with-zlib --with-nsapi=/home/sun/webserver7/
--enable-force-cgi-redirect --with-pdo-mysql=/user/local/mysql
--with-curl --with-gd=/home/apache_webserver/gd-2.0.35
--with-jpeg-dir=/home/apache_webserver/jpeg-6b
*note that: no --enable-debug flag.
    All got crash with segment fault at _zend_mm_free_int

2. I wanted to get more stack info, so I compiled original php5.2.11
with --enable-debug flag. When testing Olio with lower users, every
thing is fine, no crash. However when testing Olio with higher users,
SWS crash again. This time got segment fault at _efree_ts which was
similar like the core stack in
http://hg.genunix.org/php-experiment.hg/rev/73022b24276d

3. So I compiled php5.2.11 + patch with --enable-debug again, now no
crash even with higher users.

So the patch can resolve the crash at _efree_ts, however not at
_zend_mm_free_int. I suspected --enable-debug will slower php
execution that decrease the possiblity of crash at _zend_mm_free_int.
However I think --enable-debug is not a good solution, PHP has another
crash issue with PDO related.

Could you please forward these info to your colleage or php guys?

Thx, Xuekun

On Wed, Oct 21, 2009 at 7:43 AM, Richard Smith <Ri...@sun.com> wrote:
> Hi Xuekun,
>
> Basant has now submitted Bug #49937 Race condition in PDOStatement,
> and the patch it references is also attached.
> http://bugs.php.net/bug.php?id=49937&thanks=1
>
> Richard.
>
> --
> ============================================================================
>  ,-_|\   Richard Smith Staff Engineer PAE
>  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
> richard.smith@Sun.COM                        Direct : +61 3 9869 6224
>  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
>      v   Melbourne Vic 3004 Australia
> ===========================================================================
>
> Index: ext/pdo/pdo_stmt.c
> ===================================================================
> --- ext/pdo/pdo_stmt.c  (revision 289806)
> +++ ext/pdo/pdo_stmt.c  (working copy)
> @@ -2325,7 +2325,7 @@
>        stmt->refcount = 1;
>        ALLOC_HASHTABLE(stmt->properties);
>        zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
> -       zend_hash_copy(stmt->properties, &stmt->ce->default_properties,
> (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
> +       zend_hash_copy(stmt->properties, &stmt->ce->default_properties,
> (copy_ctor_func_t) zval_add_ref_atomic, (void *) &tmp, sizeof(zval *));
>
>        old_stmt = (pdo_stmt_t *)zend_object_store_get_object(zobject
> TSRMLS_CC);
>
> @@ -2454,7 +2454,7 @@
>        stmt->refcount = 1;
>        ALLOC_HASHTABLE(stmt->properties);
>        zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
> -       zend_hash_copy(stmt->properties, &ce->default_properties,
> (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
> +       zend_hash_copy(stmt->properties, &ce->default_properties,
> (copy_ctor_func_t) zval_add_ref_atomic, (void *) &tmp, sizeof(zval *));
>
>        retval.handle = zend_objects_store_put(stmt,
> (zend_objects_store_dtor_t)zend_objects_destroy_object,
> (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage,
> (zend_objects_store_clone_t)dbstmt_clone_obj TSRMLS_CC);
>        retval.handlers = &pdo_dbstmt_object_handlers;
> Index: TSRM/TSRM.c
> ===================================================================
> --- TSRM/TSRM.c (revision 289806)
> +++ TSRM/TSRM.c (working copy)
> @@ -714,6 +714,12 @@
>        return retval;
>  }
>
> +TSRM_API void *tsrm_atomic_incr(volatile unsigned int* val)
> +{
> +       tsrm_mutex_lock(tsmm_mutex);
> +       ++*val;
> +       tsrm_mutex_unlock(tsmm_mutex);
> +}
>
>
>  /*
> Index: TSRM/TSRM.h
> ===================================================================
> --- TSRM/TSRM.h (revision 289806)
> +++ TSRM/TSRM.h (working copy)
> @@ -139,6 +139,7 @@
>
>  TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t
> new_thread_begin_handler);
>  TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t
> new_thread_end_handler);
> +TSRM_API void *tsrm_atomic_incr(volatile unsigned int* val);
>
>  /* these 3 APIs should only be used by people that fully understand the
> threading model
>  * used by PHP/Zend and the selected SAPI. */
> Index: Zend/zend_variables.c
> ===================================================================
> --- Zend/zend_variables.c       (revision 289806)
> +++ Zend/zend_variables.c       (working copy)
> @@ -100,6 +100,17 @@
>  }
>  /* }}} */
>
> +
> +ZEND_API void zval_add_ref_atomic(zval **p) /* {{{ */
> +{
> +#ifdef ZTS
> +       tsrm_atomic_incr(&(*p)->refcount);
> +#else
> +       (*p)->refcount++;
> +#endif
> +}
> +/* }}} */
> +
>  ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) /* {{{
> */
>  {
>        switch (zvalue->type) {
> Index: Zend/zend_variables.h
> ===================================================================
> --- Zend/zend_variables.h       (revision 289806)
> +++ Zend/zend_variables.h       (working copy)
> @@ -76,6 +76,7 @@
>  #endif
>
>  ZEND_API void zval_add_ref(zval **p);
> +ZEND_API void zval_add_ref_atomic(zval **p);
>
>  END_EXTERN_C()
>
>
>

Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
Hi Xuekun,

Basant has now submitted Bug #49937 Race condition in PDOStatement,
and the patch it references is also attached.
http://bugs.php.net/bug.php?id=49937&thanks=1

Richard.

-- 
============================================================================
   ,-_|\   Richard Smith Staff Engineer PAE
  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                        Direct : +61 3 9869 6224
  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
       v   Melbourne Vic 3004 Australia
=========================================================================== 


Re: Is thread pool technology used in Olio/java?

Posted by Xuekun Hu <xu...@gmail.com>.
Hi, Richard

I got several core dump, and all stack trace were:
Program terminated with signal 11, Segmentation fault.
#0  0x00002ba1630451e0 in _zend_mm_free_int ()
   from /home/sun/webserver7/bin/libphp5.so
#1  0x00002ba163084aa0 in zend_std_write_property ()
   from /home/sun/webserver7/bin/libphp5.so
#2  0x00002ba162ebfc4a in pdo_stmt_construct ()
   from /home/sun/webserver7/bin/libphp5.so
#3  0x00002ba162ec0073 in zim_PDO_query ()
   from /home/sun/webserver7/bin/libphp5.so
#4  0x00002ba1630999f9 in zend_do_fcall_common_helper_SPEC ()
   from /home/sun/webserver7/bin/libphp5.so
#5  0x00002ba16308705f in execute () from /home/sun/webserver7/bin/libphp5.so
#6  0x00002ba1630993d8 in zend_do_fcall_common_helper_SPEC ()
   from /home/sun/webserver7/bin/libphp5.so
#7  0x00002ba16308705f in execute () from /home/sun/webserver7/bin/libphp5.so
#8  0x00002ba1630630fa in zend_execute_scripts ()
   from /home/sun/webserver7/bin/libphp5.so
#9  0x00002ba1630188bb in php_execute_script ()
   from /home/sun/webserver7/bin/libphp5.so
#10 0x00002ba1630ee465 in php5_execute ()
...

Do you think it is related with the race condition in PDO that you mentioned?
If yes, do you happen to have the patch to fix this issue? Or when do
you think the fix will be public avaiable?

Thank you very much.

Thx, Xuekun

On Tue, Oct 20, 2009 at 12:38 PM, Richard Smith <Ri...@sun.com> wrote:
> Hi Xuekun,
>
> The PHP I'm using has been modified, compiled and tuned by a colleague.
> He tells me that there is a known issue with a race condition in PDO
> that he had to fix, but the changes haven't yet been propagated back
> into the official distro. This may well be what you're running into.
> Did you get a stack trace of the crash?
>
> FWIW the stack I'm using is 64-bit, running on OpenSolaris, and compiled
> with Sun Studio 12. I anticipate some of the details being published
> in a future Blueprint article.
>
> Richard.
>
> --
> ============================================================================
>  ,-_|\   Richard Smith Staff Engineer PAE
>  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
> richard.smith@Sun.COM                        Direct : +61 3 9869 6224
>  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
>      v   Melbourne Vic 3004 Australia
> ===========================================================================
>

Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
Hi Xuekun,

The PHP I'm using has been modified, compiled and tuned by a colleague.
He tells me that there is a known issue with a race condition in PDO
that he had to fix, but the changes haven't yet been propagated back
into the official distro. This may well be what you're running into.
Did you get a stack trace of the crash?

FWIW the stack I'm using is 64-bit, running on OpenSolaris, and compiled
with Sun Studio 12. I anticipate some of the details being published
in a future Blueprint article.

Richard.

-- 
============================================================================
   ,-_|\   Richard Smith Staff Engineer PAE
  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                        Direct : +61 3 9869 6224
  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
       v   Melbourne Vic 3004 Australia
=========================================================================== 


Re: Is thread pool technology used in Olio/java?

Posted by Xuekun Hu <xu...@gmail.com>.
Hi, Richard

I enabled Olio/PHP on SWS7u6 on Linux, however I met the below error
when running Olio only with 100 users.
       [19/Oct/2009:15:35:25] catastrophe (22588): CORE3260: Server
crash detected (signal SIGSEGV)
       [19/Oct/2009:15:35:25] info (22588): CORE3261: Crash occurred
in NSAPI SAF php5_execute

I wonder which php module is not thread-safe? I only enabled apc and
memcache in php.

php was compiled as
       CC="gcc" CFLAGS="-O3 -fPIC" ./configure
--prefix=/home/sun/php-5.2.6 --with-mysql=/usr/local/mysql
--with-gettext --with-zlib --with-nsapi=/home/sun/webserver7/
--enable-force-cgi-redirect --with-pdo-mysql=/user/local/mysql
--with-curl --with-gd=/home/apache_webserver/gd-2.0.35
--with-jpeg-dir=/home/apache_webserver/jpeg-6b

apc3.0.19 was compiled as
       CC="gcc" CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3" ./configure
--enable-apc --enable-apc-mmap
--with-php-config=/home/sun/php-5.2.6/bin/php-config

memcache-2.2.5 was compiled as
       ./configure --enable-memcache
--with-php-config=/home/sun/php-5.2.6/bin/php-config

Your suggestions/comments are appreciated.

Thx, Xuekun

On Wed, Oct 14, 2009 at 10:52 AM, Richard Smith <Ri...@sun.com> wrote:
> My understanding is that the PHP core is thread-safe via its use of ZTS and
> TSRM. Since PHP can act as a glue for third-party libraries, there's a
> potential risk that some extensions may not be thread-safe. There are some
> comments about not using Apache2 with a threaded MPM at
> http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2
> but nothing specific is identified as not being thread-safe.
>
> I've been using SWS with PHP in a single, multithreaded process and
> simulated
> thousands of active Olio users. That doesn't prove there are no bugs
> in the implementation, but does give me confidence in the subset of
> PHP extensions that Olio uses.
>
>
> Jignesh K. Shah wrote:
>>
>> I thought PHP is not thread-safe.. In that case how can SWS threaded help?
>>
>> -Jignesh
>
>
> --
> ============================================================================
>   ,-_|\   Richard Smith Staff Engineer PAE
>  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
> richard.smith@Sun.COM                         Direct : +61 3 9869 6224
>  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
>       v   Melbourne Vic 3004 Australia
> ===========================================================================
>
>

Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
My understanding is that the PHP core is thread-safe via its use of ZTS and
TSRM. Since PHP can act as a glue for third-party libraries, there's a
potential risk that some extensions may not be thread-safe. There are some
comments about not using Apache2 with a threaded MPM at
http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2
but nothing specific is identified as not being thread-safe.

I've been using SWS with PHP in a single, multithreaded process and 
simulated
thousands of active Olio users. That doesn't prove there are no bugs
in the implementation, but does give me confidence in the subset of
PHP extensions that Olio uses.


Jignesh K. Shah wrote:
> I thought PHP is not thread-safe.. In that case how can SWS threaded 
> help?
>
> -Jignesh


-- 
============================================================================
    ,-_|\   Richard Smith Staff Engineer PAE
   /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                         Direct : +61 3 9869 6224
   \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
        v   Melbourne Vic 3004 Australia
===========================================================================


Re: Is thread pool technology used in Olio/java?

Posted by "Jignesh K. Shah" <J....@Sun.COM>.
I thought PHP is not thread-safe.. In that case how can SWS threaded help?

-Jignesh


Richard Smith wrote:
> Its also possible to use a thread pool with Olio/PHP--its just a
> question of the choice of webserver and PHP implementation. In
> recent testing, I was using a single instance of Sun Java System
> Web Server (SWS7.0) with a thread pool of 210 threads on a box
> with 128 vcpus. There's still a large number of connections to
> the webserver, but only a moderate number to the backend MySQL
> database.
>
> In terms of memory usage, if you were using Apache and prefork
> MPM, then you end up having to reserve swap space for all the
> pages that *could* need to be created via Copy-On-Write, even
> if most of them aren't modified. Therefore a substantial amount
> of swap space needs to be provided. Performance can be diabolical
> if you don't have enough. The multithreaded, single-process
> approach of SWS is very memory-efficient.
>
> In a real setup, I'm guessing that a reverse proxy cache server
> would be desirable to offload a lot of the static content traffic
> from the webserver. I don't know though what proxy cache servers
> implement a thread pool concept.
>
> Richard.
>
> Xuekun Hu wrote:
>> Hi, Guys
>>
>> In Olio/PHP, each user will usually create one connection to web
>> server, and then one connection to mysql end. With more than 20k
>> users, the number of connections are huge from mysql view I thought.
>> It will consume lots of memory and meet the potential lock contention,
>> thus the scaling should be bad if supporting huge number of users. I
>> thought in real setup, middleware usually is implemented a thread
>> pool, with limit number of connections to db end. All the user
>> requests will go through the thread pool to db end. With this
>> architecture, db could do higher throughtput than
>> one-user-one-connection-one-thread model.
>>
>> I wonder is it possbile to implment a thread pool in Olio/java?
>>
>> Thx, Xuekun
>
>

-- 
Jignesh Shah           http://blogs.sun.com/jkshah  			
The New Sun Microsystems,Inc   http://sun.com/postgresql


Re: Is thread pool technology used in Olio/java?

Posted by Richard Smith <Ri...@Sun.COM>.
Its also possible to use a thread pool with Olio/PHP--its just a
question of the choice of webserver and PHP implementation. In
recent testing, I was using a single instance of Sun Java System
Web Server (SWS7.0) with a thread pool of 210 threads on a box
with 128 vcpus. There's still a large number of connections to
the webserver, but only a moderate number to the backend MySQL
database.

In terms of memory usage, if you were using Apache and prefork
MPM, then you end up having to reserve swap space for all the
pages that *could* need to be created via Copy-On-Write, even
if most of them aren't modified. Therefore a substantial amount
of swap space needs to be provided. Performance can be diabolical
if you don't have enough. The multithreaded, single-process
approach of SWS is very memory-efficient.

In a real setup, I'm guessing that a reverse proxy cache server
would be desirable to offload a lot of the static content traffic
from the webserver. I don't know though what proxy cache servers
implement a thread pool concept.

Richard.

Xuekun Hu wrote:
> Hi, Guys
>
> In Olio/PHP, each user will usually create one connection to web
> server, and then one connection to mysql end. With more than 20k
> users, the number of connections are huge from mysql view I thought.
> It will consume lots of memory and meet the potential lock contention,
> thus the scaling should be bad if supporting huge number of users. I
> thought in real setup, middleware usually is implemented a thread
> pool, with limit number of connections to db end. All the user
> requests will go through the thread pool to db end. With this
> architecture, db could do higher throughtput than
> one-user-one-connection-one-thread model.
>
> I wonder is it possbile to implment a thread pool in Olio/java?
>
> Thx, Xuekun


-- 
============================================================================
   ,-_|\   Richard Smith Staff Engineer PAE
  /     \  Sun Microsystems                   Phone : +61 3 9869 6200
richard.smith@Sun.COM                        Direct : +61 3 9869 6224
  \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
       v   Melbourne Vic 3004 Australia
=========================================================================== 


Re: Is thread pool technology used in Olio/java?

Posted by Kim LiChong <Ki...@Sun.COM>.
Hmm, Olio/Java does indeed use GlassFish's thread pool and JDBC 
connection pool settings.  We use Eclipselink, an implementation of JPA, 
which also uses caching to reduce the amount of contention of the DB 
machine.

[1] http://www.sun.com/offers/details/OptimizeGlassFishPerformance.html
[2] http://eclipse.dzone.com/articles/introducing-eclipselink

> Hi, Guys
>
> In Olio/PHP, each user will usually create one connection to web
> server, and then one connection to mysql end. With more than 20k
> users, the number of connections are huge from mysql view I thought.
> It will consume lots of memory and meet the potential lock contention,
> thus the scaling should be bad if supporting huge number of users. I
> thought in real setup, middleware usually is implemented a thread
> pool, with limit number of connections to db end. All the user
> requests will go through the thread pool to db end. With this
> architecture, db could do higher throughtput than
> one-user-one-connection-one-thread model.
>
> I wonder is it possbile to implment a thread pool in Olio/java?
>
> Thx, Xuekun
>