How long should submitting an invoice take?

Hi,

Submitting a draft invoice at the moment take several seconds, almost a minute. Is this normal?

No it’s not

Is there a way to check what is the cause?

Monitor your server resources

Well i can see cpu usage getting to around 80% while it’s submitting but how does that help with finding the cause?

Now look for the services running and see which ones are consuming the CPU.
Filter out all the possibilities of your server being compromised or misconfigured.

Do you have enough ram?

I have 4GB RAM. This is on self hosted debian 9 VPS. Is that enough?

Yes this is enough.

The thing is, i’m submitting some really old invoices. Could that be the reason? I mean, there are a few thousands of invoices that came after those.

Can not say anything without looking at the processes.

Can’t post those atm, i’m doing a data import, so system usage will not be realistic. But theoretically speaking, would submitting old invoices be a lot slower than making and submitting new ones? I’m thinking it could have something to do with db indexes or rather lack thereof

Yes, this could be a possible reason. This is because when you post older invoices/stock entries, it also recalculates entries in the ledger corresponding to the new backdated entry. If the entry is taking a lot of time, it will ultimately result in a time-out.

I would suggest testing this by creating an invoice on the current date with the same data just to crosscheck.

PS, you might be interested in this thread concerning posting/correction of historical data.

That makes sense indeed. Thank you!