[Twisted-Python] Implementing an efficient IMAP client using connection pooling

Hi Folks, I'm implementing a web based interface to an IMAP server.My idea is simple as in my web client sending a request to the python script in cgi-bin running apache .The python script in turn fetches from the IMAP and sends back JSON data to the web client. Here I want my python script to use twisted's IMAP's implementation .In general ,everytime I send a request to the IMAP server, it sends the data of the entire folder back which becomes a memory /bandwidth hog.What I'm looking for is something like the connection pool in the adbapi module.I did take deferred into consideration but what I'm looking for is a way to reduce the number of connections being open to the IMAP server and trying to reuse the same old connection instead of opening a new connection every time a folder is refreshed .The reason is that our IMAP severs run on very slow compuers and I don't want the IMAP server to thrash the entire hard disk. If the same could be done by deferred ,how would it be ? Regards, Wiki

On Fri, 3 Oct 2008 11:47:53 +0530, little wiki <wiki@littlewiki.in> wrote:
I don't think you're going to find a good solution as long as your client is running from a CGI. The way to reduce load on an IMAP4 server is to make fewer connections and open fewer mailboxes (generally speaking. Different IMAP4 servers have different performance characteristics; you should learn about yours and avoid the requests it specifically cannot satisfy efficiently). Jean-Paul

On Fri, 3 Oct 2008 11:47:53 +0530, little wiki <wiki@littlewiki.in> wrote:
I don't think you're going to find a good solution as long as your client is running from a CGI. The way to reduce load on an IMAP4 server is to make fewer connections and open fewer mailboxes (generally speaking. Different IMAP4 servers have different performance characteristics; you should learn about yours and avoid the requests it specifically cannot satisfy efficiently). Jean-Paul
participants (2)
-
Jean-Paul Calderone
-
little wiki