Why am I getting a "500: Lua Quantum Limit Exceeded" error?

Follow

Do you have a script that is returning a "500: Lua Quantum Limit Exceeded" error? This is because of an instruction limit that is in place to prevent runaway Lua scripts. Every operation you do in a script will use one or many instructions, including loading modules. If your code is not efficient, or you load too many modules, it can cause this error to present itself and the script to fail. To avoid seeing this issue, we have a few mitigation suggestions:

  • Only load the modules you really need to use
  • Ensure that your code is as efficient as possible
  • If possible, break up complex operations into new handlers
  • Limit the number of queries to services
  • Consider pagination or make multiple queries

Of course if you have any questions or continue to run into trouble, do not hesitate to contact Exosite Support at: https://support.exosite.com/hc/en-us/requests/new

Have more questions? Submit a request

Comments