3

Currently, we're using Graphene-Django API on an Azure Virtual Machine that's running Ubuntu 18.04 LTS and Maria DB. We also have a React client that runs in a WordPress environment that interacts with this API. The client uses the Apollo boost package, and currently we're only using queries without any mutations. We can normally handle the traffic, and it's been running fine for about 6 months now. However, whenever traffic surges the API really starts to chug, and slows down drastically, to the point where queries can take upwards of a minute to complete. When the server is rebooted, the problem goes away.

Has anyone ever experienced anything like this before? I've researched this extensively, and can't seem to find any answers.

cardelio
  • 31
  • 2
  • Might be suffering from N+1 problem. Use optimiser/SQL joins to.overcome it. Profile the queries you run with django-silk, check if that many queries are necessary. – frozenOne Jun 17 '20 at 21:15
  • Side note: scalars are 10x faster with graphene. – frozenOne Jun 17 '20 at 21:15
  • This helped a ton, thank you so much – cardelio Jun 19 '20 at 20:52
  • No problem, had my fair share of performance related bottlenecks with graphene. They're saying graphene v3 will be async. Haven't tested it out yet, it'll release this year or so. – frozenOne Jun 19 '20 at 20:54
  • 3
    Scalars are 10x faster than what exactly? I also encounter performance issues with graphene, the queries are optimized (13ms) but some requests take 1500ms – Jasper Mar 12 '21 at 10:29

0 Answers0