OpenSearch Memory Alert Fires, Then Recovers: Is It Really Out of Memory?

I manage close to a hundred OpenSearch clusters. A while ago, the heap alert started firing, but only on a few clusters, not all of them. The alert fires when heap usage goes above 75%. On those few clusters, it would recover by itself a few minutes later, and then fire again. At first I was worried that a node was in trouble, so I checked the cluster for problems: Cluster status: Green, no unassigned shards Writes are healthy: Fluentd’s buffer was not piling up and it was not retrying constantly No OOM kills: the pod restart count did not increase, and Last State was not OOMKilled All three were fine, so I opened the heap metric. Heap usage was a sawtooth: it kept climbing, dropped, then climbed again. The alert fired right when it reached the peak, and recovered a few minutes later when it dropped. My first thought was to raise the 75% threshold. But since not every cluster fired, it did not look like a threshold problem alone. What confused me more: the other clusters had the same sawtooth, but they dropped at around 60%, while this one climbed to 80% before dropping. Was its configuration different? Was it busier and short on memory? To answer these questions, I first had to understand how the JVM reclaims memory, especially Young GC. ...

October 19, 2026 · 5 min

bash: warning: setlocale: LC_ALL: cannot change locale

Seeing the error “-bash: warning: setlocale: LC_ALL: cannot change locale” when you log in to a remote server over SSH? You run into it because when SSH connects to a remote host, it automatically sends a copy of your local LC_* variables (the locale) to the remote host. If the server doesn’t support the locale you specified, you’ll get the error “-bash: warning: setlocale: LC_ALL: cannot change locale”! ...

February 22, 2017 · 1 min

Handling Insufficient Balance for GCP Automatic Payments

Because the credit card I registered with GCP is a “VISA debit card,” the automatic monthly payment can sometimes fail when my bank balance is too low. GCP’s current approach is to send an email reminder after a failed charge and retry the charge one day later. If it still fails, GCP asks you to log in to the GCP console and pay manually once you’ve fixed the problem. I had never had trouble paying through the GCP console before, but this time the flow seems to have changed. Following their link takes you to the billing page, but you can’t actually make a payment there. Even when you find the right payment button, using Chrome Canary causes a frontend problem where the payment dialog keeps loading forever. You have to switch to the regular version of Chrome to pay successfully. I’m really curious what the latest and greatest technology behind this payment dialog is… ...

February 7, 2017 · 2 min

When GitLab Deleted Its Database by Mistake, How Do We Keep the rm Command Under Control?

We have all heard the story of someone accidentally deleting the root directory as a joke, but don’t think it is just a joke! I have personally seen countless friends’ computers suffer this kind of disaster. Today, the engineers at GitLab (a service similar to GitHub) also demonstrated the immense power of the rm -rf command… They wiped out the database on the production server… I always thought this kind of disaster would never happen to me, but now even a service like GitLab, which has tens of thousands of users, has had it happen through carelessness. That made me look into how to prevent it, so let’s talk about how to keep the rm command under control! ...

February 1, 2017 · 4 min

UptimeRobot - Website Uptime Monitoring Service

UptimeRobot is a long-established, stable, and full-featured website status monitoring service. Once you set it up, UptimeRobot periodically checks whether your site is online. This matters a great deal to site owners. Imagine you update your server and the site breaks, and you only notice three hours later. All the visitors during those three hours are lost! The free plan of UptimeRobot lets you monitor up to 50 targets, checking each one every five minutes. It supports four check types: HTTP Status, Keyword, Ping, and Port. When something goes wrong, UptimeRobot can notify you by SMS, email, Slack, WebHook, and many other channels. What matters even more to me is that UptimeRobot is well run and stable. I have been using it since 2011. ...

January 31, 2017 · 2 min

Generate Large File on Linux/macOS

Sometimes you need to generate a file of a specific size for testing network speed, disk read/write performance, or program performance. The first thing that comes to mind is probably dd, right? But when you generate files with dd, don’t you find it slow? Also, did you know that besides dd, you can also use truncate and fallocate? This post briefly explains the methods you can use to generate a large file, how to use them, and the differences between them. Note that the contents of the files generated here are meaningless. ...

January 27, 2017 · 3 min

How to Measure a Command's Execution Time in Terminal?

Have you ever wanted to measure how long the commands you run in Terminal take? Recently, because of a work requirement, I put together a file-sorting tool out of various commands. Performance requirements were strict and it had to finish within a specified time, so I looked into the handy time command, which can measure how long a command takes to run. ...

January 27, 2017 · 1 min

Linux Grep Tips - Finding Lines That Contain a String

On Linux, we sometimes need to quickly search a file for the “lines” that contain a keyword. For example, while reading a log, you might want to find the errors that happened at a certain time. Opening the file and scanning it line by line is not very efficient. That’s when you need grep! ...

January 20, 2017 · 2 min

How Can I Check That My Crontab Is Working Correctly?

Have you ever had this problem? When you first learn crontab, you are never quite sure whether your settings are correct. After each change, you wonder whether the job will actually run the way you expect. Here I share two ways to confirm that your crontab is set up correctly! ...

January 20, 2017 · 2 min

Querying a Date Field in Kibana

When you want to search for data within a certain period in Kibana, the first thing that comes to mind is the built-in Time Picker. It is really handy. But in some cases your data may have more than one date field, and you have to filter with a query instead of the Time Picker. For example, with email data: sending, opening, and clicking each send a log to my server. That gives you two times, one for when the email was sent and one for when the event happened (such as opening or clicking). In a case like this, you may need to search on a date field in the search box. ...

January 19, 2017 · 2 min