PHP-FPM tuning: Using ‘pm static’ for Max Performance

PHP-FPM tuning: Using ‘pm static’ for Max Performance” looks at different process management settings in PHP-FPM: static, dynamic, and ondemand, and the way they affect performance.  The default – ondemand – might work well for you if you have a large server with plenty of resources and not so many actual visitors.  Running on a smaller instance, or expecting high spikes of traffic might require you to look into your PHP-FPM configuration and adjust it.  The article is just what the doctor ordered.

Personally, I prefer having a dedicated instance for the web server, but that instance being as small as possible.  With that, figuring out the correct settings for static process management is easier.  It also minimizes all those nasty cases of running out of memory, swapping, and having an excessive CPU utilization.   Which is especially useful when running on Amazon AWS instances.

Linux Journal Ceases Publication

These are some sad, sad news, folks – Linux Journal is closing down:

EOF

It looks like we’re at the end, folks. If all goes according to a plan we’d rather not have, the November issue of Linux Journal was our last.

The simple fact is that we’ve run out of money, and options along with it. We never had a wealthy corporate parent or deep pockets of our own, and that made us an anomaly among publishers, from start to finish. While we got to be good at flying close to the ground for a long time, we lost what little elevation we had in November, when the scale finally tipped irrevocably to the negative.

I’ve been a subscriber of the Linux Journal for many years (just not the most recent ones), and I’ve learned a lot from it.  It’s very sad to see it go, even though it’s been years since I read it last.

Change SQL mode for MariaDB in Fedora 27

After I upgraded my laptop to Fedora 27, I started experiencing some weird issues with most of the projects I am developing locally.  Trying to save anything into the database that involves dates, started throwing the following errors:

Error: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-11-30T13:30:48+02:00' for column 'timestamp' at row 1

A quick look around showed that Fedora 27 ships MariaDB v10.2, while the previous distribution version shipped MariaDB v10.1. Digging through the changes between the two versions didn’t help much, even though there is slight mention of the related change.

SQL_MODE has been changed; in particular, NOT NULL fields with no default will no longer fall back to a dummy value for inserts which do not specify a value for that field.

StackOverflow is much more helpful, as always.  These two threads – one and two – in particular, explained the changes and suggested the fix.  I had to either fix the projects I was working on, or modify my local configuration to use the old SQL mode.  This thread provided some more details, so the final solution was adding the following to the /etc/my.cnf and restarting the MariaDB service:

[mysqld]
sql-mode="NO_ZERO_IN_DATE,NO_ZERO_DATE"

And now we are back to normal.

The Global Airport Database

Global Airport Database – Arash Partow

The Global Airport Database is a collection of data about all (???) airports in the world, big and small.  It covers a total of 9,300 airports worldwide.

That’s pretty interesting.  For example, how many airports do you think there are in Cyprus?  Obviously, there is the Larnaca International Airport and Paphos International Airport.  Then, there is one in Nicosia, which is not functioning since the island was divided.  And there is one in Acrotiri on the British military base.  Four, right?   Well, the Global Airport Database has a total of 7 (!!!) entries for the country of Cyprus:

LCCC:N/A:N/A:NICOSIA ACC/FIC:CYPRUS:000:000:000:U:000:000:000:U:00000:0.000:0.000
LCLK:LCA:LARNACA:LARNACA:CYPRUS:034:052:030:N:033:037:029:E:00003:34.875:33.625
LCNC:N/A:N/A:NICOSIA:CYPRUS:000:000:000:U:000:000:000:U:00000:0.000:0.000
LCPH:PFO:PAPHOS INTERNATIONAL:PAPHOS:CYPRUS:034:043:004:N:032:029:008:E:00013:34.718:32.486
LCRA:AKT:AKROTIRI:AKROTIRI:CYPRUS:034:035:025:N:032:059:016:E:00024:34.590:32.988
LCRO:N/A:N/A:EPISKOPI:CYPRUS:000:000:000:U:000:000:000:U:00000:0.000:0.000
LCRR:N/A:N/A:NICOSIA:CYPRUS:000:000:000:U:000:000:000:U:00000:0.000:0.000

Larnaca and Paphos are there. The Akrotiri one is there too. Then we have 3 records for Nicosia. And one more for Episkopi. Hmm …

Fedora 27 and high DPI support

I’ve recently updated my laptop to Fedora 27 and since then I had some issues with the rendering of the desktop fonts.  At first, everything seemed too large and over-magnified.  Resetting the desktop fonts to much smaller sizes helped a bit, but there were still random issues with different applications – Google Chrome, Skype, etc.   I think these much be related to the recent improvements to high DPI support.

A few things helped me a long the way.  Here are the links, just in case I’ll need to find them in the future:

Ultimately, the things that solved my problems were the last link (installing better fonts for Fedora), and adjusting the fonts resolution from 142 dots per inch down to 96.