Research : Anvil VS Django Stress Test

Hi all,

I am currently use Anvil for my enterprise work. I had created 4-5 applications as enterprise internal app and our colleagues love it so much.

I saw several posts questioned about using Anvil for enterprise app and I am starting to make app that may have up thousand users.

So have some research here. Compare between Anvil & Python Django

  1. I created Anvil App and Python Django. The code do exactly the same. To create 1 row in database per 1 REST API request
    1.1 code in anvil

1.2 code in Django

  1. Host both apps on my Localhost server under Docker WSL. Intel Nuc i7 16 cores 64GB Ram.

  2. Ran stress test using LOCUST with 300 users and benchmark request/sec for both apps.

3.1 Anvil Stress Test Result (basic python3)

  • Around 65-75 Req / Sec
  • CPU of Anvil Application use 300-400% (3cores)
  • CPU of Database 3-12% ***
  • Ram of Anvil Application consume ~ 3-4GB
  • Ram of Database consume ~ 100MB
    -Average response time 4700ms
  • from 11903 requests = 35 Fail Request

3.2 Django Stress Test Result (pypy)

  • Around 350-400 Req / Sec
  • CPU of Django use 300% (3cores)
  • CPU of Database use 200% (2cores)
  • Ram of Django Application consume ~ 1.2 GB
  • Ram of Database consume ~ 100MB
  • Average response time 850 ms

I also try api for read / update and delete. The result is the same. Yo can run stress test like this and if you have better result please let me know how. I wish i could tune up Anvil to have better performance.

Conclusion :

  1. I use Anvil for very fast development and host them in a short time, not very high traffic. Anvil is the best. Decrease a lot of time for front-end , Google Integration , Security and Schedule Task.

  2. If your app have loads of requests then try to run stress test and make sure Anvil can support.

  3. I am now researching on using Anvil + Supabase. It is in the early stage but the result seems promising. Will update you more.

9 Likes

I would be curious to see a third option:

  • self hosted Django
  • self hosted Anvil
  • Anvil on server managed by Anvil

The difference in performance you just found, didn’t surprise me, because the strength of Anvil is fast development, not fast performance.

But I would be curious to see how a professional account behaves when the load goes from 10 to 50, to 100 or more requests per second.

(I have a dedicated server with two cores, which is more than enough for my 70 internal users and the few external users.)

2 Likes

My company have a Business Account. I will do it and post the update here.

Hi stefano.menci

This is my test from Business account.

The load of Anvil in Anvil server as below image.

It seems like after a minute when the many requests back-lock in server it started to fail so I decided to stop to save Anvil’s server.

If you want to use anvil for your Enterprise users. I recommend you self-host it in Docker. The performance is much better. If you need help on host it in docker please let me know. I wrote the Python Terminal CLI to help install Anvil , Library and Anvil-Extras just in a few click and works on both Windows Docker and Linux Docker.

2 Likes

This is great. Thank you! For item 3 Anvil + Supabase, I would like to mention there is a firebase library available. I know supabase is the independent version of firebase, but this library should make it relatively quick to implement and run your test.

Again, thanks for the research. Nothing speaks like data.

3 Likes

Thanks @anthonys

I saw the firebase library by @mark.breuss a while ago. Thanks to this guys. He created many useful library including client-fpdf. This inspired me to make my self useful to this community too.
(including Anvil-Extras Team. Thank you x 1,000,000)

There are some reason I do research on Supabase.
Besides It’s free , self-hosted and be able to manage very high request. it is alternative from Firebase that could be useful to other Anvil’s developer.

I will do it today and feedback.

Thanks for you guys for mini-heart on this topic.

5 Likes