I guess I'd look at each part of the system independently to be sure I'm finding the real bottleneck. (It may be Python, it may not).
Under your current system, is your python program still trying to send messages after 5 seconds? 30 seconds, 300 seconds? (Or have the messages been delivered to SMS and they're waiting in queue there?) If your python program is still streaming out the messages, what is it spending time on? At a gross level, is your machine CPU-bound? If you time out each step in your program after the content is generated, where is all the time going (message assembly, sending over the network, waiting for a response)? Just by some back-of-the-envelope calculations, 1 million messages at 100 bytes each is 100Mb. That's a bunch of data to push over a network in 2-3 seconds, especially in small chunks. (It's possible, but I'd look at that.) Can the SMS gateway handle that kind of traffic (incoming and outgoing)? Multi-threading may help if your python program is spending all it's time waiting for the network (quite possible). If you're CPU-bound and not waiting on network, then multi-threading probably isn't the answer. -- http://mail.python.org/mailman/listinfo/python-list