nknganda / django-mailer

Automatically exported from code.google.com/p/django-mailer
MIT License
0 stars 0 forks source link

evaluate django-cron or other in-process solutions for sending mail #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
how does running manage.py send_mail every minute affect resource usage?
is django-cron a better solution since presumably it uses a timer in the
django server process to trigger jobs? Does django-cron block the server
while it's running?

Original issue reported on code.google.com by ericd...@gmail.com on 22 Sep 2008 at 9:28

GoogleCodeExporter commented 8 years ago
Oh goodness. django-cron would be the worst thing for django-mailer. 
django-cron is not very reliable. It is 
triggered based on the request. When a request comes in it checks if something 
needs to run. Which makes it 
horribly unreliable. On top of that it does it processing in the webserver. 
This makes it horrible bound to the 
webserver and will hurt performance of your web application. I would only see 
django-cron beneifical in very 
strictly hosted platforms.

django-mailer has been written in such way that uses a little system resources 
in a true cron situation. When 
cron fires off a process a file lock is made to prevent other processes from 
hogging resources. You will only 
ever have to worry about two processes running at a single moment in time. One 
doing something another 
check to see if it can do something and then dies off. While this isn't 
necessary the best way in situation with 
*tons* of e-mails it certainly allows for a distributed system. We are working 
on django-engine which will 
make django-mailer engine bits much more flexible allowing for persistent 
processes and queues for more 
performant processing.

Original comment by bros...@gmail.com on 22 Sep 2008 at 9:39

GoogleCodeExporter commented 8 years ago
thanks for the informative reply! django-engine sounds interesting.

Original comment by ericd...@gmail.com on 22 Sep 2008 at 10:54

GoogleCodeExporter commented 8 years ago
About django-mailer and it's lock file, is this lock file working in case we 
have
more than one django box ? (the normal way django should grown when more 
resources
are needed).

Maybe we can use it's own database, writing the "lock" flag in the database 
itself or
just using, if is possible, the lock behaivour of the database tables.

Original comment by rober...@gmail.com on 23 Sep 2008 at 1:05