Creative Productions, Arrangements and Operations • Art, Technology and Amusements. Software Engineer and certified FileMaker Pro developer and full-stack web developer by day, https//www.kupietz.com
Here's the SQL query to get all post revisions, which I do prior to cleaning them out of the database, which seems to make it much faster:
SELECT p.* FROM [posts table name] p WHERE (p.post_type = 'post' OR p.post_type = 'page') -- Include posts/pages AND (p.post_date BETWEEN '2020-01-01' AND '2029-07-01') -- Adjust date range OR (p.post_type = 'revision' AND p.post_parent IN ( SELECT ID FROM [posts table name] WHERE post_date BETWEEN '2024-01-01' AND '2024-07-01' ));
To get just a count of revisions, change SELECT p.* to SELECT count(*).
I removed a bunch of wildcard paths from rsnapshot.conf's exclude, and suddenly tonight my backup ran in a few minutes instead of taking over a day like it usually does.
Interesting, I've been looking off and on for at least the better part of a year for ways to lighten the load of rsnapshot's under-the-hood rsync backup commands, which reliably took up about half my CPU power almost continuously, and never found this tip before. You can see, plenty of wildcard paths removed, plus a few other things.
Here's a diff, rsnapshot.conf before changes (<) vs after (>): < verbose 1 --- > verbose 4 120c120 < loglevel 2 --- > loglevel 4 143a144,146 > rsync_short_args -Wa > #-W is transfer whole files without prescan, recommended for performance by https://serverfault.com/questions/639458/rsync-taking-100-of-cpu-and-hours-to-complete > #NOTE: if you set the above short…
- added var_dump(opcache_get_status()) to php status page to be able to monitor opcache usage
- changed warning logs from E_ALL & ~E_DEPRECATED & ~E_STRICT to ---- noticed contained a LOT of processes being stopped for tracing turned off request_slowlog_timeout by setting to 0s in had been 4s --- I had turned on lightspeed at 1:45 am est , aug 26. Seems like more problems since then.
None of the above seem to help, still getting freezes maybe every 30 minutes. Next…
This command shows your system's total, used, and free memory in a human-readable format.
Key metrics:
total: Total RAM.
used: RAM currently in use.
free: Unused RAM.
buff/cache: RAM used for file system buffers and page cache. This is good; Linux uses free RAM for this and frees it when applications need it.
available: The most important metric. This estimates how much memory is available for starting new applications without swapping.
Run it before and after: Run free -hbefore you increase max_children and then after your server has been running for a while under typical load with the new settings. Compare the available memory.
Add or change /etc/cron.d/sysstat to this. This creates a cron jobe to write file /tmp/outage_resource_log.txt that keeps minute-by-minute stats, sometimes useful in troubleshooting slowdowns. However, it's not a great way to do things, it create a small, constant resource drag, so disable it when done troubleshooting.
# The first element of the path is a directory where the debian-sa1 # script is located PATH=/usr/lib/sysstat:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin
# Activity reports every 10 minutes everyday #ORIGINAL DEFAULT WAS 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1 #uncomment above line and comment out /tmp/outage_resource_log.txt lines to restore original functionality * * * * * root date +"%Y-%m-%d %H:%M:%S" >> /tmp/outage_resource_log.txt * * * * * root sar -u 1 1 >> /tmp/outage_resource_log.txt 2>&1 * * * * * root sar -r 1 1 >> /tmp/outage_resource_log.txt 2>&1 * * *…
For confused first-time visitors and other people still acclimating, here is a description of these little tabs to the left, as well as some other features of the site.
Open "Expert Mode" CLI Navigation - this give you the option to switch your browser's display to an old-fashioned terminal mode where you may browse this site, view pages and images by typing text commands. Just like how we used to browse the web back in 1978!
Open Visual Settings - This gives you controls to customize the visual display of this website to your liking: turn up or down the brightness, contrast, color temperature, hue, saturation, dark mode, and earthquake. Settings are saved per browser tab, so they will be remembered for your whole visit.
Open My Eyes - Have you ever been engrossed in your work, when you suddenly realize someone is staring at your screen, watching everything you do over your shoulder? If not, this simulates the experience.
Open Help - This help popup, silly! You just clicked it! Do you not remember?
New - Draggable elements! Several elements on this website, including these tabs, this popup message, and the "Hire Mike" badge in the lower right, can be dragged around with your mouse, to avoid them blocking content. Positions are remembered per tab, so as you navigate around the site, they will stay in the same place for your whole visit.
Enjoy!
CLI Website Navigation
Are you sure you want to switch to viewing this website in the "expert mode" command-line interface?
This will switch to a terminal emulator, load this page, and allow you to browse this website and view its contents by typing text commands.
Plus there might be, y'know, some fun stuff hidden in there. Just for geeks.