betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

31 March 2017

fstail in ZODB

Just a little peep into the inner workings

Back in my Zope days, I once hunted for some writes to the ZODB being too big. I wrote a post called "Quasi-Normal in Numbers" about the experience. Back then I checked the size of the Data.fs file in the file system.

Nowadays I'm more into using Pyramid instead of Zope, I still use the ZODB (what can I say, it works well for me). And I still get sometimes the problem that a write puts in too many Bytes (or even kBytes) into the DB.

I've moved ahead though: Instead of checking the size of the database file on the file system, I discovered fstail. It's a little script that examines the end of the DB file and displays the last 10 transactions. (By default, actually you can use the parameter -n to get more). I didn't find any documentation of it, so I had to read the source and figur it out as good as I could.

So far I haven't solved today's problem, but I managed to solve a small sub-problem: I had some transactions that were committed by my code, and I couldn't identify them in the output. So today I learned to put some info onto that transaction:

url = getattr(request, 'url', 'no url')
note = "mymethod %s " % (url,)
transaction.get().setUser(user, path='')

With this I can at least identify which of the transactions are caused by manually committing the transaction in my code at that spot.

Note: fstail comes with ZODB, so in my Pyramid virtualenv, it's already in the virtualenv's bin directory, ready to use: fstail -n 20 /path/to/Data.fs.

Posted by betabug at 20:30 | Comments (0) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Start of Spring | Main | Das Krokodil in der Wand und anderes Schlängelzeugs >>
There are no comments.
You can trackback to:
There are no trackbacks.
Leave a comment