4

We've noticed significant performance decreases when we move our AQL queries from ArangoDB's own REST API to a custom Foxx microservice. Is this to be expected?

For example, if we run a multithreaded load test from a remote machine that asks for the count of documents in an 800,000-document collection ("return LENGTH(MyCollection)") via the _api/cursor REST endpoint, we can process about 6,500 requests per second. If instead we call our own microservice that returns db._query('LENGTH(MyCollection)'), we can process only about 2,000 requests per second, a 69% decrease in throughput. (With a more complex query that does path traversals, we get a 32% decrease, and with a query that involves a geospatial index, the decrease is 60%.)

We're not sure what's causing this degradation. Any insight would be greatly appreciated.

Thanks!

  • How many V8 contexts are configured? – CodeManX Mar 29 '18 at 07:21
  • Also, compare the connection setup/teardown you have defined in Foxx as compared to your own REST API endpoint. Sometimes with Foxx endpoints a lot more payload/parameter validation is performed than could be done in your stand alone REST API. Have you cut both services down to the bare bones and compared their speed? Also, when testing the custom REST API, it ran on the same server as ArangoDB? Or was it run on a second server? Did the custom REST API cache data? – David Thomas Mar 29 '18 at 08:13
  • David, the REST API I mentioned is the one implemented by ArangoDB. It looks like http://99.99.999.99:8529/_db/MyDB/_api/cursor. We haven't implemented our own REST API. And yes, we're using bare bones code in both the REST API call and the Foxx microservice. It's just a single line of code in each case that returns the count of documents in one collection. – Nunzio Ewald Mar 29 '18 at 13:56
  • CoDEmanX, thank you for the suggestion about V8 contexts. We'll look into that. – Nunzio Ewald Mar 29 '18 at 14:03
  • Following CoDEmanX's suggestion, we set both javascript.v8-contexts-minimum and javascript.v8-contexts to 4. That improved the performance of our Foxx microservice: the 69% decrease in throughput that I mentioned earlier is now a 48% decrease. Bumping up the V8 parameters from 4 to 8 did not improve things further. – Nunzio Ewald Mar 30 '18 at 15:14
  • But that's still a significant performance degradation between using ArangoDB's own REST API and a custom Foxx microservice. Investigating further, we modified both our REST API call and our Foxx microservice to do nothing but return a hard-coded string. Now there aren't even any database accesses involved, but we still get a 22% performance degradation between the two approaches. Are there any other configuration parameters we should try tweaking? We have plenty of memory and CPU available, so in the tradeoff between performance and resources, we want to maximize Foxx performance. – Nunzio Ewald Mar 30 '18 at 15:16

0 Answers0