On Mon, 2007-06-25 at 19:39 -0700, ZebZiggle wrote: > Howdy! > > Emails were taking 15s to send each. Upon investigation it came down > to CachedDnsName in django.core.mail. Specifically, the > socket.getfqdn() call. Also, it *always* happened, not just on > startup. So it seems the call was timing out and the cache wasn't > effective. > > The strange part is, it works fine in a dev environment or from the > production command line, but under apache/mod-python the killer time > delay kicks in. > > Any idea what could be different here?
If that file is being reimported a lot because the Python processes are restarting it will be run each time. You could try printing the PID -- os.getpid() -- or something similar to verify that. I remember hearing second-hand about this happening to somebody else and wasn't paying enough attention at the time to realise it might be a real problem. It's worth tweaking a bit if you can work out the circumstances (for example, a setting for the fqdn so that we don't even do the lookup if the setting exists). (Every time I look at that code, I remember how much I dislike DNS_NAME as the constant. Darn backwards compatibility hack!) Regards, Malcolm -- I've got a mind like a... a... what's that thing called? http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---