TECHZEN Zenoss User Community ARCHIVE  

zodb_session database and tables

Subject: zodb_session database and tables
Author: Thomas Luther
Posted: 2015-06-02 03:35

I have a couple of zenoss 4.2.5 installations, and now I noticed that I was running out of disk space on the database partition.

I noticed that the database zodb_session and especially the connection_info table keeps growing... it seems as though it creates an entry every time a user does something in the webinterface!

I have tried to look at /opt/zenoss/Products/ZenUtils/patches/mysqladaptermonkey.py and if the comment is correct, then an entry is added on every open of the database, however there is no cleanup of this table!

Zenoss Core 4.2.5 installed with core-auto-deploy
Centos 6.6

This is a sample of one entry, but all entries are the same:

connection_id: 394373
pid: 23598
info: pid=23598 tid=140348071945984
/opt/zenoss/zopehome/runzope -C /opt/zenoss/etc/zope.conf
File "/opt/zenoss/lib/python/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
response=b)
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 443, in publish_module
environ, debug, request, response)
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 237, in publish_module_standard
response = publish(request, module_name, after_list, debug=debug)
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 134, in publish
transactions_manager.commit()
File "/opt/zenoss/lib/python/Zope2/App/startup.py", line 301, in commit
transaction.commit()
File "/opt/zenoss/lib/python/transaction/_manager.py", line 89, in commit
return self.get().commit()
File "/opt/zenoss/lib/python/transaction/_transaction.py", line 333, in commit
self._commitResources()
File "/opt/zenoss/lib/python/transaction/_transaction.py", line 447, in _commitResources
rm.commit(self)
File "/opt/zenoss/lib/python/ZODB/Connection.py", line 562, in commit
self._commit_savepoint(transaction)
File "/opt/zenoss/lib/python/ZODB/Connection.py", line 1159, in _commit_savepoint
self._log.debug("Committing savepoints of size %s", src.getSize())
File "/opt/zenoss/lib/python/relstorage/storage.py", line 374, in getSize
return self._adapter.stats.get_db_size()
File "/opt/zenoss/lib/python/relstorage/adapters/stats.py", line 47, in get_db_size
conn, cursor = self.connmanager.open()
File "/opt/zenoss/Products/ZenUtils/patches/mysqladaptermonkey.py", line 47, in open
record_pid(conn, cursor)
File "/opt/zenoss/Products/ZenUtils/patches/mysqladaptermonkey.py", line 34, in record_pid
stacktrace = ''.join(traceback.format_stack())

ts: 2015-06-02 10:33:50
1 row in set (2.30 sec)



Subject: you can nuke and recreate
Author: Andrew Kirch
Posted: 2015-06-02 09:40

you can nuke and recreate zodb session.
stop zenoss
drop it
create it
start zenoss (we'll repopulate it)

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: But I really don't want to
Author: Thomas Luther
Posted: 2015-06-03 00:33

But I really don't want to take zenoss offline as I have users on it... IMHO it is not a good design when you have to stop a service, delete something that isn't used, and then start it again.

I would rather that someone who knows what the point is with this table, to review the code and fix it so that either:
* it doesn't log to that table
* it will delete old entries from the table
* overwrite existing entries

Until now, I have worked around the problem by deleting the DB... but again, this is not a good design.



Subject: it wouldn't be difficult to
Author: Andrew Kirch
Posted: 2015-06-03 10:31

it wouldn't be difficult to write a ZenPack to rotate that database. Keep in mind we're opensource and you can always add ZenPacks!

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: But still.. what is the point
Author: Thomas Luther
Posted: 2015-06-04 00:48

But still.. what is the point of logging "fake" stack-traces to a database just because somebody has made a connection to Zenoss (or whatever actually happens)



Subject: This is functionality that
Author: Andrew Kirch
Posted: 2015-06-04 10:29

This is functionality that Zenoss inherited from Zope. We're in the process of evaluating replacements for Zope, but it's a large complex component and this will take time.

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: This problem just nailed us
Author: [Not Specified]
Posted: 2015-11-04 08:31

This problem just nailed us too.

We did not see this behavior on our previous version of Zenoss 3.2.1

Now running 4.2.5

Is there an update on this situation A better way to clear out those tables
As noted above we can't be bringing down a production system to do this.



Subject: What would be involved in
Author: [Not Specified]
Posted: 2015-11-04 08:35

What would be involved in writing a zenpack to do this

What would the zenpack do exactly



Subject: I wrote the following simple
Author: [Not Specified]
Posted: 2015-11-05 09:18

I wrote the following simple little BASH script to clear the database. It takes about 1 minute 20 seconds to execute on my systems. I would really like to hear back on what can be done to disable this "feature" of the zodb_session database growing without end.

#!/bin/bash

/etc/init.d/zenoss stop
echo "============"
ls -al /var/lib/mysql/zodb_session
echo "============"
echo "drop database zodb_session;" | mysql
echo "show databases;" | mysql
echo "============"
ls -al /var/lib/mysql/zodb_session
echo "============"
echo "create database zodb_session;" | mysql
echo "show databases;" | mysql
echo "============"
ls -al /var/lib/mysql/zodb_session
echo "============"
/etc/init.d/zenoss start



< Previous
Upgrade 5.0.2 to 5.0.3
  Next
Unable to install Quilt and Percona
>