Webmail very slow
Problem reported by Charles Michel - 6/10/2016 at 12:57 PM
I am running out of idea so any suggestion would be welcome.
The webmail is extremely slow, particularly on first load, or when logging in, then suddenly becomes fast again and a few minutes later very slow. By very slow, I mean that when connecting to the webmail it can take more than 1 minute before anything displays.
Smartermail enterprise 15.1 (updated yesterday) running in a VM on a very fast machine, very fast SSD, Windows 10 Pro, 100GB free on the C drive, the CPU usage is close to zero, the network also. The IIS log file doesn't show anything abnormal, I seem to be the only IP connected, and the smatermail admin says the same. Doesn't look like a DDOS. I have been running smartermail for years without a problem, and moved to Win 10 6 months ago (the machine is likewise 6 months old, fresh windows install), however the problems started only a few days ago. 
I tried uninstalling smartermail, rebooting and reinstalling it, no change in behavior. No antivirus running on the machine, outside of windows defender, but it doesn't seem to do anything. Other software installed on this machine: 
OpenVPN (not running), Chrome, FileZilla Client, RdpGuard, Spybot Anti-Beacon, VLC, Winrar. And that's it.
I can't think of anything else to try
[Edit] Also the problem is the same whether I connect to the webmail remotely or from within the VM (via RDP). And the VM itself is very responsive. And other websites running in other VMs on the same machine do not have any problem. It seems to be smartermail specific.
[Edit2] Adding one more piece to the puzzle: I created another website in the same VM which doesn't block like the webmail, so it doesn't seem to be IIS either.

6 Replies

Reply to Thread
Eric Tykwinski Replied
Most of my personal issues with webmail running slow was due to IIS cacheing on the local app pool and running low on memory on the server itself. They suggest the default to be 7 days for cache, and we throw ample memory to the VM.

Charles Michel Replied
The VM has ample free memory. I set the cache to 7 days but I doubt that is the problem.
Bruce Barnes Replied
Thanks for including the details about running under Windows 10, Pro, Charles. The Microsoft article at : https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx may help to provide some information as to what's going on. Specifically the fact that Windows 10 Pro has a maximum memory capability of 10tb: Physical Memory Limits: Windows 10 The following table specifies the limits on physical memory for Windows 10. Windows 10 Enterprise 4 GB 2TB Windows 10 Education 4 GB 2TB ======= >Windows 10 Pro 4 GB 2TB <====== windows 10 home 4 gb 128gb" so, my questions would be: 1. how much physical memory is installed on the server? 2. you running under a virtual environment. a bit of personal bias here: i'm not a fan of running anything on mail servers except the e-mail server software, there's the potential for way too much disk, and memory io. having stated that, ow much actual memory is allocated to the virtual environment in which smartermail is installed? "ample" is not a a defininging memory descriptor here, please provide specifics. 3. how much hard drive space is allocated? 4. have you disabled the smartermail web server? once iis is properly configured, thw smartermail web services should be completely disabled. 5. what size is your virtual didk swap file? windows tends to like 25% of the hard drive space to be dedicated to the swap file, and, if there's enough space available, will automatically allocate that space, but will also shrink the space as data and programs demand storage. 6. what's your total, overall server bandwidth, and are there any restrictions on nic traffic? 7. neithet smartermail, nor any othrr e-mail servrr likes to share it's files with any other program. have you disabled any antivirus calls to both the smartermail program and data directories? antivirus calls should be made through smartermail - under the settings tab. thanks for providing this additional information. - bruce windows="" 10="" home="" 4="" gb="" 128gb"="" so,="" my="" questions="" would="" be:="" 1.="" how="" much="" physical="" memory="" is="" installed="" on="" the="" server?="" 2.="" you="" running="" under="" a="" virtual="" environment.="" a="" bit="" of="" personal="" bias="" here:="" i'm="" not="" a="" fan="" of="" running="" anything="" on="" mail="" servers="" except="" the="" e-mail="" server="" software,="" there's="" the="" potential="" for="" way="" too="" much="" disk,="" and="" memory="" io.="" having="" stated="" that,="" ow="" much="" actual="" memory="" is="" allocated="" to="" the="" virtual="" environment="" in="" which="" smartermail="" is="" installed?="" "ample"="" is="" not="" a="" a="" defininging="" memory="" descriptor="" here,="" please="" provide="" specifics.="" 3.="" how="" much="" hard="" drive="" space="" is="" allocated?="" 4.="" have="" you="" disabled="" the="" smartermail="" web="" server?="" iis="" is="" properly="" configured,="" thw="" smartermail="" web="" services="" should="" be="" completely="" disabled.="" 5.="" what="" size="" is="" your="" virtual="" didk="" swap="" file?="" windows="" tends="" to="" like="" 25%="" of="" the="" hard="" drive="" space="" to="" be="" dedicated="" to="" the="" swap="" file,="" and,="" if="" there's="" enough="" space="" available,="" will="" automatically="" allocate="" that="" space,="" but="" will="" also="" shrink="" the="" space="" as="" data="" and="" programs="" demand="" storage.="" 6.="" what's="" your="" total,="" overall="" server="" bandwidth,="" and="" are="" there="" any="" restrictions="" on="" nic="" traffic?="" 7.="" neithet="" smartermail,="" nor="" any="" othrr="" e-mail="" servrr="" likes="" to="" share="" it's="" files="" with="" any="" other="" program.="" have="" you="" disabled="" any="" antivirus="" calls="" to="" both="" the="" smartermail="" program="" and="" data="" directories?="" antivirus="" calls="" should="" be="" made="" through="" smartermail="" -="" under="" the="" settings="" tab.="" thanks="" for="" providing="" this="" additional="" information.="" -="">
Bruce Barnes ChicagoNetTech Inc brucecnt@comcast.net Phonr: (773) 491-9019 Phone: (224) 444-0169 E-Mail and DNS Security Specialist Network Security Specialist Customer Service Portal: https://portal.chicagonettech.com Website: https://www.ChicagoNetTech.com Security Blog: http://networkbastion.blogspot.com/ Web and E-Mail Hosting, E-Mail Security and Consulting
Charles Michel Replied
Thanks for your response Bruce. 
I would be surprised if it was a disk or memory problem. The VM has a 126GB disk, of which 103GB is free. The underlying hardware has several hundreds GB free. The host has 128GB  RAM, the VM in which smartermail is running has 6GB RAM of which 4GB is available. This is Windows 10 Pro, so the RAM limit should be way higher than this.
I have not disabled the smartermail web server, but I just did and it did not seem to improve anything.
No antivirus running.
The server is connected with a gigabit connection, no limit on how much the VM can use.
I recorded a video of the lag I am referring to. As you will see smartermail (and the VM) seems to be idle while chrome is waiting for the login page to appear. There seems to be something blocking. I then tested the connection on proof.ovh.net, and the bandwidth available seems to be perfectly normal. This is all recorded from within the VM (add https before as smartertools prevents me from posting a hyperlink):
Linda Collins Replied
Try disabling the SmarterMail Web Server which is only used for internal web connections. may lead to a clue. Also check event logs.
Charles Michel Replied
OK I think I found what is going on, and Bruce was the closest to the solution. The problem wasn't a memory limit or IO limit but a connection limit in IIS.
The way I understand ActiveSync works is that it keeps a permanent, low bandwidth, https connection so that it gets emails immediately, simulating push. As I added more devices and more mailboxes I ended up with lots of concurrent connections to SmarterMail through IIS.
It appears that Windows 10 Pro has a maximum concurrent connections limit in IIS. As a result my devices were saturating this limit. Converting most connections except a handful to imap solved the problem and the webmail became responsive again.
It also looks like the connection limit is per website rather than for the whole of IIS (I had some websites running along Smartermail in the same VM that were unaffected). If that's the case I wonder if a way to reduce the risk of this happening is not to create two instances of the smartermail website on the same machine, one for ActiveSync, and one for the webmail. Not sure if I don't risk corrupting something but I would assume not since smartermail already runs with two simultaneous webmails (IIS and the native web client).

Reply to Thread