Slow Api  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Slow Api

Postby redpoint » Mon Jul 19, 2021 12:47 am

Hi,

We are trying to connect Jiwa with Woocommerce. Jiwa API is taking almost 16 second to deny connection and almost 32 second for successful authentication. Why API is too slow or is this a issue from our end?
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: Slow Api  Topic is solved

Postby Mike.Sheen » Mon Jul 19, 2021 11:21 am

redpoint wrote:Hi,

We are trying to connect Jiwa with Woocommerce. Jiwa API is taking almost 16 second to deny connection and almost 32 second for successful authentication. Why API is too slow or is this a issue from our end?


Most likely you have plugins which are failing to compile, and as a result every login is trying to compile them.

You can check which plugins have issues with the PluginExceptions route - for example: https://api.jiwa.com.au/Queries/PluginE ... AsRJznB_Ok

You can also get a breakdown of where the time is being spent on authentication with the StartupLog route eg : https://api.jiwa.com.au/Queries/Startup ... AsRJznB_Ok

Post the results of the StartupLog route here and I can tell you what you should look at next.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Slow Api

Postby redpoint » Mon Jul 19, 2021 4:59 pm

Here is the result (please check attached csv file)
Attachments
StartupLogEntryQuery.csv
(11.53 KiB) Downloaded 1256 times
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: Slow Api

Postby Mike.Sheen » Mon Jul 19, 2021 5:10 pm

redpoint wrote:Here is the result (please check attached csv file)


Thanks - I can see there are some plugins which are being compiled - you shouldn't be seeing this on authentication every time - only if the plugin has changed or did not compile previously - and this would be gobbling up some time.

Now please show me the output of the /Queries/PluginExceptions route - this should show the exception text if plugins were encountering issues compiling.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Slow Api

Postby redpoint » Tue Jul 20, 2021 10:33 am

Hello Mike,

Thanks, please check this file.

Please explain what we have to fix?

Thanks
Attachments
PluginExceptionQuery.csv
(17.05 KiB) Downloaded 1244 times
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: Slow Api

Postby Mike.Sheen » Tue Jul 20, 2021 11:26 am

redpoint wrote:Hello Mike,

Thanks, please check this file.

Please explain what we have to fix?

Thanks


Run the following script against your database:

Code: Select all
DELETE FROM SY_PluginReference WHERE AssemblyFullName = 'Microsoft.SqlServer.Smo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
DELETE FROM SY_PluginReference WHERE AssemblyFullName = 'Microsoft.SqlServer.Dac, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


Then restart your API service and then check the /Queries/PluginExceptions - it should be empty now.

The script just side-steps the problem - and the problem is that the SQL components SMO and DAC are not correctly deployed to the machine the API service is running on - but the plugins don't need to have a reference to those components, and that is what the script does - remove the references to those components. The plugins only had the reference to these in the first place, as when a plugin is created we - in an effort to be helpful - add to the new plugin the references that the JiwaApplication.dll has, because any plugin will need at least *some* of those references to be functional - and rather than have an explicit list of default references we just use the same references as found in JiwaApplication.dll.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Slow Api

Postby redpoint » Tue Jul 20, 2021 2:09 pm

Thanks,

Just to confirm if I run this query, will it going to have any functional impact on our Jiwa?

Thanks
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: Slow Api

Postby Mike.Sheen » Tue Jul 20, 2021 3:44 pm

redpoint wrote:Thanks,

Just to confirm if I run this query, will it going to have any functional impact on our Jiwa?

Thanks


Without having access to all those plugins which someone custom-made for you, I can't be 100% sure, but it's going to be a fairly safe bet it won't cause any problems... It removes references which are not needed - and even if they are needed the reference can't be used anyway because those SQL components are not properly installed.

If anything does go wrong I promise I will help you fix it, but there is another method if you're wanting to avoid running the script... and that is to get those SQL components properly installed / registered so you wouldn't need to run the script to remove references to them, and the plugins would find them and happily compile.

I suspect after Jiwa was installed, those components were removed. So, repairing the Jiwa installation on that machine - or uninstalling Jiwa and re-installing should fix that. That may actually be a riskier option than running the SQL Script - depending on the environment... it could be you have other applications which might break as a result - it's hard to say.

I can't promise anything other than I'll help you to get to a working state - but it may mean something breaks along the way.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Slow Api

Postby twofatmonkeys » Thu Nov 18, 2021 6:18 pm

Mike.Sheen wrote:
Run the following script against your database:


Thanks Mike, I've just taken this issue over, the key piece of info missing here was that the API in this instance is running under IIS, those referenced libraries were missing from the %API_install_path%\Bin folder.

Added the missing .dlls and all is good!

Thanks again, Dirk
twofatmonkeys
I'm new here
I'm new here
 
Posts: 2
Joined: Thu Nov 18, 2021 6:03 pm


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest