Hello Group,I am confuse should I use singleton network connection for my application which process the logic in sidekiq job.
My application is using Net::LDAP which open/close a network connection on each request and these sockets are open/close very frequently and each connection socket is open/close in individual thread, so there is no sharing of socket among the threads in sidekiq process.
--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/a5bf4536-f201-456a-968b-57beb4430493%40googlegroups.com.
Use a connection pool:
On Tue, Dec 20, 2016 at 9:15 PM, Rahul Gupta <rahu...@gmail.com> wrote:
Hello,I forgot to add some details...
On Wednesday, December 21, 2016 at 10:36:34 AM UTC+5:30, Rahul Gupta wrote:Hello Group,I am confuse should I use singleton network connection for my application which process the logic in sidekiq job.My application is using Net::LDAP which open/close a network connection on each request and these sockets are open/close very frequently and each connection socket is open/close in individual thread, so there is no sharing of socket among the threads in sidekiq process.I was asked to make a singleton class which gives me 1 socket using get_instance method on class and this socket will be shared among 10 threads of 1 sidekiq process.I tried to use Mutex/syncrohnize to avoid race condition, but still there are multiple socket in system if I check using netstat.(Problem is still unsolved as of now).Is it a correct approach or could you suggest how to keep 1 connection per sidekiq process.Thanks,Rahul.
--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/a5bf4536-f201-456a-968b-57beb4430493%40googlegroups.com.