Hi,
I want to close the sessions (which were unused for a long time say 48 hours) automatically.
But i dont want to close them explicitly by writting Close_Session command.
Is it possible in vertica?
Please help me.
Thanks in advance,
Raj.
Closing idle sessions automatically
Moderator: NorbertKrupa
-
- Intermediate
- Posts: 87
- Joined: Wed Apr 25, 2012 8:10 am
Closing idle sessions automatically
Rajasekhar.T|HP ATP Vertica Big Data Solutions V1
-
- Intermediate
- Posts: 149
- Joined: Mon Apr 30, 2012 10:04 pm
- Location: New York
- Contact:
Re: Closing idle sessions automatically
I do not believe this functionality exists in the current version but a simple cron script should be able to handle this for you.
Re: Closing idle sessions automatically
I agree with @juniorfoo. You can set max session duration, but i don't know about any feature with IDLE.
For current max session duration:
For current max session duration:
Code: Select all
dbadmin=> show runtimecap;
name | setting
------------+-----------
runtimecap | UNLIMITED
(1 row)
-
- Beginner
- Posts: 42
- Joined: Thu Apr 19, 2012 9:03 pm
Re: Closing idle sessions automatically
What do you guys think of this solution for closing idle sessions?
I created a shell script file containing the following commands:
I run the script every 10 minutes as a cron job.
Anyone see any problems with this?
I created a shell script file containing the following commands:
Code: Select all
/opt/vertica/bin/vsql -U dbadmin -c "SELECT 'close_session(''' || session_id || ''');' FROM sessions s join users u on u.user_name = s.user_name WHERE s.login_timestamp <= timestampadd(minute, -45, sysdate) AND s.current_statement = '' AND u.is_super_user = 'f';" -o /home/usr/dbadmin/close_session.sql -t
/opt/vertica/bin/vsql -U dbadmin -f /root/vload/close_session.sql -o /home/usr/dbadmin/close_session.out
Anyone see any problems with this?
Re: Closing idle sessions automatically
billykopecki,
I need to also implement this functionality. Is what you did working ok? Another DBA told me that its a bad idea to close sessions without letting the user know first. Also, have you seen any performance problems with leaving idle session open?
Thanks!
I need to also implement this functionality. Is what you did working ok? Another DBA told me that its a bad idea to close sessions without letting the user know first. Also, have you seen any performance problems with leaving idle session open?
Thanks!
Thank, Fred
-
- Intermediate
- Posts: 87
- Joined: Wed Apr 25, 2012 8:10 am
Re: Closing idle sessions automatically
Hi fsalvelt,
Yes there is a performance issue , if the sessions were left idle..
Thanks,
Raj.
Yes there is a performance issue , if the sessions were left idle..
Thanks,
Raj.
Rajasekhar.T|HP ATP Vertica Big Data Solutions V1
Re: Closing idle sessions automatically
Can we close sessions that are active?