Limitations

Be aware of the following limitations when writing your server code. You will get an error when you try to deploy server code that violates these limitations.

  • You cannot use eval.
  • You cannot use setTimeout and setInterval.
  • You cannot use Array constructor.
  • You cannot use the following names as variables and functions.
    • Starting with "__kii_".
  • Cannot use __filename and __dirname.

Also, there are the following dynamic limitations. When server code violates these limitations, Kii Cloud will terminate the code execution and throw an exception or timeout occurs.

  • The total number of the executed steps must be less than 1000.
  • The total execution time must be less than 20000 msec.
  • The code cannot access the native resources like I/O.
  • The parameter of the server code must be less than 100 KB. The size includes the meta information for executing the server code (approximately 50 bytes).
  • You cannot use Object Body upload and download.

Server hooks have the following limitations:

  • You cannot return the execution result to the client.
  • When server code called by a server hook brings the situation where the defined condition is satisfied, another server hook will not be called. This is to prevent infinite loop of server code executions.

All limitations mentioned above apply to both free and paid plan.

How the executed steps are counted

The executed steps are counted with the following rules. Use them as hints to adjust your server code as needed.

  • One step count per one line of code (multiple lines concatenated with ; will be counted separately).
  • Control statements (e.g. for, if, else) are not counted.
  • Looping section by for and foreach statement are counted per execution (i.e. the number of lines in the section * the number of loops).