# IMAP lagging

## mope

Both sylpheed and evolution lag when I open them. They also are really slow when I do anything like open an email or delete an email.

I have no idea where to go with this. I found this discussion with no resolution:

http://www.tmtm.org/cgi-bin/w3ml/sylpheed/msg/16580

I read through many googled results on 'evolution lag gnome' (evolution w/o gnome produces too many scientific hits to be meaningful) but didn't find a solution.

----------

## mope

wow, what's everyone using for IMAP? No one is experiencing this issue--I wonder if it's my configuration.

----------

## asimon

There are big performance differences for the various imap servers.

A year ago I used courier-imap. But with various mail folders from mailing lists which contained at that time around 30.000 mails, courier-imap was getting too slow to work with. Changing to an other folder in kmail took around 10 secounds alone. All operations were very slow. Reading mails was a pain because it took several seconds until a selected mail was shown. Of course I also tested it with Mozilla and evolution to check if the bottleneck was kmail, but all operations were slow with all mail clients.

At that time I changed to cyrus-imap. After that change everything was fast. The difference in performance was quite astonishing. But configuring cyrus-imapd can be a pain. Today I use dovecot which is quite easy to setup and as fast as cyrus-imapd, but hasn't all the features of cyrus, but it's enough for me. The author stated in the mailinglist that the development version (which I don't use, I stick with the last stable release) is actually even faster then cyrus-imapd. There are ebuilds for dovecot in bugzilla, and ebuilds for cyrus are in Portage.

The filesystem can have a perceivable performance impact too when it comes to mails. I use maildir format, i.e. many many tiny files. For this reiserfs seems the best choise performance wise. The mbox format is generally super slow when it comes to deleting and moving mails. maildir is generally much faster then mbox.

But if your mailboxes don't contain thousands of mails it shouldn't be a problem in regard to performance. Then I would suppose that your bottleneck lies somewhere else.

----------

## mope

Thank you for your reply.

I only have about 10 emails, LOL--I'm a very popular person!

I just configured my last school's account to see if it was the server but that one was slow too. I am actually on the intranet so I can't see how it would be the connection. I'm wondering if something to do with my network configuration could be messing things up if I have my NIC configured incorrectly--although everything else seems to work fine.

Both evolution and sylpheed lag when I open them and freeze every minute when they check the server. They both take an incredible amount of time to display the message when I simply select an email. In fact, they app goes blank (like a program that is frozen in windows but still showing on the screen except that you can't read anything).

For some reason I can't delete any of my emails or flag them correctly. At first I thought it was the server but now that I have added the second IMAP account and it won't flag them either, I'm thinking something must be seriously wrong with whatever controls IMAP on my machine--if that is even the case. I'm 'emerging evolution sylpheed -eD' right now to determine if something within some code somewhere is awry. Is that even a possiblity or is all IMAP implementation within the code of each application?

I'm leaning towards their being a common package that could be at fault because I'm getting the same behavior across all clients--even KMail. Do you think I'm on the right track?

----------

## Janne Pikkarainen

What if you telnet to your mail server like this:

telnet mailserver 143

<wait for response>

a login youraccount yourpassword

<wait for response>

a select INBOX

... is that sluggish, too?

----------

## mope

#telnet <server> 143

didn't do anything for me (command not found).

So I ran a search and emerged putty. I can telnet to my server and also ssh. Both don't appear to be sluggish.

I use M2 in opera and that doesn't seem to be having a problem either. I am currently using kde, btw.

----------

## honold

well, the openbsd port compiles in kerberos support by default.  if the public inet kerberos servers aren't available when a client connects, it results in a very laggy imap session.  the gentoo port doesn't do the same, does it?

----------

## Janne Pikkarainen

mope: Another idea: snoop with ethereal and see from the log what's the point when everything stalls.

----------

## mope

Janne,

Could you please explain what you mean? I've only been using gentoo for a short while.

----------

## Janne Pikkarainen

Ethereal is a graphical tool for following your network traffic. It has a console-based counterpart, tethereal, but stick to Ethereal this time since it has relatively easy GUI. 

Anyway, first install ethereal with command "emerge ethereal". After that, start ethereal as root-user by entering "ethereal" to your nearest terminal windows.  

Then choose from Ethereal's Capture-menu "Start" and let it capture your network traffic. Ethereal probably opens up a new window where it lets you choose some capture-specific options; the defaults should be fine so press OK.

Next startup your problematic mail program as normal user and check your mail as usual. Then go back to Ethereal and press "Stop" in it's capture window.

Now you should see a bizarre-looking snippet of your network traffic in Ethereal's main window. At first try to spot with your eyes the part which would be mail traffic. It should be relatively easy to see - under Protocol column should be "IMAP".  Select any of those with left mouse button and then right-click the very same item you selected: now you should be able to choose "Follow TCP Stream" option.  That shows you the whole "Ok, let's go and fetch some mail"-sequence from the beginning to the end, written in clear-text. 

If that clear-texted version of stream doesn't help to spot the reason for slow operation, you can continue to look at the main window of Ethereal. On the left-hand side there is Time column, which tells arrival time for each packet. If difference between two (IMAP) packets suddenly differs much more than elsewhere, look very carefully what's happening there.

Hope this helps.

----------

## mope

Thank you very much for that walk-through. Here's the output that I think is relevant (I've bolded the things that stuck out to me):

 *Quote:*   

> * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] p01.es.uci.edu IMAP4rev1 2001.315 at Sat, 30 Aug 2003 13:48:07 -0700 (PDT)
> 
> B00000 CAPABILITY
> 
> * CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND LOGIN-REFERRALS STARTTLS AUTH=LOGIN
> ...

 

I don't know what other process has opened my mailbox. Could that be the server?

That seems to be why the folder is read only which is also the reason I can't expunge mail I've deleted. Is that something I can address (possibly by changing the persmissions of the IMAP folders)? If I can change the permissions what should they be that would allow me to write to them but still be safe?

The last thing I noticed was the /var/spool/mail/XXXXXX. I don't have a file called that. I do have a file named after my username (e.g., gentoo-user) but evolution seems to think it should be named after my email account username (mail-user). So I copied gentoo-user over to mail-user to see if that did anyhting and it didn't seem to make a difference.

The times are about 9.6 seconds.

I've also configured my old school's account (at a different university) and that one works fine now. The only problem is that it's in another state and I'm actually on campus with this one--so what's with the lag  :Sad: 

----------

## mope

oops, forgot to add:

whenever I start ethereal from an x terminal I get this

 *Quote:*   

> root@zaire src # ethereal
> 
> Xlib: connection to ":0.0" refused by server
> 
> Xlib: No protocol specified
> ...

 

I have to create a link on my desktop and run it as root. Any ideas of where I can look for help on that?

----------

## Janne Pikkarainen

 *mope wrote:*   

> 
> 
> * NO Trying to get mailbox lock from process 28505
> 
> * 53 EXISTS
> ...

 

Do you have shell access to that server? You could use command "ps aux | grep 28505" and see what's that process. Anyway it seems that another mailclient is using your mailbox all the time and thus the lag. 

 *mope wrote:*   

> 
> 
> I don't know what other process has opened my mailbox. Could that be the server?
> 
> 

 

No, I don't think so... unless is it's very, very badly misconfigured.

 *mope wrote:*   

> 
> 
> That seems to be why the folder is read only which is also the reason I can't expunge mail I've deleted. Is that something I can address (possibly by changing the persmissions of the IMAP folders)? 
> 
> 

 

By making sure that no other processes aren't using your mailbox.

 *mope wrote:*   

> 
> 
> The last thing I noticed was the /var/spool/mail/XXXXXX. I don't have a file called that. 
> 
> 

 

That's on the server side - /var/spool/mail/ is a common directory for storing users inboxes.

----------

## Janne Pikkarainen

 *mope wrote:*   

> oops, forgot to add:
> 
> whenever I start ethereal from an x terminal I get this
> 
>  *Quote:*   root@zaire src # ethereal
> ...

 

Two solutions: 

1) While using your desktop, start a new terminal window and write there

```

su -

ethereal

```

2) Install a package called "sudo" (emerge sudo) and configure it to to give you root privileges to ethereal. 

But the first one is the easier.

----------

## mope

Here is the page btw, webmail.uci.edu

I'm wonder if their squirrelmail is running concurrenlty and the possible "other" service.

Anyway, I don't know if I have shell access. I can ssh into it but that's the extent of my knowledge--how do I find out?

I typed that into an x terminal and this is what I got:

michael@zaire michael $ ps aux | grep 28505

michael   9692  0.0  0.0  1420  464 pty/s4   R    01:25   0:00 grep 28505

----------

## mope

 *Janne Pikkarainen wrote:*   

>  *mope wrote:*   oops, forgot to add:
> 
> whenever I start ethereal from an x terminal I get this
> 
>  *Quote:*   root@zaire src # ethereal
> ...

 

I wasn't able to get your first suggestion to work. I'm not sure if you were able to tell from my quote but I'm already root when I get that error. Should I start a new thread because it actually occurs whenever I try to start a program as root within x? I can't start any gui from a terminal ever. I have to make a link on my desktop and check "run as" 'root'.

I would just do the second suggestion but I'm thinking there's an underlying problem that it won't fix.

Thank you for your time.

----------

