go-smpp icon indicating copy to clipboard operation
go-smpp copied to clipboard

Using tx.Submit in thread

Open tahseenjamal opened this issue 4 years ago • 2 comments

Can I use tx.Submit in thread ? I can see in the example_test it is used inside http Handler function

Also if I use tx.Submit in 10 threads, the delivery receipts traffic would increase. Will the Handler function of Transceiver perform fast enough ?

tahseenjamal avatar Oct 20 '21 15:10 tahseenjamal

I think as stated in the example it uses goroutines, so no problems with that and no performance benefit over calling over threads, the session is managed by the library unless you create multiple connections, some problems you gonna get is a timeout and the disconnections over a large number of submitSM, you should use rate limit and config the window param accordingly.

RateLimiter: rate.NewLimiter(rate.Limit(maxFreqLimiter), 1), // x per second is a good way to control it.

alexanderomnix avatar Oct 31 '21 22:10 alexanderomnix

@alexanderomnix thanks for replying. I observed that tx.Submit takes 250ms to complete. Which means on a single connect max TPS of 4. And that is the reason, I asked if I can use go routines. Correct me if am wrong here

Yes, I do use rate limit and window parameter

tahseenjamal avatar Nov 08 '21 07:11 tahseenjamal