Arbitrary tweets made by TheGingerDog up to 04 October 2020
Arbitrary tweets made by TheGingerDog up to 01 September 2019
Reduce connection counts to MySQL by using an array to get many values at once (assuming they’re single ‘word’ values)
Sometimes (Woocommerce?) related queries on a MySQL server can seemingly run forever and eventually lead to the server being clogged up (and few free connections). Something like this can help …. (i.e. kill all MySQL queries which have been running longer than 900 seconds, and aren’t from the ‘root’ user).
Arbitrary tweets made by TheGingerDog up to 23 October 2016
WordPress seems to like hiding a load of ‘transient’ (cacheable) stuff in it’s wp_options table. Unfortunately for one site, it seems it didn’t bother to clean up the transient stuff, leaving behind about 750,000 records… which made a WP version upgrade painful, as MySQL locks the wp_option table which causes all other page loads to… Continue reading Cleaning up a lot of WordPress _transients
I found MySQL was being annoying earlier and not ‘accepting’ my max_connections = 450 directive on a Debian Wheezy install, and being seemingly stuck on having 214 connections….
Do you have a slow MySQL update/insert/delete query? Obviously, for ‘SELECT’ queries you can prepend the query with “EXPLAIN ” – however that doesn’t work for the other query types (UPDATE/INSERT/DELETE). So, one solution which may explain why the query is slow is to turn on MySQL’s profiling functionality, like in the following example :
Everyone else probably already knows this, but $project is/was doing two queries on the MySQL database every time the end user typed in something to search on to get the data between a set range (SELECT x,y….. LIMIT n, OFFSET m or whatever) and another to get the total count of records (SELECT count(field) ….).… Continue reading Late to the performance party