Ho

How I built a cron job service to advance myself in Go and worker pools

Hacker News

How I built a cron job service to advance myself in Go and worker pools

Hi, Guys, For a long time i've been thinking to advance myself in Go but there's been no proper idea to showcase that. I thought - maybe one could leverage from the fact that Go should be very performant in terms of API-based solutions and tools. And especially i wanted to make sure that Go's goroutines can do nicely some fan-out things, for example, getting request, logging, publishing event, without notable performance degradation. I had quite some experience in AWS, with serverless architecture in particular. And there are basically no other option for scheduling except for EventBridge, which has a handsome free tier though. But what if you are not within the AWS infra, because the infra itself could be costly, especially after they removed the "12-months trial" thingy. So, i thought something like cron-as-a-service could be good starting point. Decided to take a straightforward stack: Go API server, Postgres, Redis as both job queue and cache, all running on a single €5/month Hetzner VPS behind Caddy. I read that it's possible to use Redis as a queue. Thus, wanted to try this out as well — job queue via LPUSH/BRPOP and API key cache with a 5-minute TTL, which cuts out a number of Postgres calls on every authenticated request. To validate the performance story, I ran a benchmark from within Europe — 10,000 requests, 100 concurrent, against the live API: Requests/sec: 621 Avg latency: 158ms (network-dominated — server is on Hetzner Germany) p99: 442ms Fastest: 84ms Most of that latency is the round trip across Europe. The actual server processing time - Go handler + local Postgres query - takes much less. But still - this is for a very basic Hetzner VPS instance. Would love to get any feedback — especially on the scheduler design and whether the worker pool approach could handle real load.

Share card

Actual performance

3points
1comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
83%83% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: single · Missing: mac, agents, macos
60%60% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, 000, io · Missing: https docs, excited, just released
58%58% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: month · Missing: mobile apps, ios, personal
39%39% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: calls · Missing: plus, platform, intuitive
27%27% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
18%18% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Advance Job Portal Script
Advance Job Portal Script38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Advance software to create job websites

Indie Hackerscommitment-side-project
I
I Built UUIDs-as-a-Service59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I Built UUIDs-as-a-Service

Hacker News3
Fu
Fulgent AI – Most Advance AI Headshot Generator22%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fulgent AI – Most Advance AI Headshot Generator

Hacker News4
Fu
Fulgent AI – Most Advance AI Headshot Generator22%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fulgent AI – Most Advance AI Headshot Generator

Hacker News1
fullStats
fullStats63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Gumroad advance analytics

Indie Hackers1$20/moanalytics
GesturePresent
GesturePresent48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Advance slides with gestures

Product Hunt+80Windows
Ma
MagiXJS – Create the most advance webapp with only one language57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

MagiXJS – Create the most advance webapp with only one language

Hacker News29
Bu
Built External API Middleware as a Service45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Built External API Middleware as a Service

Hacker News3
Po
Posthook – Job Scheduling as a Service61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Posthook – Job Scheduling as a Service

Hacker News162
Bo
Boom.fyi – a link shortening service built for IPFS68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Boom.fyi – a link shortening service built for IPFS

Hacker News40