Skip to main content

We have developped a new K2 Workflow but find some performance issue, we use client event to bind some ASP.NET Page in our project. system hardware is powerful, and system resource is enough.  


 


After debugging step by step, we found the codes below execute very slowly.


 


The first is the code to open a connection to K2 Server:


 


                Connection conn = new Connection();


 


                //create connection string


                SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder builder = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();


 


                builder.Host = "localhost";


                builder.Port = 5252;


                builder.SecurityLabelName = "K2";


                builder.Authenticate = true;


                builder.IsPrimaryLogin = true;


                builder.Integrated = true;


             


                // Connect to Workflow Server


                conn.Open("localhost", builder.ConnectionString);


 


 


the line in yellow highlight takes nearly 64 seconds to execute. We have to open connection to K2 Server for many interaction.


 


The second is the code to create workflow instance, as below. It takes nearly 55 seconds to go to next step:


 


ProcessInstance pi = conn.CreateProcessInstance(name);


 


The third is when we open worklist for the workflow receiver after it is launched, it also takes about 65 seconds:


 


WorklistItem wi = conn.OpenWorklistItem(sn);


 


The other codes line only takes several seconds at most, the execution of this three lines occupy the most time of page loading or submitting.


can anyone give me some suggestions on this performance issue?


Thanks

Hi,


The only time I've seen something like this was when the K2 Server wasn't set up correctly in AD. The reason it takes such a long time is because the server does not know which server to authenticate to and queries the Primary Domain Controller which then refers the request to another domain dontroller. This domain controller can be in another site which causes even more lag.


To remedy this, check with your AD administrators whether there is a Site and a Subnet (in AD Sites and Services) which covers the IP address of the K2 Server.


If this has been set up already, check what the K2 Server is doing this time by enabling full file logging and investigating the logs. A network trace with Netmon or Wireshark will also be really helpful. Trace from both the K2 Server and the server hosting your application (if not the same server).


Let me know if you could solve this or report with the trace findings.


Regards,


hello, Johan


what you said enable me recall another post i have submit : http://www.k2underground.com/forums/t/13688.aspx


there are truly some error logs in our K2 Server related to AD, you can see the details in that post. perhaps this also cause performance issue except making notification mail does not work.


Do you have any clues on that error message:


A referral was returned from the server.
|   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.RefreshCache()
   at ADUM.K2UserManager2.GetDirectoryEntry(String path)
   at ADUM.K2UserManager2.FindSecurityGroupsWithDefault(String User, String Name, String Description, String domainLDAP, String uOrgUnit)
   at ADUM.K2UserManager2.FindSecurityGroups(String User, IDictionary`2 properties)
   at SourceCode.Security.Providers.K2UMProvider.K2UMProvider.SourceCode.Hosting.Server.Interfaces.IRoleProvider.FindGroups(String userName, IDictionary`2 properties)
   at SourceCode.Security.UserRoleManager.Runtime.UserRoleManagerServer.FindGroups(String userName, IDictionary`2 properties, String labelName, String extraData)


Hi,


I did a quick Google search and found the following: http://www.vistaheads.com/forums/microsoft-public-windows-vista-general/432650-referral-returned-server.html. Seems to be related to elevation. See what happens if you disable the setting on the K2 Server?


Take a look at the following post.  I had a performance issue where my InfoPath thick client forms kept on trying to resolve the SharePoint group providers which by default are added for each site collection that you enable the K2 components.  This caused very poor performance when opening the forms and might be related to your issue.


http://www.k2underground.com/forums/p/12752/37357.aspx


To see if you have SharePoint Group providers provisioned check the GroupProvider table on your K2HostServer database to see if you have entries.  In my case since it was development and I wasn't using the SharePoint Groups I backed up my K2 databases and then deleted the entries in the GroupProvider table.  Form load performance improved from 30 seconds or more to just a couple seconds.


If you are using the SharePoint group providers I believe the latest release of K2 BP 4.5 1370 has caching settings that should also improve performance.


I hope this helps.


Tim


I just remembered another situation that a customer of mine had with poor worklist performance.  In that situation all it took was a K2Service restart. 


Reply