[SR-Users] Problem receiving large payloads from JSONRPC-S

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 10 09:00:22 CEST 2016


Have you set the parameter:

https://www.kamailio.org/wiki/cookbooks/devel/core#tcp_conn_wq_max

Cheers,
Daniel


On 09/08/16 18:46, Alex Balashov wrote:
> FWIW, the total response size according to Content-Length is close to
> 1 MB:
>
> -- 
> Header says content-length is: 737406
> Chunked: 5660
> Chunked: 14348
> Chunked: 17244
> ABORT!
> Runtime RPC client error: JSON parse error - SyntaxError: Unexpected
> end of input
> -- 
>
> The "ABORT!" comes from an event fired when the server (Kamailio)
> aborts the connection and closes the socket.
>
> -- Alex
>
> On 08/09/2016 12:27 PM, Alex Balashov wrote:
>
>> Hi,
>>
>> I'm requesting 'dlg.list' from JSONRPC-S via XHTTP on a rather busy
>> server, i.e.
>>
>> event_route[xhttp:request] {
>>         xlog("L_INFO", 'action=ER-XHTTP-REQUEST | ret=LOG_HTTP_REQ |
>> data={"method": "$rm", "path": "$hu", "source": "$si:$sp"}');
>>
>>         # Digest challenge omitted.
>>
>>         if($hu =~ "^/rpc") {
>>                 xlog("L_INFO", 'action=ER-XHTTP-REQUEST |
>> ret=JSON_RPC_REQUEST | data={"path": "$hu"}');
>>
>>                 jsonrpc_dispatch();
>>         } else {
>>                 xhttp_reply("404", "Not Found", "text/html", "");
>>         }
>> }
>>
>> # curl --digest -v \
>>   -X POST -H 'Content-Type: application/json' \
>>   -H 'Call-ID: abc12' \
>>   -d '{"jsonrpc": "2.0", "method": "dlg.list", "id": "0deadb33f"}' \
>>   'http://sipus_adm:raSheinmet4@10.0.62.74:5060/csrp_rpc/'
>>
>> and finding that when there's more than a hundred or so dialogs in play,
>> Kamailio abruptly closes the connection in the middle of returning the
>> output:
>>
>> -----
>>                 "tag":    "AF5DA9B4-6D5",
>>                 "contact":    "sip:14045551212 at xxx.xxx.xxx.xxx:5060",
>>                 "cseq":    "0",
>>                 "route_set":    "",
>>                 "socket":    "udp:xxx.xxx.xxx.xxx:5060"
>>             },
>> * transfer closed with 151674 bytes remaining to read
>> * Closing connection #0
>> curl: (18) transfer closed with 151674 bytes remaining to read
>>             "profiles":    ["total",[root at proxy kamailio]#
>> ------
>>
>> I can't seem to figure out what parameters regulate this. I'm using the
>> following TCP settings:
>>
>> tcp_async=yes
>> tcp_connect_timeout=5
>> tcp_crlf_ping=no
>> tcp_keepalive=yes
>> tcp_keepidle=30
>> tcp_linger2=10
>> tcp_max_connections=4096
>> tcp_send_timeout=3
>> tcp_accept_no_cl=yes
>> tcp_wq_blk_size=65535
>> tcp_wq_max=20971520
>>
>> But this doesn't seem to have had any effect.
>>
>> Any help appreciated!
>>
>> Thanks,
>>
>> -- Alex
>>
>
>

-- 
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list