When perpetual inventory is enabled, it takes me about a 97 seconds (over a minute) to save and submit a new Sales Invoice.
When Perpetual Inventory is NOT enabled it only takes 1.5 seconds
What is going one here?
I have a very fast VPS with 4gb memory and 4gb of swap and 4 vCPU. Everything else runs quite well on this system. Only creating Sales Invoices is taking forever.
Creating new Items only takes about 4 seconds
Creating new Users only takes about 3 seconds
Running complex reports is also quite fast
I checked the slow query log and there are NO entries related to this issue. This tells me there is possibly a looping problem in the scripts because the mysql slow query log only records lengthy times to run a backup and NOTHING related to sql transaction related to creating new Sales Invoices.
So, while I was digging into this I also asked a friend with experience in this to try to track down the source of the slowdown. Here is what I got back as an answer:
" The web server is being called a lot, even when doing basic things. The 2 calls I see the most are these:
** GET /api/method/frappe.desk.form.utils.validate_link*
** GET /api/method/frappe.desk.notifications.get_open_count*
*There are probably 20 +calls to validate_link when creating a new Sales Invoice? *
This is part of the performance issues, I think."
Does anyone else have this going on in their new systems?
The problem that your friend referring to is a serious frontend bottleneck but it only affects you while creating the invoice not after sending the form to the server for submission.
I am making a current date current time sales transaction with Update Stock enabled. This is something any normal immediate sales transaction would be.
Just out of curiousity, what do you have for items in your invoice? Could you create an invoice for items which is non-stock. Is there a difference? Thanks
Wow, what a difference!!
Here is the top 5 tasks in the recorder list that take the most time for a “non-stock” sale. This was a sales invoice with a single item of no-stock type: