I have a question about the appwrite functions, to put you guys in context, In my project, users can place their website URL for the purpose of scanning vulnerabilities the way i would like to scan for vulnerabilities is by using a python script, I have been researching about appwrite functions and I saw that they have support for python, in my mind I have the idea that I could create a function that receives in the request the url of the page, run the python script that scans for the vulnerabilities and return the json with the response, is this possible?
And is it a good way to do it or is there another way that you recommend to run scripts and that is better?
Also, what would happen if I have several users simultaneously running an appwrite function for scanning the vulnerabilites, do they all run at the same time or would there be a queue to not overload the server, how does that work?
yes, appwrite can handle this. however, one thing i would be cautious of is having a function that takes more than a couple seconds to execute because there's a chance it can be killed (usually due to inactivity).
You would probably be executing this function asynchronously. In the default self-hosted deployment of Appwrite, asynchronous function executions are queued and executed serially.
Could I by any chance increase the kill time by increasing the "Timeout" value in the function, located in the appwrite console?
the inactivity timer is the _APP_FUNCTIONS_INACTIVE_THRESHOLD env var. see https://appwrite.io/docs/environment-variables#functions
thanks Steven <:appwritefire:823999000330895380>
So if i have a function that takes 2-3 secs to complete and i have multiple users requesting to run this function, they are just being queued and could take 10+ secs to execute? Is there any way to run multiple instances of a function in parallel?
You would need to scale out the function worker horizontally
I was looking at this issue https://github.com/appwrite/appwrite/issues/1425 (which you commented on aswell), which says that parallel execution is implemented natively and that scaling the workers "can actually cause issues due to the internal runtime state". Can you confirm that?
No, scaling the workers shouldn't cause any issues with the internal runtime state.
@ianmont is everything good? Checking to see if this is resolved
its solved at the moment! thank you
[SOLVED] can the appwrite functions run scripts like this?
Recommended threads
- 408 Timeout / Curl Error 7 in Executor w...
Hey everyone, I am losing my mind over a routing loop/timeout issue on a fresh self-hosted setup. I have a single Linux VPS (IP: 45.141.37.105) and one domain (...
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...