It's a blog.
I’ve mentioned before about how the sync_binlog setting in MySQL can be especially slow on ext3. Of course, I wasn’t the first to discover this; the MySQL Performance Blog mentioned it months ago. I was reading through some of the slides I mentioned in my last post, and remembered that I’d left sync_binlog off on [...]
I think part of the thing I love about MySQL is the same thing I love about Firefox and Thunderbird. Even though I sometimes wonder if there are databases that would work better than MySQL or have fewer bugs, MySQL has an incredibly rich community that’s home to myriad fascinating projects. I’ve looked into MySQL [...]
Here’s a good one to have in your bag of tricks: all the time I wind up with a directory where I just want to delete anything older than a certain number of days. Here’s a pretty simple one: DELETE_PATH=’/var/backup/full_dumps/’ DAYS_TO_KEEP=’7′ for i in `find $DELETE_PATH -ctime +$DAYS_TO_KEEP`; do ls -lh “$i” #rm -vf “$i” [...]
This falls into the category of things that are simple yet I’m always trying to remember. Sometimes in bash I find myself wanting a for loop, not of the usual foreach type (for i in `ls /etc/`; do …), but a more classical one (a la C-style for var=0; var<100; var++ … syntax). Here’s the [...]
I Googled that a while ago. How do you remove duplicate rows from a SQL database? (MySQL specifically.) If you have a ‘simple’ duplicate setup, it’s pretty easy, and lots of other sites go into great detail. (And in that case, you might look into how to require that fields be unique so you don’t [...]
Periodically I run into the situation where I’m trying to find a cron job on a particular machine, but I can’t remember which user owns it. At least on CentOS, it’s easy: cat /var/spool/cron/* will show all crons. The crontab command doesn’t seem to support doing this. The downside is that that command just mashes [...]
In: Computers|Linux Tips
29 Mar 2009Silly MySQL trick of the day. This is probably no stranger to those work with MySQL all the time, but it’s a nice trick to have up your sleeve. For reasons I still can’t wrap my head around, one of the MySQL tables we need for Cacti just up and vanished. It’s not really used [...]
I enabled APC, the Alternative PHP Cache, a while back. The basic premise is that it’s an opcode cacher, making up for the fact that PHP pages get compiled on each pageload. It also caches oft-used files, though. (Although, in theory, Linux ought to be caching oft-used files in RAM too, APC is a bit [...]
In: Computers|Cool Links|Ideas|Interesting|Linux Tips|OCD|Performance|Programming|Rants & Raves|Uncategorized
10 Jun 2008From my “Random ideas I wish I had the resources to try out…” file… The way the “pretty big” sites work is that they have a cluster of servers… A few are database servers, many are webservers, and a few are front-end caches. The theory is that the webservers do the ‘heavy lifting’ to generate [...]
In: Computers|Linux Tips
6 Jun 2008In case anyone else is struggling like I am… After you install MySQL on CentOS, it doesn’t seem to want to start… You run mysqld and it barfs up an error. It turns out that it’s because you need to run service mysqld start instead. (And if you’re looking for how to install GD2 for [...]