Panel for large scale applications

I was wondering peoples thoughts on using Panel for something like a large scale application, with possibly thousands of users. Is there any reason to think that this is not possible?

The multi page application I have been building has authentication using Okta, is running on Azure, and uses many of panels awesome components from pydeck/deckgl to lots of tabulator instances which take in user inputs aswell as a vast array of the panel widgets.

I already have a handful of users logging in and using the application and it is running very well.

As my application grows, should I be worried about anything going into production/public use? A lot of panel references revolves around projects for data science and the like. But I can’t see why this can’t be scaled up to a ‘proper’ web application.

Would be great to hear the communities’ thoughts!

1 Like

It will be interesting to hear thoughts. I don’t know if there are any examples of “large” applications. Fundamentally, it is all just a tornado app, so it should scale. In practice, you may need make sure that a) you really never block the main thread - this means you’ll need to use async/threads/workers depending on your app and b) Scale your server or deployment strategy accordingly to make sure you have enough resources for all users.

2 Likes

Yep both points make sense.
a) I have used async for long running calculations, however this is one of my main concerns, that one user instance will be affected by another blocking calculation if not foreseen, and even calculations that don’t seem slow will then obviously compound with scale. But I guess that is something that when running on a single server will always be something you have to deal with.

b) Scaling the server has been super easy running on Azure, simple case of changing to a higher tier which is great

1 Like

There is a lot of tips and tricks on scaling in the Prepare to share section.

1 Like

Depending on the app and use case, you may be able to convert it into a pyodide app which can run locally on users’ machines.

2 Likes

Thanks @ahuang11 It will be a consumer facing application running on azure. So running locally probably isn’t an option

Thanks @Marc . From the documentation:

  • It looks like a good starting point will be setting --num-procs N to match the number of processors on the sever.
  • Also setting automatic threading in pn.extension(nthreads=0)
  • Further to this I think i really will have to look into load balancing and understand that as my user base grows.
  • Outside of the above async where possible is a must.

I can’t see why this can’t be scaled. The unknown is the only worry!

Good luck! I’d definitely start with what’s in How-to — Panel v1.3.0 as mentioned above, trying to understand what new resources are allocated on the server when a user visits or performs various actions. You should be able to get major reductions in the resource requirements when you understand that, using the techniques outlined (e.g. caching).

1 Like