Readit News logoReadit News
alex5207 commented on Replacing cron jobs with a centralized task scheduler   mayhul.com/posts/schedule... · Posted by u/tlf
Felk · a month ago
I see that the author took a 'heuristical' approach for retrying tasks (having a predetermined amount of time a task is expected to take, and consider it failed if it wasn't updated in time) and uses SQS. If the solution is homemade anyway, I can only recommend leveraging your database's transactionality for this, which is a common pattern I have often seen recommend and also successfully used myself:

- At processing start, update the schedule entry to 'executing', then open a new transansaction and lock it, while skipping already locked tasks (`SELECT FOR UPDATE ... SKIP LOCKED`).

- At the end of processing, set it to 'COMPLETED' and commit. This also releases the lock.

This has the following nice characteristics:

- You can have parallel processors polling tasks directly from the database without another queueing mechanism like SQS, and have no risk of them picking the same task.

- If you find an unlocked task in 'executing', you know the processor died for sure. No heuristic needed

alex5207 · a month ago
This is exactly what we're doing. Works like a charm.
alex5207 commented on A conceptual overview of asyncio   github.com/anordin95/a-co... · Posted by u/anordin95
alex5207 · a month ago
[About the event loop]

> She's behind the scenes managing resources. Some power is explicitly granted to her, but a lot of her ability to get things done comes from the respect & cooperation of her subordinates.

What a wonderful paragraph. Playful, yet with a deep meaning. It makes the article a joy to read.

alex5207 commented on Ask HN: What are you working on? (May 2025)    · Posted by u/david927
Fr3dd1 · 3 months ago
You should make them input the numbers 4, 8, 15, 16, 23 and 42
alex5207 · 3 months ago
Those are cursed!
alex5207 commented on Replacing Kubernetes with systemd (2024)   blog.yaakov.online/replac... · Posted by u/birdculture
drivenextfunc · 4 months ago
I share the author's sentiment completely. At my day job, I manage multiple Kubernetes clusters running dozens of microservices with relative ease. However, for my hobby projects—which generate no revenue and thus have minimal budgets—I find myself in a frustrating position: desperately wanting to use Kubernetes but unable to due to its resource requirements. Kubernetes is simply too resource-intensive to run on a $10/month VPS with just 1 shared vCPU and 2GB of RAM.

This limitation creates numerous headaches. Instead of Deployments, I'm stuck with manual docker compose up/down commands over SSH. Rather than using Ingress, I have to rely on Traefik's container discovery functionality. Recently, I even wrote a small script to manage crontab idempotently because I can't use CronJobs. I'm constantly reinventing solutions to problems that Kubernetes already solves—just less efficiently.

What I really wish for is a lightweight alternative offering a Kubernetes-compatible API that runs well on inexpensive VPS instances. The gap between enterprise-grade container orchestration and affordable hobby hosting remains frustratingly wide.

alex5207 · 4 months ago
> I'm stuck with manual docker compose up/down commands over SSH

Out of curiosity, what is so bad about this for smaller projects?

alex5207 commented on What Is Entropy?   jasonfantl.com/posts/What... · Posted by u/jfantl
alex5207 · 5 months ago
Super read! Thanks for sharing
alex5207 commented on Dice and Queues   justincartwright.com/2025... · Posted by u/jcartw
alex5207 · 5 months ago
Enjoyed the read - thanks for sharing! Found a small typo here:

> For the service rate (λ), we can keep things simple and assume that our server can service 10 items per minute with zero variation.

I think it's supposed to be mu and not lambda

alex5207 commented on Lines of code that beat A/B testing (2012)   stevehanov.ca/blog/index.... · Posted by u/Kerrick
sweezyjeezy · 8 months ago
One of the assumptions of vanilla multi-armed bandits is that the underlying reward rates are fixed. It's not valid to assume that in a lot of cases, including e-commerce. The author is dismissive and hard wavy about this and having worked in in e-commerce SaaS I'd be a bit more cautious.

Imagine that you are running MAB on an website with a control/treatment variant. After a bit you end up sampling the treatment a little more, say 60/40. You now start running a sale - and the conversion rate for both sides goes up equally. But since you are now sampling more from the treatment variant, its aggregate conversion rate goes up faster than the control - you start weighting even more towards that variant.

Fluctuating reward rates are everywhere in e-commerce, and tend to destabilise MAB proportions, even on two identical variants, they can even cause it to lean towards the wrong one. There are more sophisticated MAB approaches that try to remove the identical reward-rate assumption - they have to model a lot more uncertainty, and so optimise more conservatively.

alex5207 · 8 months ago
Good point about fluctuating rates for e.g the sales period. But couldn't you then pick a metric that doesn't fluctuate?

Out of curiosity, where did you work? In the same space as you.

alex5207 commented on Ask HN: Did AI make you a worse programmer?    · Posted by u/alex5207
smt88 · 8 months ago
If remembering unimportant syntax differences between languages (e.g. "===" in TypeScript and "==" in everything else) makes you a good programmer, then yes. Or if remembering how to assign variables in stored procedures in MySQL makes you a good programmer, also yes.

But overall my ability to design, debug, and maintain code hasn't been dulled by having some of these minutiae stripped away. It actually frees up time and mental effort, so it's easier for me to spend time doing more important things.

I'm not a huge CoPilot advocate and worry a lot about the quality of code that a less-experienced dev is going to produce by leaning on it too much, but having written millions of lines of code by hand, it doesn't make me feel like I'm losing anything valuable.

alex5207 · 8 months ago
Obviously I didn't mean to imply that your merits as a programmer should be judged by your ability to recall specific syntax, like the equality operator in some language.

I'm wondering about the long term effects of not paying attention to such details. Do you miss out on picking up patterns used by a certain library, framework, language or whatever, that you could have used to write your own code better?

alex5207 commented on SQL Tips and Tricks   github.com/ben-n93/SQL-ti... · Posted by u/regexman1
alex5207 · a year ago
Never knew about QUALIFY. That's great

u/alex5207

KarmaCake day19May 31, 2024View Original