Hi all,
I’m getting `conn error very often on one proccess. How can I monitor the number of connections to the q proccess or better, what makes this connections. I tried to monitor the current number of conns with .z.po and .z.pc functions:
connLog:( time:(); event:());
.z.po:{insert[connLog;((.z.D+.z.T); 1)]}; .z.pc:{insert[
connLog;((.z.D+.z.T); -1)]};
select time, (+) event from connLog
But it never exceeded 20 conns at one time. When this error occured, I checked the number of TCP connections to the q proccess and get small number.
We are running on windows.
Any ideas, how to find out the reason of this error?
Thanks
Pavel
Hi Pavel,
I’m not sure whether you should treat “close connection” as recovering from the incoming network allowance though.
I had this problem before where I had an application doing the “open, query and close” every second and after about 15min, this error came up.
Can you remove the .z.pc definition and redo your analysis again to see whether it hits the 1022 limit? Also note that outgoing connections can be added to the allowance as well…
I solve my problem by establishing a connection when the application is started, use the handle to do all the queries and only close connection when the application is closed.
Thanks for reply. I made this experiment:
do[1050;[c:hopen `:server:port; hclose c]]
this case has no error. If I do:
do[1050;[c:hopen `:server:port]]
I get 'conn error. So removing .z.pc from my logging would be mistake.
But you are right, that outgoing conns are counted as well (the explanation on http://code.kx.com/wiki/Errors is quite misleading)
do[600;[c:hopen :server:port1]]; do[600;[c:hopen
:server:port2]];
…end with 'conn error.
Dne pátek, 1. srpna 2014 11:34:22 UTC+2 WooiKent Lee@AquaQ napsal(a):
Hi Pavel,
I’m not sure whether you should treat “close connection” as recovering from the incoming network allowance though.
I had this problem before where I had an application doing the “open, query and close” every second and after about 15min, this error came up.
Can you remove the .z.pc definition and redo your analysis again to see whether it hits the 1022 limit? Also note that outgoing connections can be added to the allowance as well…
I solve my problem by establishing a connection when the application is started, use the handle to do all the queries and only close connection when the application is closed.
You can inspect .z.W (http://http://code.kx.com/wiki/Reference/dotzdotW) to see number of open ipc handles. It includes inbound and outbound. Mohammad Noor
Thank you, Mohammad, .z.W solves my problem.
Dne pátek, 1. srpna 2014 16:37:34 UTC+2 Mohammad Noor napsal(a):
You can inspect .z.W (http://http://code.kx.com/wiki/Reference/dotzdotW) to see number of open ipc handles.
It includes inbound and outbound.
Mohammad Noor