Running Benchmark Applications: Alfresco Workflow

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Benchmark Applications: Alfresco Workflow

derek
Established Member
0 0 1,515

What it Does


  • Start and progress Activiti workflows using the Alfresco APIs
  • Record, in detail, any errors that occurred during individual API calls operations
  • Record individual workflow operation times
  • As of v1.0, the built in workflows triggered are: activiti$activitiAdhoc, activiti$activitiReview, activiti$activitiParallelReview


Prerequisites


Use the Benchmark Testing with Alfresco page for version compatibility.


  • Java 1.7.0_51 or later
  • MongoDB 2.6.3 or later installed and running on port 27017 on some server: <mongo-host>
  • A compatible version of the Benchmark Server running on a Tomcat7 at port 9080: <bmserver-host>
  • Alfresco with /alfresco available: <alfresco-host>.  The target Alfresco server must use the Activiti workflow engine - it is the default, anyway.
  • A user data mirror reflecting the list of users that can be used by the test.  See the Alfresco Sign Up test on how to create users in Alfresco.
  • Validate the server API availability using the <alfresco-host>/alfresco/alfresco/service/api/workflow-instances URL with the administrator login.


Deploying


Local Deployment


  • Check out the required tag or branch of  source code of workflow test.
~ > svn checkout https://svn.alfresco.com/repos/alfresco-open-mirror/benchmark/tests/workflow/tags/V1.1 workflow
~ > cd workflow

  • Build and start a local Tomcat7 instance
~/workflow > mvn tomcat7:run -Dmongo.config.host=<mongo-host>


...
[INFO] Using existing Tomcat server configuration at c:\work\projects\bm-cmis\target\tomcat
...
10:49:10,944 [localhost-startStop-1] [ INFO] [                 MongoClientFactory: 124] - New MongoDB client created using URL: mongodb://mongo-host/?conne...
...
10:49:11,294 [localhost-startStop-1] [DEBUG] [                LifecycleController: 174] - Started components: appLifeCycleController
Nov 03, 2014 10:49:11 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ['http-bio-9087']

Remote Deployment


  • Set up a Tomcat7 load driver instance with the manager application listening on port 9080 and configure your Maven settings with the manager application credentials.
  • Deploy the application directly into the load driver:
mvn tomcat7:redeploy -DskipTests  -Dbm.tomcat.ip=<bmdriver-host> -Dbm.tomcat.port=9080 -Dbm.tomcat.server=bm-remote

  • Connect to the driver server and check that the application was successfully deployed.
 http://bmdriver-host:9080/manager

  • You can start/stop the driver applications as required


Create and Start a Test Run


The example given here will assume the a setup where several test runs are going to be made against a single server for investigative purposes.


  • Connect to the Benchmark Server
http://bmserver-host:9080/alfresco-benchmark-server

  • Create a new test, WF_V11 using alfresco-benchmark-tests-workflow-1.1-schema: 0 or whichever version you deployed
  • The property edit page is displayed, but can also be accessed using the gears icon.
  • Click on the Driver Details box, which will show details of all compatible driver(s) connected to the same configuration database.
  • The following properties should be set for all new tests:

















Section
Property
Description
MongoDB Connection mongo.test.host The hostname of a MongoDB server where the test results and general working data will be stored.  This should be an IP address that is visible to all load drivers and _may_ be the same MongoDB instance as the configuration database.  This value must always be set for new tests, as there is no working default.  A value of 'localhost' is dangerous and should not be used except for local testing.
Test Controls Test Duration Maximum time for the test to run.  This acts as an emergency shut off if the test is unable to complete the desired operations e.g. if the server-in-test fails to respond to new session requests and each session only times out after 5s.

Test Duration Unit The unit in which the Test Duration is expressed: SECONDS, MINTUES, HOURS or DAYS.
Alfresco Server Details Alfresco port Use 8080 for a default Alfresco server install.

Alfresco host The server host name.  It is important to use the same host name as used by the Alfresco Sign Up test so that the user data mirror name matches.  As mentioned before, this value can be set once at the test level when performing repeated runs against the same server.  The hostname must be visible to the load driver instances where the tests are deployed.
Workflow Load Workflow Count The number of workflows to start.

Time Between Workflows Time between creating new workflows (milliseconds).

  • Click back up to the WF_V11 test.  You should be presented with 'No test runs found ...'.
  • Create a test run named TRIAL_01.
  • The list of test runs is displayed.  Click on the cog (properties editor) of the test run.
  • Notice that the properties you set in the test are inherited by the test run.  This example assumes that all properties remain the same except for the load parameters:





Section
Property
Description
Workflow Load Workflow Count Set this to 20 for a quick trial run.

  • Check the other sections to ensure that the inherited properties are correct.  If not, go back up to the test properties and set them there.
  • Click back up to the TRIAL_01 test run.
  • Click the run button.

The test should start after a few seconds and progress to completion.




Handling failures


If the test fails to progress from SCHEDULED to STARTED, it could be because:


  1. mongo.test.host has not been set.  Currently the only way to see the error is to locate the tests log file and check that the value following New MongoDB client created using URL is correct.
  2. an invalid property setting was provided (TODO: implement type- and range-based UI validation)

Startup log messages to start can be retrieved directly from the server via the API (TODO: Add to server UI):

 http://bmserver-host:9080/alfresco-benchmark-server/api/v1/status/logs?count=5&skip=0&level=INFO&test=WF_10

If the test starts but experiences a high number of failures, the failures can be accessed directly in the MongoDB results.  The video, Following up on Failures shows how this can be done.  It is especially useful when the server under load starts to produce errors or fails to respond correctly.  From the MongoDB console, it would look something like this:

 mongo <mongo-data-host>
use bm20-data
db.WF_10.TRIAL_01.find({success:false}).pretty();



Extra Information