Scala, Java, Unix, MacOS tutorials (page 194)

Earlier today I ran into a problem making a Drupal 8 database backup. I ran the usual mysqldump backup command, and when it kept running for a long time I decided to kill it, and then began investigating the problem. I knew that I had recently deleted all of the log records, and the Drupal cron task was running correctly, so something else was going on. In short, I found that my Drupal 8 database was huge.

I found this out by moving to the Drupal 8 MySQL database data directory, which on an Ubuntu Linux system is something like this:

/var/lib/mysql/drupal8

The last part of that path is the name of your database, so in this example my database is named drupal8. When I listed the files in this directory in order sorted by filesize, I noticed that a few of the files had grown huge. Here’s an abbreviated version of that directory listing:

108M  search_index.ibd
120M  cache_entity.ibd
268M  cache_data.ibd
1.6G  cache_dynamic_page_cache.ibd
3.4G  cache_render.ibd

As you can see, the Drupal 8 cache-related database tables had grown huge, with cache_dynamic_page_cache.ibd and cache_render.ibd being the two largest files by a large margin.

The short story is that I ran the drush cr command to clear all of the caches, then ran the du -sh command in the same directory, and it showed that the total size of the files had been reduced to about 500 MB. That still seems a little large, as a database backup with mysqldump is about 95 MB, but it’s much better than the 5.8 GB it was before I ran the drush command. (I haven’t looked into the reasons for this difference yet.)

How to look at MySQL database table size

I later learned that another way you can look at your MySQL database table size is with this MySQL command:

show table status;

If you’re using the mysql command line client you’ll need to select your database first:

use drupal8;

After that, the show table status command will show how large each table is in the data_length column output.

Summary

In summary, if your Drupal 8 database is huge, I hope this information is helpful. As I have learned, the things to do are (a) make sure your report logs aren’t huge, (b) make sure your cron task is running properly, and (c) check the size of the Drupal 8 cache-related tables. Actually, you might want to check those things in the reverse order, but those are the usual things that make Drupal database tables large.

Until today I didn’t know there was a difference between the terms wackadoodle and wackjob, but according to this Urban Dictionary page (and the image shown), wackadoodle implies a kinder person, whereas a wackjob can be mean or nasty. (I also wasn’t sure how to spell the two words, so there you go.)

The meaning of wackadoodle vs wackjob

This oreilly.com article about balancing quality and product features (from the perspective of a CTO/CIO) is a good read. The editor’s note states, “This is part of a series exploring the trials and tribulations of first-time managers. Camille Fournier, former CTO at Rent the Runway, is often asked for advice on how to make the transition from an individual contributor to a manager.”

Balancing development desire with product goals

A conversation between two sisters from the movie Home for the Holidays:

Claudia: You don’t know the first thing about me.

Joanne: Likewise, I’m sure. If I just met you on the street... if you gave me your phone number... I’d throw it away.

Claudia: Well, we don’t have to like each other, Jo. We’re family.

Twitter UI redesign: After using Twitter for the last several months, it seems like their user interface is out of sync with how I want to use their data. As I was waiting for dinner to cook last night I spent a few minutes thinking about the Twitter user interface (UI) and how I might redesign it. Here are my thoughts.

The current Twitter web interface

The things the Twitter web interface does well currently are:

From this Twitter page:

Interviewer: Who are these people with you?

Me: My squad.

My mom and dad: *whispering* tell him about our goals.

I share this because I was just thinking about interviewing several job candidates who brought friends, family members, or spouses with them to job interviews.

“Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?’ Improve the code and then document it to make it even clearer.”

~ Steve McConnell, author of several famous programming books, including Code Complete

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.”

~ Bill Gates

One lesson learned from Apple recently is that if your products stagnate people will start to look around, and when they do that they may spend their money elsewhere.

As just one small example of this, iOS got boring for me, so I started looking around and bought an Android tablet instead of a new iPad. These days the Mac and macOS feel stagnant — or worse than that, moving in the wrong direction by removing features like Spaces — so I’m looking at desktop alternatives as well.

2018 Update: As a result of macOS moving in the wrong direction (IMHO), I now have have a laptop and desktop that run Linux Mint.

As the Grid by Example website states, it provides “a collection of usage examples for the CSS Grid Layout specification.” Importantly, the Browsers tab on the website discusses current support for the spec in different browsers.

This is a good quote from Bjarne Stroustrup: “More good code has been written in languages denounced as bad than in languages proclaimed wonderful — much more.”

The image comes from this tweet, and the quote comes from an old book called The Design and Evolution of C++.

More good code written in 'bad' languages

The unexpected math behind Van Gogh’s “Starry Night,” from TED-Ed.

Jimmy Fallon (young Neil Young) and Neil Young sing “Old Man,” one of my favorite songs.

In May I stayed in a hospital for two nights, and as the bills are rolling in, it appears that the stay cost at least $70,000.

Fact of the day: During the Manhattan Project, the EMIS facility at Oak Ridge in Tennessee used more power than Canada.

From the book, On Writing Well.

This is the 36-month running Alaska statewide average temp, from this Twitter link, with the red and blue lines added my me.

36-month running Alaska statewide average temp

If you’re interested in meditation, the founders of Buddhist Geeks have a free course on their new meditate.io website named The Five Styles of Meditation.

The Five Styles of Meditation

There’s a large fire — currently 100 330 600 acres — in the area around Nederland, Colorado, which is just west of Boulder.

This image comes from this twitter page, and up to the minute news is on twitter under the #nedfire hashtag.

Fire in Nederland, Colorado - July 9, 2016

There I was, minding my own business, when suddenly I felt the usual symptoms come on. My face gets very warm, feeling flushed, like all of my blood is going there for some reason, and I have about a minute to lay down or pass out. I’ve never posted this here before, so, for the record, this is what my blood pressure and heart rate were more than twenty minutes after that event. (I didn’t think to check this during the event, as I was just kinda hanging on.) When I’m at home my BP is normally about 115/75 and my heart rate is usually in the 60s.

Blood pressure and heart rate