ram-altman README

项目的 README,来自 github.com/IainKay/ram-altman。合并为一个 markdown 文件:README.md。

Ram-Altman

A bash script that writes to Sam Altman once a day to report the RAM he missed.

Read the sample emails at ram-altman.lol, no install needed.

Website: ram-altman.lol Global DRAM allocation: quite terrible Utilization: maybe 5% Emails: 1 per day Written in Bash, not Electron

There is RAM in your computer. Right now. Just sitting there, in a personal computer, being personal.

You may have thought of this as "a computer working normally". On a recent episode of Cheeky Pint, the CEO of OpenAI offered another view:

"From a global allocation perspective, actually, it's quite terrible to have everybody have a bunch of the world's limited supply of DRAM sitting in their own computer"

— Sam Altman

That RAM, he added, is "being used maybe 5% of the time".

Which raised an obvious question for a certain kind of person: surely someone should be monitoring this?

So we wrote a script. If your machine has more than 10% of its RAM available, it sends one email a day to let Sam know. It seemed only fair. He can't fix the problem if nobody tells him where the RAM is.

Features

A sample of today's correspondence

Subject: You missed a spot

Hi Sam,

Please don't be alarmed, but there is 8.6 GiB of RAM on my desk that isn't in
a data centre. That's 56.2% of what's installed here, and as far as I can tell
it has no plans today.

Hoarding responsibly,
A concerned RAM owner

--
Sent automatically, at most once a day, by a small script on one PC.
Reply if you'd like it to stop.

The figures are real. They come from your machine. That's the worrying part.

What counts as "used"?

used = MemTotal - MemAvailable

MemAvailable is the kernel's own estimate of how much memory programs could claim without swapping. Free RAM counts as available. So does cache the kernel can reclaim. tmpfs and shared memory don't, because they can't simply be handed back.

Every sysadmin has spent years explaining that Linux didn't eat your RAM and that free RAM is wasted RAM. It took decades for someone important to agree with the second part, and he'd like it shipped to him.

Strictly speaking, the page cache is doing useful work, so counting it as available is a generous concession to the other side. Think of it as a plea bargain.

On kernels older than 3.14, which have no MemAvailable, the script estimates it from free memory plus reclaimable cache. If you're on one of those, your RAM may be safe. Nobody's coming for that.

Installation

You'll need Linux, bash, and a working sendmail, msmtp or mail command. Your RAM is assumed.

git clone https://github.com/IainKay/ram-altman.git
cd ram-altman
chmod +x ram-altman.sh test-ram-altman.sh

./ram-altman.sh --status    # see the evidence against you
./ram-altman.sh --dry-run   # preview an email without sending it

Example output, from a simulated machine that has confessed to everything:

Total:      15.3 GiB
Used:       6.7 GiB
Available:  8.6 GiB (56.2%)
  Free:     0.3 GiB
  Cache:    8.2 GiB

To run it for real, add this to your crontab with crontab -e:

[email protected]
[email protected]
RAM_ALTMAN_FROM_NAME=Your Name

*/5 * * * * /path/to/ram-altman.sh

It samples every five minutes and emails at most once a day. If a send fails, it tries again on the next run, because this message matters.

Setting What it does Default
RAM_ALTMAN_TO Who receives the bad news Required
RAM_ALTMAN_FROM A real address you can send from Required
RAM_ALTMAN_FROM_NAME Your name, or your nom de RAM Optional
RAM_ALTMAN_THRESHOLD Email when available RAM is above this percentage (whole number) 10
RAM_ALTMAN_STATE_DIR Where the log and state files live ~/.local/state/ram-altman

Audit yourself

Let it run for a while, then find out how your machine compares:

awk -F, 'NR>1 { used += $3; total += $2 }
  END { if (total) printf "Your RAM in use: %.1f%% (the claim: maybe 5%%)\n", used * 100 / total }' \
  ~/.local/state/ram-altman/usage.csv

Yes, share of memory in use isn't the same thing as share of time spent in use. If you came here to say that, welcome to Hacker News. We're glad you're here.

Please be a good neighbour

One email a day from one person is a joke. Ten thousand of them is a denial-of-service attack with better material.

You can also point it at someone who will enjoy it, like the friend who has been waiting for DDR5 prices to come down.

FAQ

Does this help with the DRAM shortage? No.

Is this a serious tool? The memory accounting is. The correspondence isn't.

Does it work on macOS? No, it reads /proc/meminfo. On the other hand, your RAM is probably soldered down, which makes you the hardest target in the global allocation programme.

Why is the threshold 10%? Below that, your machine has suffered enough.

Does running this use RAM? Briefly. It's then returned to the global pool, which is more than can be said for the rest of us.

Can I run the tests without emailing anyone? Yes. ./test-ram-altman.sh uses simulated memory and a fake sendmail. No inboxes are harmed.

Can I see it without installing anything? Yes. ram-altman.lol cycles through the real emails, with sample figures.

What should I do with all this RAM? Open another browser tab. You've still got time.

In fairness to Sam

Altman has since said the remarks were taken out of context, writing:

"i actually do want the world to have tons of memory and people to put as much as they want in their computers"

He followed up with "i want you to have so much ram" and "lets build more", and briefly changed his display name on X to Ram Altman, which is objectively excellent and is where this project gets its name.

The original remarks came up in a discussion of running AI models locally, and the utilization argument is a real one: servers really are busier than your desktop. We just think it's funnier to reply with cron.

Besides, if he wants you to have so much RAM, then this script isn't a complaint at all. It's a daily progress report.

License

Free as in unallocated.

ram-altman (IainKay/ram-altman)

正在搜索数据库…

这是什么?一个 bash 脚本,它检查你的机器还有多少空闲内存,并每天给 Sam Altman 发一封邮件,汇报未使用的内存容量。
这是应用、库,还是只是一个 cron 任务?这是一个单独的 bash 脚本,每五分钟采样一次内存,每天最多只发送一封邮件。
我要怎么让它真正运行起来?设置 RAMALTMANTO 和 RAMALTMANFROM,然后用 crontab -e 把脚本添加到你的 crontab 中。加上 --dry-run 运行时,会显示所有输出,但不会发送任何邮件。
它需要我的机器上有什么?Linux、bash,以及一个可用的 sendmail、msmtp 或 mail 命令。
如果我设置错了,它会不会变成垃圾邮件?它设计为每天只向你自己的地址发送一封邮件。README 要求你不要添加他人的地址,不要伪造发件人,也不要在服务器集群上运行它。
它能在 macOS 上运行吗?不能。它读取 /proc/meminfo,因此只能在 Linux 上运行;内核版本低于 3.14 的系统会获得估算的 MemAvailable。
除了内存数字,它还会发送别的东西吗?不会。邮件中只包含从你的机器上读取的内存数据。
什么算作已用或可用内存?它使用内核的 MemAvailable 数值,该数值包括空闲内存和可回收的缓存,但不包括 tmpfs 或共享内存。
它到底什么时候会发邮件?只有当可用内存高于 RAMALTMANTHRESHOLD 设定的百分比(默认为 10)时才会发送,且每天最多一次。
如果发送失败会怎样?它会在下次运行时重试,因为这封邮件很重要。
它为什么会被做出来?它是一个玩笑之作:Sam Altman 曾称个人电脑中闲置的全球 DRAM 从全球分配的角度来看“相当糟糕”,于是有了它。
作者
IainKay
大小
<0.1 MB
星标
2.3K
更新
提交Nov 06
时长
13天
提交 · 90 天