On 06/26/2011 03:32 PM, Adrian Crum wrote:
Okay, that -1 setting seems confusing. Maybe we need a better
explanation of how the setting works.
You could specify -2, to mean twice the number of cpus, -5 to mean 5
times the number of cpus. I couldn't think of a better way to do that.
-Adrian
On 6/26/2011 9:24 PM, Adam Heath wrote:
On 06/26/2011 03:14 PM, Adrian Crum wrote:
Some advice on using this feature (based on my previous experience with
multi-threaded table creation): Start off with small values - like 1 or
2 on a multi-CPU machine. Creating more threads does not equal better
performance - there is a threshold where more threads will slow things
down.
I tested this on a 6-core machine, with the entire ofbiz checkout
running on a ram disk. Speed was nice, but I didn't do any checking to
see which values were faster. I didn't have any problems setting the
value to -1(which caused a pool size of 6), except for the
aformentioned foreign-key issue; as such, that change is not in this
commit.
-Adrian
On 6/26/2011 7:22 PM, Adam Heath wrote:
On 06/26/2011 01:07 PM, [email protected] wrote:
Author: doogie
Date: Sun Jun 26 18:07:18 2011
New Revision: 1139851
URL: http://svn.apache.org/viewvc?rev=1139851&view=rev
Log:
FEATURE: When doing bulk creation of tables, foreign key indices,
and declared indices, do the work in parallel. Also, when the database
does not support wildcard looking of primary key info, do the
per-table
lookup in parallel.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java
This is a major feature. By default, it's not actually going to do
anything in parallel. You need to set a 'max-worker-pool-size' to some
value(positive, or negative, which will then be multiplied by the
number of cpus), to take advantage of this.
Eventually, this per-datasource thread pool could be used to limit
concurrent queries, but that is not something I've done yet.