cancel
Showing results for 
Search instead for 
Did you mean: 

load testing connection pooling

luisalves00
Champ in-the-making
Champ in-the-making
Hello,

My load test seem to fail because of some kind of connection starvation (still not sure).

O configure the engine programmaticaly:

org.apache.commons.dbcp.BasicDataSource bds = new org.apache.commons.dbcp.BasicDataSource();            bds.setDefaultAutoCommit(false); //FIXME: make me configurable            bds.setUsername(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.username"));            bds.setPassword(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.password"));            bds.setDriverClassName(ApplicationConfig.getConfigParam("activiti.driverClassName"));            bds.setUrl(ApplicationConfig.getConfigParam("activiti.url"));            ProcessEngine processEngine = ProcessEngineConfiguration                    .createStandaloneProcessEngineConfiguration()                    .setDataSource(bds)                    .setJdbcMaxActiveConnections(100)                                 .setJdbcMaxIdleConnections(25)                    .setDatabaseType(ApplicationConfig.getConfigParam("activiti.databaseType"))                    .setDatabaseSchemaUpdate(ApplicationConfig.getConfigParam("activiti.databaseSchemaUpdate"))                    .setHistory(ApplicationConfig.getConfigParam("activiti.history"))                    .setProcessEngineName(ACTIVITI_ENGINE_NAME)                    .setJobExecutorActivate(false) //FIXME: make me configurable                    .buildProcessEngine();            ProcessEngines.registerProcessEngine(processEngine);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

only see 8 connections to the db, with 15 parallel request.

any idea?
23 REPLIES 23

luisalves00
Champ in-the-making
Champ in-the-making
is this fixed on 5.7?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I think it is in present in 5.7 but not fully tested and therefor not enabled by default and not documented

luisalves00
Champ in-the-making
Champ in-the-making
how to disable it?

I'm allways getting this exception:

29-09-2011 06:30:16 CommandContext [ERROR] Error while closing command context
org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 86.321.988 milliseconds ago.  The last packet sent successfully to the server was 86.321.988 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.setDesiredAutoCommit(JdbcTransaction.java:47)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.<init>(JdbcTransaction.java:15)
at org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory.newTransaction(JdbcTransactionFactory.java:15)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:77)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:32)
at org.activiti.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:84)
at org.activiti.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:77)
at org.activiti.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:177)
at org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.getDbSqlSession(StandaloneMybatisTransactionContext.java:77)
at org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.commit(StandaloneMybatisTransactionContext.java:58)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:112)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.IdentityServiceImpl.createUserQuery(IdentityServiceImpl.java:70)


Already got autoReconnect=true ….wait_timeout is set to mysql default (think its 8 hours)…

lichtin
Champ in-the-making
Champ in-the-making
http://jira.codehaus.org/browse/ACT-789?focusedCommentId=274693&page=com.atlassian.jira.plugin.syste...

In your activiti.cfg.xml

<bean id="processEngineConfiguration" … >

<property name="idGenerator">
<bean class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />
</property>

</bean>

luisalves00
Champ in-the-making
Champ in-the-making
lichtin,

I'm configuring my processEngine on java code…not in the xml.

Questions:

   1. how to set this on the code?
   2. is valid for 5.6 or only 5.7?

best regards,
la00

lichtin
Champ in-the-making
Champ in-the-making
1. how to set this on the code?
   2. is valid for 5.6 or only 5.7?
1. Use the setter

    setIdGenerator(IdGenerator idGenerator)

2. from 5.7 on

luisalves00
Champ in-the-making
Champ in-the-making
I'm looking ate http://activiti.org/javadocs/index.html and ProcessEngineConfiguration doesn't have that method…

I've updated to 5.7 and can't find it…

luisalves00
Champ in-the-making
Champ in-the-making
tried:


ProcessEngineConfigurationImpl pec =  (ProcessEngineConfigurationImpl) ProcessEngineConfiguration …..

pec.setIdGenerator(new org.activiti.engine.impl.persistence.StrongUuidGenerator());

ProcessEngine processEngine = (ProcessEngine) pec.buildProcessEngine();


(new org.activiti.engine.impl.persistence.StrongUuidGenerator()); this throws an exception…
I think I can't do 'new' because StrongUuidGenerator must depend on some dependency injection…

Do you know any factory method?

marcus1
Champ in-the-making
Champ in-the-making
Which exception is thrown? Probably a ClassNotFoundException. StrongUuidGenerator needs the library java-uuid-generator-3.1.2.jar.

luisalves00
Champ in-the-making
Champ in-the-making
tks Marcus and lichtin

library java-uuid-generator-3.1.2.jar did the trick…