-
Notifications
You must be signed in to change notification settings - Fork 42
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
Clean up API request logs daily #132
Comments
This approach could work in cases with smaller sets of logs for sure. My major concern with this is that it doesn't have a limit. Even though this has it's own cron, it is still going to attempt to delete ALL rows from the DB, and on the first run it's likely to cause a massive spike in the MySQL CPU and Memory usage as it runs the query and then has to reindex all the tables touched. It'd be best if it has a limit attached to it and over time, your logs prune. Maybe adding an order by post_date ASC and limit to 200 (or something that makes sense for shared hosting environments) would help with not overrunning a cron and having it hit the PHP timeout, essentially leaving us in a state where all 3 of these didn't' complete correctly. |
Hi @cklosowski It's true that I was design this daily clean up after perform some manual clean up For that it will just facing daily API requests (around 5.000) A posible improvement could be, as you mention, limit the query and running it hourly |
Hi EDD team
I was facing issues with an excessive database size caused by the amount of posts and post metas generated by the EDD rest API
For that, I was in the need to create a functionality that cleans up all API requests logs and I want to share it to the EDD development team
The code is safe to run included if you make (finally) the migration of logs on another table since will query directly to database matching posts by post_type
There is the code:
Hope it helps
The text was updated successfully, but these errors were encountered: