Skip to main content

Posts

测试rclone和restic

最近忽然想试试restic,看看几年后有什么变化。 实际上之前做数据备份计划时大致比较了rclone和restic,经过简单测试以后决定用rclone。当时对restic印象一般,主要考虑两点: 1. restic是专有格式,没有程序文件的话无法访问备份的数据。 2. 之前测试restic的时候莫名其妙备份仓库数据有损坏。 不过用了rclone几年以后发现第一条对rclone的加密仓库也成立。 测试数据 我挑选了一些数据,主要是图片和视频,分别用restic和rclone备份。 数据包含121191个文件,总共3.869TiB。由于ZFS压缩,实际占用磁盘3.6TiB。 测试环境 原始数据保存在一台Ubuntu 22.04.3的机器上,文件系统使用ZFS,启用zstd压缩,没有开启去重。 备份机器是一台群晖的机器,文件系统使用ext4. 两台机器用千兆网连接。在源机器上通过sftp访问备份机器。 restic备份 restic版本 restic 0.16.3 compiled with go1.21.6 on linux/amd64 备份仓库用默认参数创建。 最终是用了42个半小时结束。restic报告是3.655 TiB added to repo, 3.531 TiB stored on disk。备份仓库里最后有220568个文件。 我对结果比较惊讶,因为按这个结果看数据里有大概200GiB的重复数据块,我没想到有这么多。 不过最后占用磁盘大小跟原始文件在ZFS上的占用大小差不多,我也没想到。按理说已经去掉了200GiB文件,并且ZFS和restic我都用的zstd默认压缩率(也许它们的默认压缩率差很多?),我本来以为restic的仓库要再小点。 效率方面感觉42个多小时也太慢了点。不过我没找到性能瓶颈,很奇怪: - 两台机器CPU占用率都不高 - 源机器上CPU有8核,但是restic基本用不到200% - restic要调用ssh访问sftp,ssh大概也占用10%CPU - 网络数据量大概50MB/s,这感觉很低 - 磁盘也没有充分利用。ZFS那边我见过几百MB/s的速度,而群晖那边也显示磁盘使用率在一半左右。 所以最后我也没搞清楚原因。 还有一个问题,restic经常跑跑停停,有时看似完全休眠了一般,CPU,磁盘,网络完全没有动静,...

整理了一下RSS和Podcast

之前Google Reader挂了之后我基本一直用Feedly,后来也开始用Google Now看新闻,用Google Podcast听Podcast。 这几天决定切换到自己的服务器上,有若干原因: 越来越不喜欢Google Now的自动推送。感觉我的眼界越来越窄。 Feedly经常遇到收费功能。 Google Podcast要关闭了。 我正好也有服务器了 RSS抓取用的Tiny Tiny RSS,这个之前就搭建好了,作为Feedly的备份。最近升级发现docker compose文件有若干变化,数据库版本也变了,稍微折腾了一下。 类似的还有几个 Miniflux FreshRSS NewBlur 不过这些其实都大同小异。主要Tiny Tiny RSS导入导出备份都挺方便。 手机端用的Feedme,直接支持Tiny Tiny RSS的API,也可以放Podcast 我的RSS源都很老了,有好多都没法用了,Feedly也不提示我。发现了两个不错的RSS网站 https://docs.rsshub.app/ https://feedx.net/ Podcast回头也得整理一下,不过目前问题不大。

Code Study Notes: Sphere Eversion

The Video A Bit Background Thanks to Youtube's algorithms, I got to watch  this video  again after many years. The video, made in 1994, explains the sphere eversion problem and visualizes one solution: Thurston's corrugations. More information can be found in the following links: 1 , 2 , 3 . There is also an HD version . The animations in the video are really fascinating. I figured it'd be a good excercise to recreate it with Blender, especially with geometry nodes. However I immediately got stuck after 20 minutes, because I had no clue how everything works. Luckily I found a port  of the original source code. (The original source code  seems no longer available). The author also created a nice video . I'll refer this version as  mathIsART's version. I also found another port , which I'll refer to as McGuffin's version. Mostly I studied mathIsART's version, and occasionally used McGuffin's version as reference. The code was really fun to read, and I ...

Thoughts on Herb Sutter's cppfront

Recently I learned about cppfront , which is an experimental new syntax for C++ by Herb Sutter. It was nicely explained in CppCon, and I really enjoyed watching the video . Roughly I'd view it as Rust with C++ interop. It's kind of some syntax sugar, preprocessor or a dialect. It has also enforced style guide or annotations that are compiler-aware. I like it mostly, I feel excited.  And let me try to explain in a logic way. The Syntax I don't like it, nor do I hate it. I asked myself, do I not like it, just because I am not familar with it? The answer is yes. So it's my problem, not cpp2's. It didn't took me too much time to get myself comfortable (but not fluent) with Rust, so I think cpp2 won't be a problem. Comparing with Rust I got this several times while reading the docs or watching the video:  If something is bad, let's remove it from the language instead of keeping teaching "don't do this, don't do that". Examples: NULL, union, ...