sqlalchemy - python web page RE-loads generate dozens of transactions -
been working on python website pyramid & sqlalchemy. changed logging setup showing filename being used, function being used, , line number manually logged items. log level debug.
initial page load runs small handful of transactions. depending on page, < 5 of similar this
/opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> _commitresources >> 392 :: commit <zope.sqlalchemy.datamanager.sessiondatamanager object @ 0x7f984c12e6a0> /opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> _commitresources >> 392 :: commit <zope.sqlalchemy.datamanager.sessiondatamanager object @ 0x7f984c1184a8> /opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> commit >> 288 :: commit /opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> __init__ >> 108 :: new transaction
this reveals problem, related, each page access generates 2 accesses. when writing db, example, i've had work around testing record first, otherwise 2nd time thru bonk on unique keys.
anyway, if reload page, generates 40-50 _transaction.py
calls. haven't counted, it's 3-4 screen pages in python console of this:
/opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> __init__ >> 108 :: new transaction /opt/project/lib/python3.4/site-packages/transaction/_transaction.py >> commit >> 288 :: commit
that's path/to/filename.py
>> function name()
>> line number :: message.
the site kind of enhanced blog. there's posts specific content, comments on content, , list page posts. there's home , profile.
i 'transactions' because filename appears on , on _transaction.py. , see it's database related. , expect that, if anything, generate fewer db interactions.
the questions are
- why losing it's mind only on reload of things?
- what @ decipher this?
- is there log option can show me more verbose internal python context? might bit if there 'step' level option that'd me narrow down.
Comments
Post a Comment