We have been using ERPnext’s Purchase and Selling module since last 2 months. Recently we’ve had a plan to scale the usage to multiple cities. For this, we created new customers and a lot of warehouses.
As a result of this, now on submitting purchase receipt or delivery note, transaction is taking a lot of time and its getting timed out (time out set to 120 seconds). During this 120 seconds, all other transactions (including browsing) are stuck. As a result of which all users have to wait for 120 seconds.
This is causing a serious damage to our business. For the last 2 days, almost all the erp related transactions are stuck.
There is a method update_gl_entries_after being called inside make_gl_entries written in StockController.
update_gl_entries_after:
In this method, future stock vouchers are fetched and corresponding GL entries are fetched for the given items and warehouses. Now these expected GL entries are tallied with already existing GL entries, if there is a mismatch, then all gl entries of the voucher are deleted and recreated. This process was happening in a loop.
This was the problem why the server was getting stuck for 2 minutes (specified timeout).
Though I am not sure why there was a repetitive mismatch in gl entries.
I have same problem but regarding purchase module. It takes too time to load. I am worried if my data increases i dont want to lose data as well as the performance.
@rmehta, I think it would be better to use hash value instead of naming series in tabGl Entry because for each gl entry system creates row level lock in tabSeries table.
Naming series changes are still not available in develop branch. We have done it in our fork for time being. We need to still nail the right approach.
Other optimisations related to get_doc and gt_value will be available in version 11. Not sure if they can be merged in 10 as well. @nabinhait can comment.