Does anyone knows how many parallel processes Suit...
# suitescript
a
Does anyone knows how many parallel processes SuiteScript 2.1 API handles? or if this is documented somewhere? Imagine I'm deleting 100 records using
record.delete.promise
how may records would be deleted simultaneously?
👀 1
j
a
That is related to RESTlets and/or integrations, but what I'm thinking is about SuiteScript promises concurrency (meaning async tasks). I could be doing that from a UserEvent Script and deleting or creating 100 records using promises, would those records be created simultaneously, is there a limit? etc?
e
That'd be entirely dependent on the machine where your code runs and the configuration of Rhino/Nashorn on said machine. Can't imagine NetSuite ever publishing that level of detail
👍 1
There is always a practical limit, of course. Should you spin up 100 threads on a multi-tenant machine? 🤷 IDK
a
Thank you @erictgrubaugh
1
s
it's notable that
async
doesn't necessarily mean multiple concurrent threads. I don't know how this promise implementation is created on NetSuite but it's possible the 100 promises are only queuing up on a single thread.
☝️ 1
e
Yep, no way to know
(that I know of, anyway)
a
I will update this thread once I have a chance to test it, I have a RESTlet that take almost 10m to delete 100 records, I will refactor it to use promises and I will let you know what I get…
b
unless you messed up, it will likely complete in 5 minutes
s
From experience, I know you need to keep RESTlet execution time consistently below 5 minutes ( 300 seconds) otherwise the script can timeout and send back a non-success response to the calling client, even though the script may have partially or even fully succeeded in deleting what was requested. I’d even say that 50-100 seconds is more like my practical limit, as it allows Netsuite to degrade a bit during peak use and still not timeout.