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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...