WSO2 APIM clustering - how to improve the response time? - wso2

I clustered APIM with 1 manger gateway node and 2 or more work node to test APIM response time.
it did not give me good data.
without APIM,my api response time is 20 ms.though APIM 400ms-1s.
how to confige this question?

There are several handlers in APIM, through which all API calls are going. Eg. Authentication, Throttling, CORS etc.
You can enable analytics in APIM and see a latency breakdown graph among stages. See Figure 9 of this article. Then you can identify if there are any handlers which cause a large latency. Then we can decide how to fix that.

in order to slove my problem,i find all bolgs.
finally ,in this blog,Sanjeewa Malalgoda give a solution.
Then,after my test,the result is effiective.

Related

How to increase performance of WSO2 Idenity server

I have set up wso2 Identity server 5.3.0 with my web applications. Its working smooth for less number of policies and roles. As soon as number of policy and roles are getting increased the getDecision method from EntitlementService web service. Even worst thing is sometimes its giving time out.
Ant lead, How to improve getDecision method performance or caching ?
Let me know if you need other information below in the comment.
#Mak you can use XACML policy caching technique to improve the performance. Please refer below document to improve the performance.
https://docs.wso2.com/display/IS550/Improving+XACML+PDP+Performance+with+Caching+Techniques

WSO2 Identity Server does not show system statistics

I am having some trouble with Monitoring System Statistics in WSO2 Identity Server 5.3.3. There is no activity being reported in the Service Summary. We are about to go live with the WSO2 Identity server in a couple weeks, so I really want to keep an eye on the response time and counts.
Our current production system is not heavily used, but currently it shows Total Response Count: 0, when in fact I have tested several logins earlier today.
I know the monitoring was updating a few weeks ago, but something happened. Do I need to enable this via a setting or is it possible it was turned off?
This is the official documentation entry point on setting up and using statistics/analytics for latest WSO2 Identity server version. Please make sure you have followed all the steps accurately. You will have to separately enable it and configure in below files. After enabling you should be able to view stats.
<IS_HOME>/repository/conf/identity/identity.xml
<IS_HOME>/repository/deployment/server/eventpublishers/IsAnalytics-Publisher-wso2event-*

WSO2 physical server configuration issue

We're currently working/testing/experimenting on WSO2. My question is that does WSO2 provides any service if the physical server itself (on which WSO2 is hosted) shuts down for any possible reason?
I know there may be several MANUAL alternatives for that but does WSO2 have a particular feature for physical server migration?
Note: Please let me know of what you think before down voting.
This can be achieved by clustering which is supported by WSO2 products, please refer clustering documentation for more information [1]. Fail over and Switch over can be configured automatically. Also you can achieve High Availability (HA) with multiple redundant nodes.
[1] https://docs.wso2.com/display/CLUSTER44x/Overview

WSO2 Throttling API

I have gone through read the various questions involving throttling on stack overflow. However, I didn't find anyone with a similar issue to what I'm seeing. I have gone through the tutorials and setup process on the WSO2 site regarding throttling.
This is what I have done:
Setup an additional tier to allow 5 calls per minute on the
following levels (Advanced Throttling, Application Throttling,
Subscription Throttling).
Edit the API and set the subscription tier level to the new custom
tier
Set the Application to the new tier level
Set the Advanced Throttling Policy to apply to the API, then I saved & published
Ran 1100 HTTP requests from an application that calls the API on an
interval every second. Every request made was successfully processed
without any throttling.
I installed version 1.9 of API manager and setup the very same rules
The requests were throttled correctly.
Any help would be greatly appreciated, I'm not really sure if it is a bug or a configuration issue on my end.
Regards
So after much digging in the WSO2 documentation. I have found that in order to use the advanced throttling techniques (which are enabled by default) you must use Traffic Manager (which is disabled by default).
There are instructions on how to use Traffic Manager in the WSO2 documentation. If advanced throttling is disabled the basic throttling works as expected.
It took some time to discover this as the documentation doesn't clearly make the distinction very clear in the documentation.
I hope this helps someone having a similar issue.

how to persist runtime parameter of a service call then use as parameter for the next service call WSO2 ESB

I am seeking advice on the most appropriate method for the following use case.
I have created a number of services using the WSO2 Data Services Server which I want to run periodically passing in parameters of last run date. ie. the data services has two parameters start and end dates to run the sql against.
I plan to create a service within WSO2 ESB to mediate the execution of these service, combine the results to pass onto another web service. I think I can manage this ;-) I will use a scheduled task to start this at a predefined interval.
Where I am seeking advice is how to keep track of the last successful run time as I need to use this as parameters for the data services web services.
My options as I see them
create a config table in my database and create another data services web service to retrieve and persist these values
use vfs transport and somehow persist these values to a text file as xml, csv or json
use some other way like property values in the esb sequence and somehow persist these
any other??
With my current knowledge it would seem that 1 is easiest but it doesn't feel right as I would have to have write access to the database, something I possibly wouldn't normally have when architecting a solution like this in the future, 2 appears like it could work with my limited knowledge of WSO2 ESB to date but is 3 the best option? But as you see from the detail above this is where I start to flounder.
Any suggestions would be most welcome
I do not have much experience with ESB. However I also feel that your first option would be easier to implement.
A related topic was also discussed in WSO2 architecture mailing list recently with subject "[Architecture] Allow ESB to put and update registry properties"
It was discussed to introduce a registry mediator, but I'm not sure it will be implemented soon.
I hope this helps.
As of now there is no direct method to save content to ESB through ESB. But you can always write a custom mediator to do that or use the script mediator to achieve this
Following is the code snippet for the script mediator
<script language="js"><![CDATA[
importPackage(Packages.org.apache.synapse.config);
/* creates a new resource */
mc.getConfiguration().getRegistry().newResource("conf:/store/myStore",false);
/* update the resource */
mc.getConfiguration().getRegistry().updateResource(
"conf:/store/myStore", mc.getProperty("myProperty").toString());
]]></script>
I've written a blog post on how to do this in ESB 4.8.1. You can find it here