Hi,
Javascript policy is throwing time out error very frequently even when the traffic is very low.
Apigee version being used is : on-premise 4.17.09.
System details: 32 GiB of memory, 8 vCPUs, 64-bit platform.
Heap size for message processor and router are below:
1) message-processor.properties
bin_setenv_min_mem=1024m
bin_setenv_max_mem=3072m
bin_setenv_meta_space_size=1024m
2) router.properties
bin_setenv_min_mem=1024m
bin_setenv_max_mem=2048m
bin_setenv_meta_space_size=1024m
Could you please suggest a solution.
Note: it was working fine fro past 1 year and recently started getting this issue. restarted the machine and all apigee services , but issue did not get resolved.
Thanks!
How much code is in the JavaScript? Does it connect with any external systems? What else is going on in the environment?
The default timeout for a JS policy is 200ms. You can change this with a toplevel attribute on the policy: timeLimit.
The time required to run a JS policy depends on a number of things including:
For example, if you use httpClient in the JS policy, it will wait for the response from a remote system. IF that remote system does not respond within 200ms, then the JS policy will timeout. This has nothing to do with the "busy-ness" of the API Proxy or the machine configuration of the MP.
Supposing the JS does not make an external call out, Even if the JS is running very infrequently, if the MP itself is memory or CPU constrained, then the JS policy may take a long time (in wallclock time) to run. Which means it may time out.
Thanks Dino for the reply. The code complexity in JS is not much and also there is no external service call from JS. Actually things were working fine earlier , until we have upgraded java and kernel versions of our apigee server. After that message processor is using high CPU . Do you think that could be an issue for JS timeout . If yes , what could be the possible solution. We have reverted the java version but still the cpu usage is more for message-processor. Even if sometimes there is no timeout from JS , the reponse time is really high.