• My First Autocross at Subiefest Texas

    中文版:在Subiefest Texas的首次Autocross – Frank’s Weblog

    Photo by @ethan_hart10

    This year, Subiefest, the Subaru’s official car meet, came to Texas for the first time. In addition to exhibitions and vendors, there are also car shows and Autocross.

    If you are not familiar with Autocross:

    Autocross, or “parking lot racing” as my brother likes to call it, is a low-cost, low-struggle, low-risk way to get out and drive your car fast. Typically set up in a parking lot, airport, track, or any place with a wide open piece of tarmac, the “race track” is an improvised course marked with small traffic cones. Cars run one at a time in an effort to score the best time through the course. Hitting cones results in penalty time added to your run, usually a second or two. Most runs are anywhere from 40-100 seconds long.

    Usually any car that drives and satisfies the requirements on the tech inspection list can attend. One common exception is SUVs and pickup trucks are excluded in most autocross events because of higher rollover risk.

    When I bought the tickets for the Subiefest event, the Autocross registrations were already sold out. At Friday night before the event, I noticed Subiefest instagram said there were a few extra Autocross spots available and luckily I got one of the last a few spots.

    However that means as a newbie with no real world experience, I have only one day to prepare.

    Read more: My First Autocross at Subiefest Texas
  • 在Subiefest Texas的首次Autocross

    English version: My First Autocross at Subiefest Texas – Frank’s Weblog

    Photo by @ethan_hart10

    今年斯巴鲁官方车聚Subiefest第一次来到了德州。除了展览和Vendor之外,还有Car show和Autocross。



    总之可以理解为“停车场赛车”。参与Autocross的门槛很低,通常任何能开且满足Tech inspection要求的车辆都可以参与。一个常见的例外是大部分的Autocross活动都禁止SUV和皮卡参与,因为较高的重心会带来更高的翻车风险。



    Read more: 在Subiefest Texas的首次Autocross
  • 博客10周年纪念






    Read more: 博客10周年纪念
  • A PoC for Geographically Distributed WordPress Deployment


    This site is hosted in a single AWS Lightsail instance in Japan West region, it has perfect performance when visiting from near by regions, however it has poor performance if visiting from another continent.

    • Poor TTFB and LCP from US East and Europe
    • Core Web Vital fails because of slow LCP, which impacts SEO performance.

    I’ve been using WordPress to run this site for almost 10 years. WordPress have been a very successful software in blogging, CMS and even e-commerce. Comparing with static solutions, it takes more effort to optimize its performance, because of its “dynamic” nature.

    I’ve done a lot of performance tuning for this site, and it already archived ~150 ms TTFB from nearby cities, it’s not possible to optimize any further from the server side. It’s also very difficult to optimize the time that data travels between visitors and the server, since the speed of the packet is limited by the speed of light, and we don’t have the control to the routing of the packets.


    One solution that came up to my mind is to add more origin servers and make them distributed all over the world. The visitors will hit the nearest server to eliminate the latency, it also makes the site HA by rerouting the visitors to the working site in case one of the servers is down. While there are some managed WordPress hostings that provide this feature, but these services are very expensive.

    I decided to conduct a proof of concept for this idea. The goals are:

    • <500 ms TTFB globally
    • Highly available
    • Scalable
    • Budget friendly

    This article will cover the design and implementation of a geographically distributed WordPress architecture, and review the design based on its performance, cost, maintainability and scalability.

    Read more: A PoC for Geographically Distributed WordPress Deployment
  • UHaul Trailer Lighting Issue During Cross Country Move


    中文版:跨州搬家途中的UHaul拖车尾灯短路问题 – Frank’s Weblog

    We recently embarked on a cross-country move from Syracuse to Dallas, towing a U-Haul 5×8 trailer behind our Subaru Outback. The trip was split into four days, with stops in Mansfield OH, Nashville TN, and Little Rock AR.

    Before leaving Syracuse, I checked every item on the checklist, including hitch pin, ball mount, coupler, safety chain, wiring, tires, lock, etc. However, I skipped checking the lights because they were already tested when picking up the trailer, so I assumed that they should be working properly as long as the connection was good.

    The first stop was Mansfield OH, about 7 hours drive from Syracuse. We stopped for dinner and gas at a small town near Cleveland OH. It was almost dark and I was a bit upset since I skipped the light check before departure. So I checked the trailer tail lights and found out that the lights were not on.

    Read more: UHaul Trailer Lighting Issue During Cross Country Move
  • 跨州搬家途中的UHaul拖车尾灯短路问题


    English version: UHaul Trailer Lighting Issue During Cross Country Move – Frank’s Weblog

    5月底,我们从雪城搬到了达拉斯。我们选择了开我们的Subaru Outback,后面拖UHaul的5×8拖车。整个行程分为4天,途径Mansfield OH,Nashville TN和Little Rock AR。

    从雪城出发前,我按照事先列好的检查单检查了每一个项目,包括拖车的pin, ball mount, coupler, safety chain,wiring,轮胎,锁等等。然而我唯独跳过了对灯光的检查,因为在取车时已经测试过车灯,所以我偷了个懒,认为只要插头插好,车灯应该是正常工作的。

    第一天的终点是Mansfield OH,离雪城大约7小时车程。在路过Cleveland OH附近的一个小镇时我们停下来买晚饭和加油。当时天已经快黑了,因为中午出发时跳过了灯光的检查,总是有些不放心。于是我去检查了拖车尾灯,结果发现灯不亮了。

    Read more: 跨州搬家途中的UHaul拖车尾灯短路问题
  • Use Cloudflare Load Balancer with Cloudflare Tunnel

    中文版:配合Cloudflare Tunnel使用Cloudflare Load Balancer – Frank’s Weblog

    Cloudflare Load Balancer is a global load balancing product provided by Cloudflare. It can connect to origin servers in traditional ways by DNS name or IP addresses, it also can be integrated with Cloudflare Tunnel to create a seamless and secure network infrastructure.

    Using Cloudflare Tunnel with Cloudflare Load Balancer is more complicated as we need to configure the DNS name and host header to make sure the routing and monitoring work correctly.

    In this post, we will use an example to demonstrate how to use Cloudflare Load Balancer with Cloudflare Tunnel.

    Read more: Use Cloudflare Load Balancer with Cloudflare Tunnel
  • 配合Cloudflare Tunnel使用Cloudflare Load Balancer

    English version: Use Cloudflare Load Balancer with Cloudflare Tunnel – Frank’s Weblog

    Cloudflare Load Balancer是Cloudflare提供的一个全球负载均衡产品。它可以以传统方式(域名或IP地址)连接源服务器,还可以与Cloudflare Tunnel集成,以创建一个无缝和安全的网络基础设施。

    将Cloudflare Tunnel与Cloudflare Load Balancer一起使用的配置与传统方式相比略微复杂,我们需要正确地配置域名和Host头,以确保路由和监控的正常工作。

    在这篇文章中,我们将用一个例子来演示如何配置将Cloudflare Load Balancer与Cloudflare Tunnel一起使用。

    Read more: 配合Cloudflare Tunnel使用Cloudflare Load Balancer
  • 2023/1/21 Blog Incident Postmortem

    中文版:2023/1/21博客受攻击宕机事件分析与复盘 – Frank’s Weblog

    On 1/21/2023, my blog was attacked and went down for 4 hours. This article will cover what the incident was like, the root cause analysis and improvements.

    On that day, I woke up in the noon and saw the alert email from UptimeRobot. Sometimes a network or server glitch can trigger an alert as well, but it have been 2 hours since alert triggered, so apparently that’s not the case. I found I was not able to connect to the website, while sometimes I could connect but got 504.

    I ssh-ed to the server and restarted all the Docker containers, but the problem persists. top showed that all the load average were 6.xx and most of the CPU usage were from php-fpm. I checked the graphs in nginx amplify and found that nginx have received large amount of requests during past few hours.

    I planned to go grocery shopping for the lunar new year dinner with my girlfriend, so I didn’t want to spend too much time on this. I simply turned on the Cloudflare reverse proxy(orange cloud icon) and “Under attack” mode and left home.

    After a while I received the alert clear email from UptimeRobot and website was back online.

    Over last few years I’ve implemented a set of monitoring and security measures for my site and automated scripts to mitigate common issues.

    1. UptimeRobot for monitoring downtime. I’ll receive alerts if the website cannot be reached or returned HTTP status that indicates a malfunctioning(5xx).
    2. nginx amplify for monitoring nginx and OS metrics. I’ll receive alerts if some metrics(eg. disk usage, requests per second) goes over the threshold.
    3. If requests per second goes over the threshold, it will automatically turn on Cloudflare proxy and increase security level.
    4. WordPress security plugin automatically blocks malicious requests.

    Benefit from these measures, my site have maintained a uptime of nearly 100%. Being a blog that only have 2 digits of visitors everyday, 4 hour downtime is nothing to worry about. But my professtional habit have been wondering what happened behind the incident, especially why these measures failed to prevent the incident from happening.

    Read more: 2023/1/21 Blog Incident Postmortem
  • 2023/1/21博客受攻击宕机事件分析与复盘

    English version: 2023/1/21 Blog Incident Postmortem – Frank’s Weblog



    我ssh上去之后重启了一下所有Docker容器,但是故障依旧。top显示全部load average高达6.xx并且大部分的CPU使用来自php-fpm。检查nginx amplify图表之后发现过去几小时内nginx收到了大量的请求。

    因为当天下午我计划和女朋友去采购年夜饭的食材,不想在这上面花费太多时间,于是我打开了Cloudflare的反向代理(橙色云图标)和Under attack模式,然后就出门了。



    1. UptimeRobot用于监控可访问性,如果出现无法连接或异常的HTTP状态(5xx)则会发邮件报警
    2. nginx amplify用于监控nginx和操作系统的指标,其中一些指标(例如磁盘使用,每秒请求数量)超过阈值之后会发邮件报警。
    3. 如果每秒请求量超过阈值则会自动开启Cloudflare反向代理并升高安全等级。
    4. WordPress的安全插件会自动block恶意请求。


    Read more: 2023/1/21博客受攻击宕机事件分析与复盘