Live data from Hacker News

Celery 4.0

docs.celeryproject.org

41–50 of 51 posts

Re: Celery 4.0

#41
In case you also run into the depreciation of sending error emails[1] I've had to switch back to using a decorator[2] to catch unhandled exceptions and generate error emails.

[1] CELERY_SEND_TASK_ERROR_EMAILS config removed http://docs.celeryproject.org/en/latest/whatsnew-4.0.html#fe...

[2] https://gist.github.com/alanhamlett/dc8cdd4721ea63053f14#fil...

Re: Celery 4.0

#42
post #38
post #11

Earlier quoted context omitted.

I've managed to live without it. For low and medium traffic sites it's hugely over-engineered. For all the sites I manage, I run a single cron task that triggers a range of background jobs. It's an approach worked very well for nearly 10 years. I understand there's a genuine use-case for Celery but like many technologies people are told "if you need a task queue use this" when there are much simpler solutions that ar…

When building a small web app a few weeks ago, I tried to avoid additional dependencies, too. I was a bit stuck when I need to send an email asynchronous. Do you have a _simple_ recommendation to solve this without pulling something huge like celery+redis in to solve this task?

RQ + Reddis is "easier" http://python-rq.org/

If you are on AWS, you could just use something like their email service to fire off the request, then you don't need a queue at all.

Re: Celery 4.0

#43
can you suggest a monitoring tool for celery? I want to view what tasks are currently working... is flower the only solution? thx

Re: Celery 4.0

#44
post #30

Earlier quoted context omitted.

We recently moved one of our services from Rq to Celery. We are using an older version of Celery, but this comment should still apply. While Rq is a great way to go in the start, if you have a large number of messages you are handling, you'll get into memory bottlenecks. This isn't a problem with Rq, but with using Redis as a broker. So if anyone is considering Rq vs Celery, they should keep this in mind. The reason…

That's very insightful. Quick question, since you are doing this in production - how are you serializing images into a message ? Base64 or something else.

You really should not ram images in your task queue. Send them off to S3 or Cloud Storage with a GUID, and send along the GUID however you want (JSON is fine)

Re: Celery 4.0

#45
post #14
post #13

Earlier quoted context omitted.

Celery was never meant as a replacement for cron, it was simply a nice bonus that fits the messaging pattern well. Writing a task queue is actually very simple using for example Redis, but that doesn't necessarily mean Celery is over-engineered IMHO. It's very easy to forget the support required once your system is in production. Disclaimer: I'm a contributor

I'm not saying Celery is over-engineered in general. It's just over-engineered in the context I've often seen it recommended in. i.e. for people learning or people with fairly modest requirements.

Yep, I first asked on Stack overflow the best way to achieve a background task in a Django app, and the answers all said Celery. Considering it got run around once a week, it was a very over engineered solution I ended up with.

Its useful to know Celery, and gets used in a proper context in my current work, so I guess learning it wasn't a waste.

Re: Celery 4.0

#46

"Starting from Celery 5.0 only Python 3.5+ will be supported." This is a small detail, but I'm glad that one more big Python project is dropping 2.x support. The 2/3 split is not good for the community.

Agreed!

Re: Celery 4.0

#47
post #43

can you suggest a monitoring tool for celery? I want to view what tasks are currently working... is flower the only solution? thx

Have you tried running 'celery events' on the command line? I find this sufficient in most cases.

Re: Celery 4.0

#48

Worst experience with a python toolkit ever. I hope new versions fix all bugs and issues.

Of course, all other software is bug free...

Honestly this is a complex problem area and I think the Celery developers have done an excellent job of making it pretty trivial to get up and running while providing lots of flexibility for more advanced users! Not an easy feat.

Are there bugs? Of course - but I've never come up against one that I can't work around. Is that annoying? Sometimes but that's software development.

Re: Celery 4.0

#49
post #43

can you suggest a monitoring tool for celery? I want to view what tasks are currently working... is flower the only solution? thx

Have you tried running 'celery events' on the command line? I find this sufficient in most cases.

should I enable something to activate celery events?

Re: Celery 4.0

#50
post #38
post #11

Earlier quoted context omitted.

I've managed to live without it. For low and medium traffic sites it's hugely over-engineered. For all the sites I manage, I run a single cron task that triggers a range of background jobs. It's an approach worked very well for nearly 10 years. I understand there's a genuine use-case for Celery but like many technologies people are told "if you need a task queue use this" when there are much simpler solutions that ar…

When building a small web app a few weeks ago, I tried to avoid additional dependencies, too. I was a bit stuck when I need to send an email asynchronous. Do you have a _simple_ recommendation to solve this without pulling something huge like celery+redis in to solve this task?

Depends on what you need. The bare minimum is to just spawn process so the request can return and your email can send. You tend to lack much control of failure conditions that way so you'd want to have some code in in the normal request/response cycle that checks for success or failure and informs the user.

You could add your emails to a db table and have a cron job consume them.

But for sending an occasional email? I've never really had a problem with just connecting to the SMTP server in the request/response cycle. If it takes more than a second to send then something is seriously wrong. You could use Mailgun or similar services which have their own queue for handling bulk sends and further reduce the likelihood of a problematic blocking of the web-server.

Post reply on HN