lcabaceira / crystal

Alfresco predictions, analisys, benchmarks
3 stars 1 forks source link

Database stress tests #15

Closed lcabaceira closed 8 years ago

lcabaceira commented 8 years ago

Alfresco heavily depends on the underlying database engine. This test is collecting the most common queries sent by Alfresco to the database. We achieve that by parsing the query log. The goal is to build a stress test that uses a thread group to stress the target database using the parsed queries.

The first thing to do is to enable the query logs on your Alfresco installation and redirect their output into a specific file that will be parsed.

Activiti queries logger

log4j.logger.org.activiti.engine.impl.persistence.entity=debug,sqlTestAppender log4j.additivity.org.activiti.engine.impl.persistence.entity=false

log4j.logger.alfresco.lock=debug,sqlTestAppender log4j.additivity.alfresco.lock=false log4j.logger.alfresco.solr=debug,sqlTestAppender log4j.additivity.alfresco.solr=false log4j.logger.alfresco.permissions=debug,sqlTestAppender log4j.additivity.alfresco.permissions=false log4j.logger.alfresco.node=debug,sqlTestAppender log4j.additivity.alfresco.node=false log4j.logger.alfresco.activities=debug,sqlTestAppender log4j.additivity.alfresco.activities=false

log4j.appender.sqlTestAppender=org.apache.log4j.DailyRollingFileAppender log4j.appender.sqlTestAppender.datePattern='-'dd'.log' log4j.appender.sqlTestAppender.File=log/sqlExtracts.log log4j.appender.sqlTestAppender.layout=org.apache.log4j.PatternLayout log4j.appender.sqlTestAppender.layout.ConversionPattern=%-6r %d{ISO8601} %-5p %40.40c %x - %m\n

Once we have the query logs (referring to your alfresco installation and your specific use cases) we use the parsing utility script to extract only the queries we are interested in (removing the insert, update and delete queries)

./parse.sh sqlqueries.log > results.sql

I've written a basic jmeter test plan that can consume those queries and send them directly to the database. alfresco-db-test-plan.zip

Next steps are to guarantee we can stress the database to the point where it becomes slow on response times. We should run all crystal tests (cmis and share tests) to create as many different queries as possible.

miguel-rodriguez commented 8 years ago

Test plan and SQL parsing script committed. Wiki page updated https://github.com/lcabaceira/crystal/wiki#7---running-db-test-plan