Live data from Hacker News

Diagnosing Memory “Leaks” in Python

chase-seibert.github.io

31–32 of 32 posts

Re: Diagnosing Memory “Leaks” in Python

#31
post #18

Earlier quoted context omitted.

We solved the Celery + long running + code reloading problem by having each push of new code be associated with a new Celery queue. On push of new code, start the new queue, and SIGTERM the old one, which will wait for any long-running tasks to finish before exiting.

Hm that's an interesting idea, thanks for sharing this! How exactly do you perform the restart of the Celery service and where are your queues configured? I guess you don't specify them in /etc/defaults/celeryd?

Correct, we didn't use /etc/defaults/celeryd, or use a standard init/systemd/upstart/etc-based way of starting celeryd. Instead we used daemontools to add and remove celeryd processes with their own configuration. It took a bit of work, but ultimately let us do code updates with zero downtime.

Re: Diagnosing Memory “Leaks” in Python

#32
post #29
post #22

Earlier quoted context omitted.

Except that didn't happen, according to the post.

The post says: "Indeed, the processes grew from their initial size of 100MB, slowly, all the way up to 1GB before we killed them." The important part is that they manually killed the processes before they let it start swapping.

Again, they didn't actually have anything bad happen. Bad: processes couldn't get memory. Not bad: I was using 3 GB of memory.
Post reply on HN