Back

Test appwrite performance

  • 0
  • Self Hosted
rohan
16 Jul, 2023, 06:29

Hi, I'm running appwrite on my vps.. I just want to know the performance and limits of appwrite on my vps. Is there anyway to check the performance?

TL;DR
The user wants to test the performance and limits of Appwrite on their VPS. They can run load and stress tests using tools like oha or k6s. It is recommended to test endpoints like creating documents, getting documents, and executing functions. To ensure accurate results in the stress test, adding a sleep function to the k6s testing suite is suggested. It's important to run the tests without any DNS in the middle like Cloudflare. Performance can be measured by the server's ability to respond to connections and remain responsive over time. Links to oha and k6s are provided for reference.
Drake
16 Jul, 2023, 15:39

I'm general, you would perform a load test with something like k6

Binyamin
16 Jul, 2023, 16:54

You can run a few tests type to get a grasp of your Appwrite performance.

Tests

Run your tests against some endpoint that will have to do some Appwrite logic. The best would be

  • POST creating document - /v1/databases/{databaseId}/collections/{collectionId}/documents
  • GET getting documents - /v1/databases/{databaseId}/collections/{collectionId}/documents
  • POST executing a function /v1/functions/{functionId}/executions Make sure to turn off abuse protection, check _APP_OPTIONS_ABUSE in https://appwrite.io/docs/environment-variables#general

Load test First as Steven suggested run a "load test" in which you'll test the ability of your server to response to as much connections possible, You can use oha/k6s for that one

Stress test Second, now you can run a "Stress test" in which you're testing the ability of your Appwrite server to remain responsible over time! Because you're testing the server ability to server N users it will be best to add sleep to your k6s testing suite, like so:

TypeScript
import http from 'k6/http';
import {sleep} from 'k6';

export default () => {
  const data = {
    "data": JSON.stringify({data:'someData'})
  }

  // Executing a function.
  const urlRes = http.post('https://you.appwrite.cloud/v1/functions/{functionId}/executions',JSON.stringify(data),{
    headers: { 
      'Content-Type': 'application/json' 
      'X-Appwrite-Project': '5df5acd0d48c2' 
      },
  });
  

  sleep(1);
}

Without adding the sleep the stress tests become load testing and won't give close-to-the-truth results.

Make sure to run all those tests without any DNS in the middle like Cloudflare (you can avoid that by using custom hosts file in the local machine)

Links:

rohan
17 Jul, 2023, 02:41

I guess I need to use api keys so that I won't be rate limited by appwrite

Binyamin
17 Jul, 2023, 02:42

Yes Or you can disable the abuse which remove the rate limiter

rohan
17 Jul, 2023, 02:43

But there are no limitation for api keys right?

Binyamin
17 Jul, 2023, 02:43

No

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more