takes up all memory and cpu on large mail boxes

I have a user (or set of users) that whenever logs in to Usermin and checks his email, the server’s CPU usage will skyrocket, followed by consuming all available RAM, then the CPU usage goes down but RAM is completely taken by two processes that start once the user logs in to Usermin. That will go on and most of the time will bring the server to it’s knees for a long, long time. I usually have to reset it though.

It’s a completely replicable set of events and I’m guessing a Usermin bug, but I can’t seem to find anything about it anywhere. Even found a post from 2009 but nothing else:

Do you guys ever had such a problem?

This is not happening when the user accesses his email from Roundcube for example.

I’m running Virtualmin 3.97 on a CentOS 6.3 with 8Gb RAM, all the latest updates applied.

This is a time bomb so any help is truly appreciated!



Do you happen to know how large this particular mailbox is, in terms of disk space usage, and how many messages are in it?

I’ll pass that info along to Jamie, and see if he has some thoughts on what to do with that.



That’s about 2.3Gb and has around 5500 messages in it.

Here’s a full “du” of his Maildir:

36K ./.drafts
2,3G ./cur
72K ./.sent
36K ./.trash
4,0K ./new
4,0K ./tmp
2,3G .

Are you able to get into your mailbox at all?

Talking to Jamie, he says that certainly shouldn’t happen, that a mailbox of that size isn’t a problem.

But he was wondering if maybe the mailbox were being sorted… if you’re able to eventually access it, try clicking the “Reset sorting” link at the top of the mailbox list. Does that make a difference?


I used to be able to access that - just tried and it’s freezing my server right now.

But what you said makes perfect sense - that inbox used to be in a very small server and people would go in, sort messages by size and delete the bigger ones. So I guess it saved that sorting preference and whenever people go back, with their increased mail boxes, hangs while trying to sort all messages.

Is there a way around this? At least make it so it won’t take up all CPU/memory?

Thanks so much for your feedback!

Jamie says that you can delete the sort settings for this user with this command:

rm ~/.usermin/mailbox/sort.*

Yeah, well - didn’t work… :frowning: There was a sort.INBOX there but removing it didn’t do the trick unfortunately…

But even then, if it did work, the user logged in and tried sorting the inbox again, that’d happen every time, right?

Is there a way to avoid this behavior? And would you know another forum more people are in and I won’t bother you about it anymore? :slight_smile:

Thank you so much Andrey!


Well, I suspect the issue is that not many folks run into the problem you’re seeing… even Jamie, the author of the software, doesn’t know why it’s doing that.

If changing the sort behavior fixed it, Jamie would look into that to try and prevent that problem in the future.

Since that’s not it, we need to look elsewhere :slight_smile:

I’ll talk to him and see what ideas he has.



I am also experiencing this issue for at least one specific user account on a CentOS Linux 6.5 and Virtualmin 4.11.gpl GPL , seemingly when openin large attachments.

The funny thing is that the issue is happening when the user from usermin tries to open the mail, but when the admin reads the user’s mail from Webmin, things apparently work fine.

Each time the user tries to open the mail, the CPU jumps to 100% and RAM usage increases. When the user attempts multiple times, the server freezes an I have to kill view_mail.cgi manually from command line.

A few months ago I had a user who had somewhere in the neighborhood of 5.5Gb email account size. Everytime she tried to login or click on an email another process would start and use 100% CPU and after about 3 proccess or so it would then use up all the memory and crash the server. Killing PID’s was the only way to keep the server up until I locked her out by changing the password.

I ended up moving her to another server with these spec’s:
Webmin version 1.701
CentOS Linux 6.5
Virtualmin version 4.11 Pro
Real memory 15.54 GB total (less than 5% usage)
Local disk space 855.63 GB total (less than 5%)
CPU load averages 0.38 (1 min) CPU load (1 min) 0.44 (5 mins) CPU load (5 mins) 0.46 (15 mins) CPU load (15 mins)

Things were fine for her until I moved about 50 other virtual servers onto the same machine with her.

The usage is now:
Real memory 15.54 GB total, 4.80 GB used Memory used

Virtual memory 15.62 GB total, 253.82 MB used Swap space used

Local disk space 855.63 GB total, 264.68 GB used Disk space used

She has had one more instance of trouble when her account got to about 5Gb’s again. She cut back to under 4 and has been quiet again.

On the original server that I moved her from, I have had two more issues with users since then.

The specs of this server are:
Operating system CentOS Linux 5.8
Webmin version 1.701 Virtualmin version 4.10 Pro

Kernel and CPU Linux 2.6.18-308.1.1.el5 on x86_64 CPU load averages 0.29 (1 min) CPU load (1 min) 0.47 (5 mins) CPU load (5 mins) 0.50 (15 mins) CPU load (15 mins)
Real memory 7.79 GB total, 1.90 GB used Memory used

Virtual memory 15.63 GB total, 2.86 GB used Swap space used

Local disk space 894.77 GB total, 583 GB used Disk space used

One of the users had trouble at around 3Gbs and the other at 5.85. The first user cut back to around 2 Gbs and was fine the second one I was able to fix by using the suggestion that samri proposed in this post:

I wanted to weigh in that I don’t think this is as uncommon as andreychek might think. I normally troll here for answers and don’t necessarily post (this is me trying to “give back” more)

and offer my situation/logs for clues if anyone wants to take a look.

I forgot to mention that on the last user with the 5.85 Gb mail box, she could get into the account just fine and even read some emails, the trouble seemed to be when opening an email that had an attachment that was larger 1 MB. It would just hang. (As opposed to the first user I mentioned that opening any email would cause the cpu and memory spikes for