Introduction

This post covers various scenarios for accessing Docker containers, exploring whether to use the container’s IP address or name in each case. While this information might be trivial for seasoned Docker users, I often find myself forgetting these basic concepts, wasting a lot of time. Hence, I decided to write a blog post in the form of a cheat sheet. Most of the content here is generated by ChatGPT.

In general, just remember these two points:

  • Although we prefer to access containers by their names, this DNS service is provided by Docker and can only be used by containers.
  • For port mapping -p 8080:80: Use the container’s port 80 when accessing the container via container name/IP, and use the host’s port 8080 when accessing from the host.
Read more »

Introduction

This post mainly covers the mechanisms and syntax of Docker healthcheck and Docker Compose’s depends_on. This post can be viewd as a cheat sheet.

healthcheck Mechanism

When a container has a healthcheck specified, it has a health status in addition to its normal status. This status is initially starting. Whenever a health check passes, it becomes healthy (whatever state it was previously in). After a certain number of consecutive failures, it becomes unhealthy.

Read more »

问题

最近外网爆出了 Intel 13、14 代 i9 打游戏会报显存错误。这个也许只是 CPU 不稳定导致的短时运算错误,不足为惧[1]。但是,B站上有人讨论很多 14 代 i9 在待机模式下蓝屏,甚至 13700K 也出现了这种现象。如果消息准确,那么使用了半年的 14代 i9 就出现了“缩缸”现象(硬件损坏导致的永久性能损失)。理论上,CPU 的寿命至少是 10 年,而且大部分 CPU 都是不用了、而不是用坏了。我的 CPU 就是 13700K,这让我非常警惕。

对于这个问题的讨论有两点需要厘清:

  1. 软件报错,比如游戏、压测工具和渲染工具。这一点占据了极大比例的流量。目前,无论是 Intel 官方还是第三方网站、博主,给出的解决方案都是限制功耗和降频,使得软件不会报错。Intel 把锅甩给主板厂商,要求它们按照 Intel 标准来设置 BIOS。目前来看,这个所谓的 Intel 标准电压更高、频率更低,跑分更差。要注意,频率降低等于消费者吃亏。因此,Intel 和主板厂商都有责任
  2. CPU“缩缸”,这是产品缺陷。这一点只占据很小比例的流量。显然,Intel 永远不会承认这一点。也许从 23 年 6 月 Intel 质保政策开始收紧时[2],Intel 已经知道了这一事实。

我是在 23 年初配的电脑,轻度办公、写一写代码,基本没玩过 3A 大作。最近,我用 CPU-Z 和 R23 测试了性能,和网上的结果[3][4]差不多。因此,我的 13700K 应该没有“缩缸”。

话说回来,我倒不是很关心降频,我更关心 CPU 寿命。目前自动核心电压为 1.38 V,R23 跑一次就 100 度。这样的配置,迟早要“缩缸”。因此,本文主要记录我是如何给 CPU 降压的,以及在研究过程中发现的各种问题。

Read more »

Preface

Metabase is an open-source data analysis tool that is easy to operate and can connect to various data sources. Although its data analysis capabilities are not as powerful as Excel, Metabase is sufficient for daily use. Moreover, I am more capable of writing SQL than clicking Excel sheets, so Metabase is a good choice for me.

Read more »

For developers, installing MySQL isn’t difficult, but it often involves several steps. I’ve documented a Docker Compose template that can directly launch a pre-configured MySQL container for development.

Docker compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: '3'
services:
mysql:
image: mysql:5.7
container_name: mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: '123456'
ports:
- 43306:3306
volumes:
- mysql_data:/var/lib/mysql
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --character-set-client-handshake=FALSE
healthcheck:
test: out=$$(mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD); echo $$out | grep 'mysqld is alive' || { echo $$out; exit 1; }
start_period: 0s
interval: 5s
timeout: 3s
retries: 2

volumes:
mysql_data:
external: true

Configuration Explanation

Read more »
0%