Troubleshooting 100% CPU usage caused by hmailserver.exe

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 03:08

Hello all,

For the last few months I have been experiencing periodic server hangs caused by 100% CPU utilization from hmailserver.exe. I have not changed my configuration in any way before the issue started happening. What generally happens is I will leave my server alone for a few hours or a few days and then, seemingly out of nowhere, hmailserver.exe jumps to 100% usage and stays there. I can remedy the problem by restarting hmailserver (i.e., killing the process and restarting it). Here is some basic information about my setup.

Hmail version: latest 5.4 (build 1964)
OS: Windows Server 2012 R2 Standard, 64-bit.
Database is MS SQL CE (integrated into the OS)

Here are configuration details about Hmailserver,

SpamAssassin is not enabled.
Anti virus is not enabled.
Anti spam is not enabled.
All logging options are enabled.
I am the only user using the mail server. There are usually no more than 10 emails sent/received a day.

The most confusing thing about my problem is that the logs show nothing peculiar. I have means to automatically track when hmailserver starts using 100% CPU, and the logs show nothing abnormal going on when this occurs. An error log is not even created (for example, the problem happened again today, the 16th, but the most recent error log available is from the 7th).

I used ProcMon to analyze the hmailserver process whenever it spikes up to 100%, and I noticed that whenever this occurs, the process is repeatedly making a registry call related to MS SQL CE and the key has "ExtendedError" in it (I can't remember exactly what it was). I don't know if this is related to the problem at hand. I suspect it might be a problem with the database, perhaps there is some way to "reset" the database (i.e. start fresh?) I am not concerned about losing previous emails (as again I am the only one using this mail server).

Could anyone please provide some input and suggestions to remedying this problem? Again please note that I did not have this problem before. It started randomly occuring starting a few months ago. Generally it takes a few days before it spikes to 100%.

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-17 03:59

Try a real database....

Do a backup
Uninstall, rename hMailserver folders (as additional backup process)
Reinstall selecting a real database type (MySQL, MS SQL versions other than CE, PostgreSQL)
Restore

You should then be running a real database.

No Error logs created??
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 08:15

mattg wrote:Try a real database....

Do a backup
Uninstall, rename hMailserver folders (as additional backup process)
Reinstall selecting a real database type (MySQL, MS SQL versions other than CE, PostgreSQL)
Restore

You should then be running a real database.

No Error logs created??
Yes there are no error logs created.

I'm trying to set up a MySQL server database with a fresh installation of hmailserver but it is returning this error:

Starting task...
Please wait while creating database...
Error:
The MySQL client (libmysql.dll, 32 bit) could not be loaded.
hMailServer needs this file to be able to connect to MySQL.
The MySQL client needs to be manually copied to the hMailServer Bin directory. The file is not included in the hMailServer installation.
Path: C:\Program Files (x86)\hMailServer\Bin\libmysql.dll

I copied libmysql.dll to the path shown above but it is still returning the same error.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 08:35

An update to the post directly above.

I solved the problem. The libmysql.dll from my WAMP installation, for whatever reason, did not work correctly.
I downloaded a different libmysql.dll file from this thread:
http://www.hmailserver.com/forum/viewtopic.php?p=85944
Which made the DB setup work correctly.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 08:43

Update on progress:

Hmailserver's DB has been successfully switched from MSSQL CE to MySQL, and the restore completed successfully. I will continue with this configuration for about a week and report back then to see if the 100% CPU utilization occurs again.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-17 14:53

FYI

when you install latest release of MySQL you also get MySQL Workbench which is the the gui admin tool for MySQL. Workbench is a 32bit application and comes with the latest 32bit libmysql.dll

I would recommend using this version with latest MySQL version. You can find it in following folder (assuming you installed workbench)

C:\program Files (x86)\workbench folder\libmysql.dll

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 18:03

I do not have workbench installed as I am using the MySQL installed as a part of WAMP.

I completed the database switch on July 17th 12:08 AM, hmailserver is once again using 100% CPU on the 17th at 3:01 AM (so it took roughly 3 hours). Seems like the database was not the problem here...

And, as was the case before, no error log is created. The regular logs show no unusual activity at 3:01 AM.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-17 18:19

upgrade to 5.4.2 and see if that helps.

If you still have a problem, then install latest experimental build on top of that. The experimental build has a fix in it for a known race condition which has caused people problems but these are usually IOCP which you aren't getting.

http://www.hmailserver.com/forum/viewto ... 10&t=21420

without any error messages we have nothing to go on. The latest experimental build has far more low level and verbose debug output which may give us a clue.

Have you checked sql logs and especially slow query logs?
Have you checked windows event viewer logs ?

have you run a full chkdsk with sector repair options set (at boot time. Takes a long time)
are you running auto disk defrag ?

have you run any tcp monitoring software so you can see whats connecting to hmailserver or otherwise connected to your server?

does your WAMP installation come with any SMTP server software and have you disabled it? Stopped it completely.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 19:07

percepts wrote:upgrade to 5.4.2 and see if that helps.

If you still have a problem, then install latest experimental build on top of that. The experimental build has a fix in it for a known race condition which has caused people problems but these are usually IOCP which you aren't getting.

http://www.hmailserver.com/forum/viewto ... 10&t=21420

without any error messages we have nothing to go on. The latest experimental build has far more low level and verbose debug output which may give us a clue.

Have you checked sql logs and especially slow query logs?
Have you checked windows event viewer logs ?

have you run a full chkdsk with sector repair options set (at boot time. Takes a long time)
are you running auto disk defrag ?

have you run any tcp monitoring software so you can see whats connecting to hmailserver or otherwise connected to your server?

does your WAMP installation come with any SMTP server software and have you disabled it? Stopped it completely.
Sorry for not making it clear I am running the latest version, build 1964. This is 5.4.2.

I will try the experimental build but I would prefer to try to troubleshoot my current installation before trying to install a new version. This installation and configuration did work previously. I'm going off the mentality of "if it isn't broken, there is nothing to fix."

I just checked MySQL logs. Nothing is logged past the 10th of this month.

I am not sure what you mean by "slow query logs." Sorry I am not very experienced or well-versed with MySQL. Could you please point me in the right direction of where to find the "slow query logs" you are referencing?

I also just checked Windows event logs and there is nothing significant logged near 3:01 AM.

I have not done a full chkdsk. I will do this if I am unable to resolve the problem in any other way.

Yes, auto defrag is enabled. However I just checked and defrag has never been run, since all my disks are at 0% fragmentation.

I do have TCP monitoring software but I was not running it. I will run it now and see if there is any suspicious activity the next time hmailserver.exe uses 100% CPU.

WAMP does not hae any SMTP server software.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-17 19:15

mysql slow query is an option your mysql.ini/cnf file.
Workbench provides a gui for modifying mysql conf setings including which log files you want it to produce. I have no idea if your wamp install provides that but you can edit your mysql.ini file directly.

something like

slow-query-log
long_query_time = 3
slow_query_log_file = "c:/path to/mysql/logs/slowquery.log"

and if you get ExtendedError again look and provide associated codes that it should have with it.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-17 19:30

percepts wrote:mysql slow query is an option your mysql.ini/cnf file.
Workbench provides a gui for modifying mysql conf setings including which log files you want it to produce. I have no idea if your wamp install provides that but you can edit your mysql.ini file directly.

something like

slow-query-log
long_query_time = 3
slow_query_log_file = "c:/path to/mysql/logs/slowquery.log"

and if you get ExtendedError again look and provide associated codes that it should have with it.
OK, I've enabled slow query logging. Thanks for the information. I will report back if/when something appears in the log.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-18 06:27

OK, hmailserver.exe is once again stuck at 100% CPU usage, starting 8:56 PM today. So it took roughly 18 hours since the last time it was stuck at 100% CPU, which was 3:01 AM this morning.

(1) Nothing was logged in mysql slow query.
(2) Nothing was logged in regular mysql log.
(3) An hmailserver error log was not generated (as was the case previously)
(4) Hmailserver's regular logs do not show any abnormal activity at 8:56 PM or any time around then
(5) No emails were sent/received at 8:56 PM or any time around then
(6) Windows event logs show nothing of interest around 8:56 PM
(7) My TCP monitoring software shows the following for hmailserver.exe. The screenshot was taken after hmailserver.exe was using 100% CPU for about 5 minutes.
Image
(8) While hmailserver.exe was using 100% CPU, ProcMon showed that it was repeatedly making registry queries as you can see from the screenshots below. (I don't know if this is normal or not)
Image
Image

I will now try installing the latest experimental build to see if that helps at all.

Update: I've installed the experimental build from June 5, and I've set the log level to extremely verbose, hopefully this will be of use.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-18 14:29

also run windows memory diagnostics tool. It will restart pc

and there is a windows experience diagnostic tool which reports on speed of various hardware components.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-18 18:00

percepts wrote:also run windows memory diagnostics tool. It will restart pc

and there is a windows experience diagnostic tool which reports on speed of various hardware components.
When I built this machine I completed an extensive run of memtest86+, which I am certain is more accurate and strenuous than any built in Windows tools. (Also memory faults are usually very obvious and rarely manifest themselves in a "high level" like we are seeing here). Also, WEI is known for being inaccurate and a pretty unreliable metric for assessing system performance. Although I'm curious why you want me to run these tests? Did you need hardware specifications? Benchmark results?

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-18 18:17

I'm just suggesting tests which could point to hardware problems.

Its very odd that this happening to just you and nobody else. It points to some conflict somewhere, possibly software or possibly hardware or possibly OS settings.

Are you running hmail at normal priority?
Are you allowing hmailserver to run on all processors?
Is processor set for best performance of programs or background services?

etc, etc, etc....

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-18 19:06

percepts wrote:I'm just suggesting tests which could point to hardware problems.

Its very odd that this happening to just you and nobody else. It points to some conflict somewhere, possibly software or possibly hardware or possibly OS settings.

Are you running hmail at normal priority?
Are you allowing hmailserver to run on all processors?
Is processor set for best performance of programs or background services?

etc, etc, etc....
Hmailserver is at normal priority. It is allowed to run on all proccessors. It's set to optimize for background services (this was the default option in Win 2012 R2, I never changed it.)

My server is very low-spec'd (it's running on a measly single core CPU with 4 GB of RAM). I didn't spend much on hardware since I would be the only one using this server. Is it possible that this is causing the problem?

I realized that I never provided this piece of information that may or may not be relevant:
Sometimes, after being notified that the CPU usage is at 100% (via the Pulseway mobile app--really handy application by the way if you own servers and have a smartphone), I'll log in to the server via RDP and find as many as 10 dialog boxes titled "Explorer" with the message "Canvas does not allow drawing" with a single "OK" button. I'm not able to press OK, because the window is simply frozen, I have to force end the explorer.exe process. I searched this error on Google and didn't find anything of use. I searched the error in conjuction with "hmailserver" and basically found...nothing. I don't know if this information is relevant but I am including it here in case any of you have encountered this before.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-18 19:27

4GB is ample. hMail is a 32bit application and there is windows limit of around 1.8 GB for a 32bit program so providing nothing else is using loads of RAM then your spec is fine.

I would suggest you find out what is opening those dialog boxes as that might well be the cause of the problem.

I hope you aren't running any VBScript (or anything else) from eventhandlers.vbs which try and open any dialogs/prompts. Services won't allow that (usually causes hmail to fall over if you have script which tries such as windows command with an echo or screen output in it).

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-18 19:37

percepts wrote:4GB is ample. hMail is a 32bit application and there is windows limit of around 1.8 GB for a 32bit program so providing nothing else is using loads of RAM then your spec is fine.

I would suggest you find out what is opening those dialog boxes as that might well be the cause of the problem.

I hope you aren't running any VBScript (or anything else) from eventhandlers.vbs which try and open any dialogs/prompts. Services won't allow that (usually causes hmail to fall over if you have script which tries such as windows command with an echo or screen output in it).
I will try to see what is causing the Canvas does not allow drawing errors. Of course though I have to wait until this happens again.

I do have functions in eventhandlers.vbs but they do not interact with the desktop. They are simple command-line executions to copy files and such forth.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-18 19:46

file copies may open dialogs if for some reason they fail and aren't handled properly. When you say command line do you mean windows commands? Do you have @ECHO OFF set ?

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-18 20:10

percepts wrote:file copies may open dialogs if for some reason they fail and aren't handled properly. When you say command line do you mean windows commands? Do you have @ECHO OFF set ?
Yes they are windows commands, and @echo off is set. The function is only run as part of a rule for a received email, and since no emails are sent to that account when the 100% CPU usage occurs, I am fairly confident that the file operations are not causing the problem.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-18 22:14

nh8a9fwea wrote:
percepts wrote:file copies may open dialogs if for some reason they fail and aren't handled properly. When you say command line do you mean windows commands? Do you have @ECHO OFF set ?
Yes they are windows commands, and @echo off is set. The function is only run as part of a rule for a received email, and since no emails are sent to that account when the 100% CPU usage occurs, I am fairly confident that the file operations are not causing the problem.
Well something is causing them and they need to be stopped if only to prove they are not the problem. Could even be your monitoring software.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-20 19:03

It's been about 40 hours since the last time 100% CPU occurred. So far everything seems to be running fine, however I did make a configuration change. I disabled SSL for all ports. I'm not sure if this was actually the problem (since it's only been 40 hours). I'll wait a week and see if the problem is actually fixed.

If SSL is causing the problem, what could be happening? Is it because I'm using a self-signed certificate? I can't fathom how using SSL could cause hmailserver.exe to be stuck at 100% CPU usage..

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-22 04:35

Nope, looks like I was totally wrong because today, July 21st 7:01 PM hmailserver.exe is once again stuck at 100% CPU usage

It's not SSL, it's not my configuration, it's not the database, hmailserver is logging absolutely nothing, mysql is logging nothing, the experimental build did not help......this is really starting to frustrate me.

Honestly, what in the world is causing this? I'm about ready to switch to another mail server.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-22 04:39

Clearly an error is occuring, but hmailserver is not generating any error logs, can a developer please enlighten me as to why that is?

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-22 04:46

using the experimental version set debug logging on and in hmailserver.ini set

LogLevel=99

this will create a very large log file but it may show you what was happening leading upto 100% CPU

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-07-22 16:38

It was already set to 100. As I said previously no error log is generated and the regular log shows nothing of interest.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by percepts » 2014-07-22 16:48

impossible track down if we can't reproduce the problem and its only you that has the problem.
I suspect there is some software conflict but I've exhausted all I can think of.

If you suspect a bug then post an issue at following and someone may look at it but without being able to reproduce it its tough to find. And put a link in back to this topic so developers can see whats been tried.

https://github.com/hmailserver/hmailser ... state=open

doctorray
New user
New user
Posts: 4
Joined: 2014-07-23 00:56

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by doctorray » 2014-07-23 01:01

Hello,

I'm having the same exact problem. My specs are:

hMailServer 5.3.2-B1769, using the MSSQL CE built in

I currently have 4 IMAP sessions active, and am stuck at 25% on a quad core. Server 2008R2. Server is very underutilized but the CPU is hogged for no apparent reason. If I change the affinity to just one CPU, it sits at 100%.

I haven't been able to figure it out either but it's really pissing me off. It didn't used to be this way. So, it's not just you. I have about 50 users but never more than 5 active simultaneously. I'd rather not take the time to replace the software but if it continues this way I'll have no choice.

Ray

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-23 01:22

You should really start a new thread and link back please....

Any error logs created?
What Antivirus is on the system?
Is the Antivirus used for 'inline' scanning?


(MS SQL CE isn't meant to be used in a commercial environment as per it's EULA, and it really is just a 'toy' database. You should look at using a real database)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

doctorray
New user
New user
Posts: 4
Joined: 2014-07-23 00:56

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by doctorray » 2014-07-23 01:35

Since the latest post was just a few hours ago and having read through the entire post I found my issue to be pretty much identical (he upgraded database and problem didn't go away) I thought I'd throw my support.

I didn't set up this hMailServer instance, I was blessed with its management by someone who doesn't work here anymore. It's also never really used for anything, so I'm comfortable for the next few days running on mssql ce. I'll upgrade later. Even with a "toy" database I shouldn't be having this issue.

No A/V. No spam filtering. No errors in any logs. If I turn off SMTP, leave IMAP on and restart, still uses cpu. If I turn off IMAP and leave SMTP on, it's normal again. Currently there are four imap clients. I'm going to temporarily firewall them out and see if it still hogs CPU with no one connected. I'll report back if I figure it out.

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-23 02:02

Some IMAP clients like to make 'offline' copies.

Thunderbird in default settings is one.

It could be (because this has started suddenly after months of normal working) that someone with a lot of mail, has
- got a new machine, and reinstalled a mail client
- changed mail client
- is doing some serious moving of files or searching

AV is the usual culprit, but also if you have SpamAssassin it could be that
It could also be hMailserver doing a scheduled compressed backup
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

doctorray
New user
New user
Posts: 4
Joined: 2014-07-23 00:56

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by doctorray » 2014-07-23 02:18

So nh8a9fwea, perhaps this isn't related, but I've traced my cpu spike down to a single IMAP client, specifically from a w3wp.exe process on a local web server. I've taken a packet capture for analysis to try and see what it could possibly be doing to wreak such havoc.

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-23 02:22

Someone doing a search or sort in a webmail ?

Which webmail do you have installed?

PS glad you found it
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

doctorray
New user
New user
Posts: 4
Joined: 2014-07-23 00:56

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by doctorray » 2014-07-23 02:36

mattg wrote:Someone doing a search or sort in a webmail ?

Which webmail do you have installed?

PS glad you found it
Yup. Not webmail though. It's a web app one of the developers wrote to query a sensor logging inbox for high temperature alerts from mobile assets. Every 30 seconds. But, the inbox kept getting bigger and bigger, so searches took longer and longer, and now get stacked on top of each other giving the appearance of a race condition.

Sorry for thread hijacking! I'm firewalling out that client in the mean time and will deal with the developers tomorrow. Thanks.

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-23 02:50

I work with Healthcare predominately....

Sounds like something that I'd be keen to help with / see the results of
(Sounds like vaccine fridge data logging)

If you care to share, or need help, please send me a PM
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

KoGoR
New user
New user
Posts: 4
Joined: 2010-07-29 17:49

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by KoGoR » 2014-07-29 13:03

Hi all!
We have the same symptoms with hmailserver for couple ot the last versions. Only restart helps of hmailserver to solve the problem for a while. Hmailserver runs on HP DL380 4xCPU server with 8GB RAM. Tried to migrate to external MySQL but also didn't solve thye proble, As said nh8a9fwea before hmailserver consumes 25% of all CPU (I assume that its one core for 100%) . It stops processing messages and does not write anything to logs at all for hours.
We do not use antivirus and etc special features of hmailserver, they all are disabeld.
How could we troubleshout hamilserver state to provide more information for developers?

User avatar
mattg
Moderator
Moderator
Posts: 19460
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mattg » 2014-07-29 14:55

Just wondering (not directing you to try), have you used one of Bill's recent Alpha builds

What version of hMailserver are you currently running

(PS you REALLY should start a new thread please, and link back to this one)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

mailserveruser
New user
New user
Posts: 11
Joined: 2014-07-29 16:48

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by mailserveruser » 2014-07-29 17:17

If someone can reproduce this 100% cpu issue reliably, you might be able to tracked down roughly where ie what API its hanging on with this little app http://www.rohitab.com/apimonitor. It can be quite illuminating as to whats really going on under the hood of programs.

My 1st thought on this, was perhaps it was a threading issue, where one thread running on one core was finishing before another and getting stuck in a loop, but as its reproducible on a single core cpu, my only other thought is, is hyperthreading switched on with that single core cpu? If the SBS2003 instance is showing more than one graph in the task manager processes tab, each one of the cpu graphs represents a core.


Might be worth a shot.

KoGoR
New user
New user
Posts: 4
Joined: 2010-07-29 17:49

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by KoGoR » 2014-07-30 08:35

We have this issue with the last two versions. But because this was a production server we didn't try alpha version but may be we would.
I have enabled indexing and have done some tweaks with performance tuning. So far server is running smoothly.

nh8a9fwea
Normal user
Normal user
Posts: 41
Joined: 2014-06-22 00:18

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by nh8a9fwea » 2014-08-01 07:23

Hello again everyone,

I am very pleased to say that I have identified the culprit, and I am very confident that I have solved the problem.

It was indeed a software conflict. After I stopped the network monitoring program NetWorx on my server, hmailserver has not spiked to 100% CPU since about 11 days ago (I have not been able to go more than a few days without a CPU usage spike).

Interestingly, disabling NetWorx solved many more problems than just this.

I posted a thread some time ago about not being able to get SpamAssasin working properly (thread: http://www.hmailserver.com/forum/viewto ... =7&t=26644). I initially thought that a Windows update resolved the problem, but I was wrong as the same problem came back. The moment I disabled NetWorx, SpamAssassin magically started working.

Also, I have totally unrelated software Plex Media Server on this server. This program was suffering from a similar problem reported here, as it would consume 100% CPU after a few hours of being open. After disabling NetWorx it is no longer exhibiting this behavior.

To the other two users who have reported this same issue, if you have this software running on your server, please try to disable it to see if it resolves your problem.

^DooM^
Site Admin
Posts: 13862
Joined: 2005-07-29 16:18
Location: UK

Re: Troubleshooting 100% CPU usage caused by hmailserver.exe

Post by ^DooM^ » 2014-08-02 01:15

i was getting blue screens on my home pc lately and checking the mem dump file, Networx was also the culprit. Have removed it from all my machines which is a shame as i liked it.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Post Reply