IMAP out of control 94% CPU usage

rndinit0

Verified User
Joined
Jan 15, 2005
Messages
91
Ive been noticing some wacky performance on my server.

When I run top I get this
25333 hosting_client 20 0 4832 4832 868 R %96.1 0.5 14:49.49 imap

The 96% indicates that this users imap process is using 96% of CPU resources, my load averages during this time 10 - 7 - 5 (load average: 8.64, 6.43, 4.78)

Heres the thing though:

1.) Im using dovecot
2.) The user above does not use the IMAP service cause their mail is being hosted with gmail
3.) The users MailDir contains billions of files sized 949 xxxxxxxx.xxxx.mbox

Ive tried deleting the .mbox files, but Im unable to cause rm -rf * returns the too many arguments error. (This is because theres justs tons of mail files in there)

Any ideas on how to fix this?
 
Billions of files?

They probably got there during the conversion to Dovecot and I thought there's that many.

Quick fix: rename the directory and create a new one with the same permissions and ownership.

Then learn how to write a one-line bash script to find the files one at a time and execute the rm individually for each one.

For a billion though it could take a while.

have you tried killing process 25333 ?

Jeff
 
No script needed:

find . -name 'matchin_string_of_files_to_delete*' -print0 | xargs -0 rm


Example in this case, I want to delete all files that end with .mbox
find . -name '*.mbox' -print0 | xargs -0 rm
 
Back
Top