Thanks a lot for your detailed reply...
I will send a reply in the next days (hoping in the meanwhile you will be able to replicate the bug I encountered as you can obviously understand better than me the connection pooler) as I want to examine what you wrote, but there is one thing about the worker's pool I don't understand (it is one of the test already described in my first post):
If a worker is associated (by a map structure) to the psp name and I send one push to the service A (some hundreds of subscribers) and after that one push to service B (some hundreds of subscribers) the result (using the apns simulator) is 13 connection opened for the first push and 13 for the second. Then if I wait some minutes I repeat the first push to service A (a service different than the one of the last push and equal to the one of the first push with already 13 connection opened). I thought that this push used the 13 connections already opened by the first push or blocks (because max active connection for the pool had been reached). The third push opened other 13 connections instead even if there is a worker's pool associated with the same psp name already opened.
Did I made a mistake thinking about the pool reuse, thinking that there are 13 connection more than the right number?
You already told me that could be a connection pool issue, this question is only to understand my knowledge of your code.
Thanks,
Serafino.
| func (self *Pool) popIdle() *pooledConn { | |
| for len(self.idle) > 0 { | |
| conn := self.idle[len(self.idle)-1] | |
| self.idle[len(self.idle)-1] = nil | |
| self.idle = self.idle[:len(self.idle)-1] | |
| // Ignore any connection which is in idle state more than 15 | |
| // min. | |
| if time.Now().Sub(conn.timestamp) > 15*time.Minute { | |
| continue | |
| } | |
| self.nrActiveConn++ | |
| return conn | |
| } | |
| return nil | |
| } |
You received this message because you are subscribed to a topic in the Google Groups "uniqush" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/uniqush/sC_EB3mmiVA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to uniqush+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all’ente sopraindicati. La diffusione, distribuzione e/o copiatura non autorizzata del documento trasmesso da parte di qualsiasi soggetto è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente. Grazie.
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Thanks
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
[Push][Info] 2014/09/24 09:16:15 Connection closed by APNS: read tcp 10.20.50.121:8080: use of closed network connection
> email to uniqush+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "uniqush" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/uniqush/sC_EB3mmiVA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to uniqush+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Serafino Sorleti
mailto:serafino.sorleti@acotel.com
Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all’ente sopraindicati. La diffusione, distribuzione e/o copiatura non autorizzata del documento trasmesso da parte di qualsiasi soggetto è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente. Grazie.
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Thanks
--Serafino Sorleti
mailto:serafino.sorleti@acotel.com
Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all’ente sopraindicati. La diffusione, distribuzione e/o copiatura non autorizzata del documento trasmesso da parte di qualsiasi soggetto è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente. Grazie.
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Thanks
--
You received this message because you are subscribed to the Google Groups "uniqush" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uniqush+unsubscribe@googlegroups.com.
#!/bin/sh#command line arguments#uniqush-push ipmachine_ip=$1#max_rangemax_range=$2#subscribers list stringssubscribers=""special_char="."separator=","#push service providers names arrayARRAY_SERVICES=(simserv simserv2)ARRAY_SUBSCRIBERS_PREFIX_BY_SERVICE=(usr usr_psp2)range_service_array=2echo "Created push service providers names array: "${ARRAY_SERVICES[*]}#subscribers array rangerange_max_users_for_single_push=$max_range#infinite loopindex=0while [ $index -lt 1 ]do#set push provider by service namechosen_service=`expr $RANDOM % $range_service_array`#chosen_service=0echo "Chosen service: "${ARRAY_SERVICES[$chosen_service]}echo "and so subscriber id prefix: "${ARRAY_SUBSCRIBERS_PREFIX_BY_SERVICE[$chosen_service]}#set max user for each single push requestmax_user=`expr $RANDOM % $range_max_users_for_single_push`echo "Number of subscriber for this push: "$max_user#generate subscribers listsubscriber_name=${ARRAY_SUBSCRIBERS_PREFIX_BY_SERVICE[$chosen_service]}subscribers=""counter=0while [ $counter -le $max_user ]doif [ $counter -eq 0 ]thensubscribers=$subscribers$subscriber_name$special_char$counterelsesubscribers=$subscribers$separator$subscriber_name$special_char$counterficounter=`expr $counter + 1`done#send http call to uniqush with the random chosen service name and random subscribers list items numberecho curl http://$machine_ip:9898/push -d service=${ARRAY_SERVICES[$chosen_service]} -d subscriber=$subscribers -d msg="Hello World"curl http://$machine_ip:9898/push -d service=${ARRAY_SERVICES[$chosen_service]} -d subscriber=$subscribers -d msg="Hello World"sleep 1done
Total: 14.5 MB5.5 37.9% 37.9% 5.5 37.9% reflect.mapassign2.0 13.8% 51.7% 3.5 24.1% github.com/uniqush/cache.(*Cache).Set1.5 10.3% 62.1% 1.5 10.3% container/list.(*List).insertValue1.5 10.3% 72.4% 1.5 10.3% makemap_c1.0 6.9% 79.3% 1.0 6.9% encoding/json.(*decodeState).literalStore1.0 6.9% 86.2% 1.0 6.9% fmt.Sprintf0.5 3.4% 89.7% 0.5 3.4% allocg0.5 3.4% 93.1% 0.5 3.4% encoding/json.stateBeginValue0.5 3.4% 96.6% 0.5 3.4% github.com/uniqush/uniqush-push/push.NewEmptyDeliveryPoint0.5 3.4% 100.0% 0.5 3.4% syscall.anyToSockaddr-------Total: 28.5 MB10.5 36.8% 36.8% 10.5 36.8% reflect.mapassign4.0 14.0% 50.9% 4.0 14.0% container/list.(*List).insertValue4.0 14.0% 64.9% 4.0 14.0% encoding/json.(*decodeState).literalStore2.5 8.8% 73.7% 6.5 22.8% github.com/uniqush/cache.(*Cache).Set2.0 7.0% 80.7% 2.0 7.0% fmt.Sprintf2.0 7.0% 87.7% 2.0 7.0% github.com/uniqush/uniqush-push/push.NewEmptyDeliveryPoint2.0 7.0% 94.7% 2.0 7.0% makemap_c0.5 1.8% 96.5% 0.5 1.8% allocg0.5 1.8% 98.2% 0.5 1.8% encoding/json.stateBeginValue0.5 1.8% 100.0% 0.5 1.8% syscall.anyToSockaddr-------Total: 43.5 MB18.0 41.4% 41.4% 18.0 41.4% reflect.mapassign5.5 12.6% 54.0% 5.5 12.6% makemap_c4.0 9.2% 63.2% 4.0 9.2% container/list.(*List).insertValue4.0 9.2% 72.4% 4.0 9.2% encoding/json.(*decodeState).literalStore4.0 9.2% 81.6% 8.0 18.4% github.com/uniqush/cache.(*Cache).Set3.0 6.9% 88.5% 3.0 6.9% github.com/uniqush/uniqush-push/push.NewEmptyDeliveryPoint2.5 5.7% 94.3% 2.5 5.7% fmt.Sprintf1.5 3.4% 97.7% 1.5 3.4% encoding/json.stateBeginValue0.5 1.1% 98.9% 0.5 1.1% allocg0.5 1.1% 100.0% 0.5 1.1% syscall.anyToSockaddr-------Total: 61.0 MB26.5 43.4% 43.4% 26.5 43.4% reflect.mapassign7.5 12.3% 55.7% 7.5 12.3% makemap_c5.5 9.0% 64.8% 5.5 9.0% container/list.(*List).insertValue5.0 8.2% 73.0% 5.0 8.2% encoding/json.(*decodeState).literalStore5.0 8.2% 81.1% 10.5 17.2% github.com/uniqush/cache.(*Cache).Set4.0 6.6% 87.7% 4.0 6.6% github.com/uniqush/uniqush-push/push.NewEmptyDeliveryPoint3.5 5.7% 93.4% 3.5 5.7% fmt.Sprintf3.0 4.9% 98.4% 3.0 4.9% encoding/json.stateBeginValue0.5 0.8% 99.2% 0.5 0.8% allocg0.5 0.8% 100.0% 0.5 0.8% syscall.anyToSockaddr-------
Top Output at the time i killed the test_push_20141609.sh scriptPID COMMAND %CPU TIME #TH #WQ #POR #MREG MEM RPRVT PURG CMPR2718 uniqush-push 0.0 01:25.90 10 0 45 1483 146M 145M 0B 0B
Total: 72.5 MB30.5 42.1% 42.1% 30.5 42.1% reflect.mapassign9.0 12.4% 54.5% 9.0 12.4% makemap_c8.0 11.0% 65.5% 8.0 11.0% encoding/json.(*decodeState).literalStore6.0 8.3% 73.8% 6.0 8.3% github.com/uniqush/uniqush-push/push.NewEmptyDeliveryPoint5.5 7.6% 81.4% 5.5 7.6% container/list.(*List).insertValue5.0 6.9% 88.3% 10.5 14.5% github.com/uniqush/cache.(*Cache).Set3.5 4.8% 93.1% 3.5 4.8% encoding/json.stateBeginValue3.5 4.8% 97.9% 3.5 4.8% fmt.Sprintf0.5 0.7% 98.6% 0.5 0.7% allocg0.5 0.7% 99.3% 0.5 0.7% github.com/uniqush/uniqush-push/srv.clearRequest-------
TopPID COMMAND %CPU TIME #TH #WQ #POR #MREG MEM RPRVT PURG CMPR2718 uniqush-push 0.0 01:29.20 10 0 45 1483 146M 145M 0B 0B
--