I recently developed a Mule 4 custom policy which intercepts an incoming request, makes an api call using the req body and from the response received, it appends a header with the response value. The policy works fine.
However when I load tested the api using JMeter (with and without policy), the policy seems to downgrade the performance.
For example, In the case without custom policy the threads executed were around 30k in 15mins. But with custom policy, the threads executed were only around 300 which is almost a 90% reduction in performance.
Has anyone previously come across such issues, or any resolution to improving the policy performance, of course caching is an option, but from what I understand, the policy is just a piece of code executed on the proxy, then why the reduction in performance?
Any help is appreciated, thanks in advance
I cannot share the code as it is internal to the company
2