Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Pyramid + ZODB + RelStorage performances #498

Closed
tflorac opened this issue Jun 7, 2023 · 2 comments
Closed

Question about Pyramid + ZODB + RelStorage performances #498

tflorac opened this issue Jun 7, 2023 · 2 comments
Labels

Comments

@tflorac
Copy link

tflorac commented Jun 7, 2023

Hi!
I'm working on a Pyramid application using ZODB and RelStorage with a PostgreSQL backend.
This application is a document management application using many file blobs which are stored on the filesystem (not in PostgreSQL), and a catalog is used to index documents metadatas. The application is running in an Apache process using mod_wsgi.
My question is that we have another application which is used to transfer documents from another repository to this one; this application is only using one process and one thread to avoid ZODB conflicts on catalog updates; when the application is started, we handle approximately 120 transactions/minute and everything is OK but after 50 to 60 minutes, transactions rate is quickly decreasing down to 30 tpm!
While looking at server processes, it seems that most activity is related to PostgreSQL; I tried to disable autovacuum but it doesn't change anything! If I reload the Apache service, the transaction rate is restarting at 120 tpm before decreasing after another hour of high activity...
So, does anyone have any idea about the origin of this increase in PostgreSQL activity and performance decrease?

Best regards,
Thierry

@jamadden
Copy link
Member

In our experience running a very large, very active site, we didn't find performance degradation associated with just being up and processing transactions, assuming consistent transaction sizes. I wouldn't consider such degredation normal.

I would probably first start by increasing the various cache sizes (the ZODB connection's ghost cache, the RelStorage internal pickle cache). (You could also look to make sure you don't have any idle-in-transaction connections open to the database.)

But that's a shot in the dark without knowing much, much more about your application's behaviour. To find out more, look at the metrics that RelStorage produces by hooking it up to a StatsD/Graphite system with a visualization front-end (graphite itself comes with a simple one). See also the perfmetrics package documentation. RelStorage can also be configured to log some interesting performance information as well; this configuration is usually handled with environment variables (of which RelStorage supports many!). Many environment variables are documented (in the release notes and/or API documentation), but if you have the relstorage logger configured at debug level when RelStorage is imported, all the environment variables it reads will be logged.

Good luck!

@tflorac
Copy link
Author

tflorac commented Jun 28, 2023

Hi Jason,
As I use a quite huge catalog, I actually increased the RelStorage cache size and everything seems much better now!
Thank you anyway for all your advises!
Best regards,
Thierry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants