Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Ingres Forums > Database General
 

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 2011-01-12   #1 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 218
Default Number of outbound connections on iigcn

Hi

What's the best way to see how many outbound connections there are on a IIGCC process?
When using iimonitor on a GCC I only see the inbound.
The ima_gcc_info table in imadb doesn't help me neither.
I know you can do it using grep on netstat, but I was wondering whether there is any Ingres tool where you can get the list of outbound sessions (or the number to start with).

Thanks
Frédéric
fba is offline   Reply With Quote
Old 2011-01-12   #2 (permalink)
Ingres Community
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 524
Blog Entries: 1
Default

Hi Frédéric,

Can you try the following SQL in [i]imadb[\i]:

Code:
execute procedure ima_set_vnode_domain;
select outbound_current from ima_gcc_info\g
That will give you the number of outbound connections, see help table for the other fields in ima_gcc_info. I'm not sure it's possible to get a list of outbound sessions but it should be possible to get the list of inbound sessions from the GCC process. However I don't believe there's an IMA table defined to expose that info.

regards

grant
grant is offline   Reply With Quote
Old 2011-01-12   #3 (permalink)
Ingres Community
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 524
Blog Entries: 1
Default

Quote:
Originally Posted by grant View Post
However I don't believe there's an IMA table defined to expose that info.
The following will give you a simple list of local/remote hosts/ports and an indicator flag to show if the connection is inbound or out bound:

Code:
drop table ima_gcc_sessions\g
register table ima_gcc_sessions (
        net_server                  varchar(64) not null not default
    is 'SERVER',
  local_node         varchar(20) not null not default
    is 'exp.gcf.gcc.conn.lcl_addr.node',
  local_port         varchar(20) not null not default
    is 'exp.gcf.gcc.conn.lcl_addr.port',
  remote_node         varchar(20) not null not default
    is 'exp.gcf.gcc.conn.rmt_addr.node',
  remote_port         varchar(20) not null not default
    is 'exp.gcf.gcc.conn.rmt_addr.port',
  inbound         varchar(20) not null not default
    is 'exp.gcf.gcc.conn.inbound'
) as import from 'tables'
with dbms = IMA,
structure = sortkeyed,
key = (net_server);\g
So you can now do:

Code:
select * from ima_gcc_sessions where inbound = 'N'
giving
Code:
* select * from ima_gcc_sessions where inbound='N'\g
Executing . . .


┌────────────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┐
│net_server                                                      │local_node          │local_port          │remote_node         │remote_port         │inbound             │
├────────────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
│esva-ubuntu::/@52970                                            │192.168.10.20       │50064               │10.100.10.178       │21064               │N                   │
│esva-ubuntu::/@52970                                            │192.168.10.20       │49331               │192.168.10.20       │27008               │N                   │
└────────────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┘
(2 rows)
continue
*
I hope this helps

g
grant is offline   Reply With Quote
Old 2011-01-12   #4 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 218
Default

Hi Grant

Yes, that's useful, but...
I don't see all connections. iimonitor shows more than 20 connections, and the table ima_gcc_sessions only shows 5 lines.
I checked in ima_mib_objects to make sure there isn't a problem with the ima_gcc_sessions table, and I only see 5 instances in ima_mib_objects.
Of course, I expanded to the comsvrs first (using ima_set_vnode_domain).

Apparently, the table ima_gcc_sessions does get everything I need.
Could this be a bug in IMA?

Thanks
Frédéric
fba is offline   Reply With Quote
Old 2011-01-12   #5 (permalink)
Ingres Community
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 524
Blog Entries: 1
Default

For every inbound/outbound connection you should see an entry in that table. At least that is what I see with Ingres 9.2. So the fact that you only see 5 entries would indicate this is a bug. What to you get when selecting from ima_gcc_info?
grant is offline   Reply With Quote
Old 2011-01-13   #6 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 218
Default

I did some checks on different version.
On 9.2 I don't think there is a problem. However, on 9.1.1 there seems to be a problem.
The table ima_gcc_info shows the inbound/outbound max divided by 100, and the current numbers show 0.

I still don't have a solution for Ingres II 2.6.
Is there a way:
1) to get the number of outbound connections,
2) to get a list with details of the outbound connections.

For the inbound, I can use ima_server_sessions to get some information.

Thanks
Frédéric
fba is offline   Reply With Quote
Old 2011-01-13   #7 (permalink)
Ingres Community
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 524
Blog Entries: 1
Default

The numeric truncation in ima_gcc_info appears to be a bug, 114612. The following SQL should fix it, changing varchar(10) to varchar(20), at least it did for me in a 2.6 installation I tested:

Code:
drop table table ima_gcc_info;
\p\g
register table ima_gcc_info (
	net_server		    varchar(64) not null not default
    is 'SERVER',
  inbound_max	      varchar(20) not null not default
    is 'exp.gcf.gcc.ib_max',
	inbound_current	  varchar(20) not null not default
    is 'exp.gcf.gcc.ib_conn_count',
	outbound_max	    varchar(20) not null not default
    is 'exp.gcf.gcc.ob_max',
	outbound_current	varchar(20) not null not default
    is 'exp.gcf.gcc.ob_conn_count'
) as import from 'tables'
with dbms = IMA,
structure = sortkeyed,
key = (net_server);
\p\g
As for getting a list of connections in IMA I don't think it's possible as the mib instances used in ima_gcc_sessions don't exist. So the only way to get a list of inbound connections per GCC would be to use netstat or lsof.

regards

grant
grant is offline   Reply With Quote
Old 2011-01-19   #8 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 218
Default

Hi Grant

I created the ima_gcc_info table using varchar(20) columns and now it works fine.
Thank you very much for your help!

Grtz
Frédéric
fba is offline   Reply With Quote
Old 2011-01-19   #9 (permalink)
Ingres Community
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 524
Blog Entries: 1
Default

you're welcome - take a look at Using IMA to get a list of inbound/outbound connections in GCC | An Ingres Blog for additional fields you can add (in later ingres versions).

g
grant is offline   Reply With Quote
Old 2011-01-19   #10 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 218
Default

@Grant. Yes, I saw that one. I already knew how to register tables in IMA and use the meta-table. Sometimes it's hard to know what the fields mean as the documentation in the Ingres manual is not complete. ;-)

Cheers
Frédéric
fba is offline   Reply With Quote

Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved