SMSGWS.EXE Idle state but still 50% CPU Usage?

SMSGWS.EXE Idle state but still 50% CPU Usage? SearchSearch
Author Message
Mundos
New member
Username: Coajack258

Post Number: 9
Registered: 05-2009
Posted on Sunday, October 05, 2014 - 09:48 pm:   

Hello nowsms dev's.. How come smsgws.exe stays 50% cpu usage even no in/out messages being process?
Btw I'm using the latest version.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5066
Registered: 08-2008
Posted on Monday, October 06, 2014 - 06:02 pm:   

Hi,

I don't know what your configuration is, but in the past I have seen issues where outbound messages are stuck with no available route. Are there files stuck in the Q directory?

Or possibly a build up in the SMS-IN directory.
Mundos
New member
Username: Coajack258

Post Number: 10
Registered: 05-2009
Posted on Tuesday, October 07, 2014 - 12:43 am:   

This is my SMSGW.INI
http://www.mediafire.com/view/9gwhdovxttodz3zwld53ht8mqprzg61

Are there files stuck in the Q directory?
No, cuz I'm using ErrorQRetainDays=0

Or possibly a build up in the SMS-IN directory.
what do you mean?}
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5069
Registered: 08-2008
Posted on Friday, October 10, 2014 - 05:03 pm:   

Sorry for the lengthy delay in response.

I am unable to access the link for your SMSGW.INI file.

But let me explain what to check in more detail. And then maybe you can send me some files via email.

Locate the NowSMS\Q directory with Windows File Explorer.

The NowSMS directory is usually under Program Files (x86) or Program Files. But if you have been running NowSMS for more than a year, some of our older versions used the ProgramData directory instead, which is often a hidden directory. In either case, if you've found SMSGW.INI, you are in the right place.

Under that NowSMS directory, you will find Q and SMS-IN directories. If there is no processing defined for inbound messages, the SMS-IN can fill up and cause problems.

The only other idea that comes to mind is the message ID tracking database (primarily used with SMPP). Have you restarted the NowSMS SMS service? At startup, an integrity check and repair are done to make sure these are OK.

I'd suggest enabling the SMSDEBUG.LOG (checkbox on the Serial # page), and restarting the service.

Assuming the problem returns, email the SMSGW.INI and SMSDEBUG.LOG to nowsms@nowsms.com with Attention: Des in the subject line of the email. Also post a reply here to let me know to look for those files.

--
Des
NowSMS Support
Mundos
New member
Username: Coajack258

Post Number: 12
Registered: 05-2009
Posted on Friday, October 10, 2014 - 05:52 pm:   

SMS-IN and Q folders are empty.
SMSGW.INI
SMSDEBUG.LOG
Mundos
New member
Username: Coajack258

Post Number: 13
Registered: 05-2009
Posted on Friday, October 10, 2014 - 05:56 pm:   

SMSDEBUG.LOG
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5070
Registered: 08-2008
Posted on Friday, October 10, 2014 - 06:16 pm:   

Try removing this setting and restart the service

2WaySMSThreadCount=100
Mundos
New member
Username: Coajack258

Post Number: 14
Registered: 05-2009
Posted on Friday, October 10, 2014 - 06:25 pm:   

still the same...
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5071
Registered: 08-2008
Posted on Friday, October 10, 2014 - 06:28 pm:   

Let's see another SMSDEBUG.LOG. Your thread count is very high in the last one...looked more like 2WaySMSThreadCount=1000

I don't see any other settings that would cause such a problem, but before looking more, I think we should see a new SMSDEBUG.LOG.
Mundos
New member
Username: Coajack258

Post Number: 15
Registered: 05-2009
Posted on Friday, October 10, 2014 - 06:33 pm:   

If I remove 2WaySMSThreadCount (default) it is very slow in processing the inbound messages...
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5072
Registered: 08-2008
Posted on Friday, October 10, 2014 - 06:35 pm:   

Let me see the SMSDEBUG.LOG processing more than one inbound message with the default setting.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5073
Registered: 08-2008
Posted on Friday, October 10, 2014 - 06:36 pm:   

How slow, like 1 per minute, or longer?
Mundos
New member
Username: Coajack258

Post Number: 16
Registered: 05-2009
Posted on Friday, October 10, 2014 - 06:48 pm:   

its longer than 1 minute..

The problem here is the high cpu usage in idle state.. why don't you put some sleep if there is no in/out message to be process?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5074
Registered: 08-2008
Posted on Friday, October 10, 2014 - 07:03 pm:   

What you are seeing is not normal. Something odd is happening.

The fact that it is taking more than a minute to process an inbound message without that setting suggests a problem.

Allocating more threads to that task is just burning more CPU time with more threads stuck on whatever this underlying problem.

That's why I want to see the SMSDEBUG.LOG showing this inbound processing ... to try to understand what could be making these requests take so long to process.
Mundos
New member
Username: Coajack258

Post Number: 17
Registered: 05-2009
Posted on Friday, October 10, 2014 - 07:34 pm:   

"What you are seeing is not normal. Something odd is happening."
yes there is really something wrong.. Please try it on your pc and see check it.

FYI: I'm using v2014.06.30 under trial of (20 days)
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5075
Registered: 08-2008
Posted on Saturday, October 11, 2014 - 07:57 pm:   

I've tested, using the same 2-way command, and messages get processed in under a second. (First thing I tried seeing that your config file was quite simple.)

That is why I would like to see the SMSDEBUG.LOG showing more than one message being processed, allowing me to see where the delay is occurring on your system.


--
Des
NowSMS Support
Mundos
New member
Username: Coajack258

Post Number: 18
Registered: 05-2009
Posted on Monday, October 13, 2014 - 08:34 am:   

SMSDEBUG.rar this is for 2 days of debug.. I hope you can find a solution on this problem.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5076
Registered: 08-2008
Posted on Monday, October 13, 2014 - 05:06 pm:   

I don't see any processing delays. Overall it looks like things are getting processed in a timely fashion.

Are you still seeing the very high CPU utilization?
Mundos
New member
Username: Coajack258

Post Number: 19
Registered: 05-2009
Posted on Monday, October 13, 2014 - 05:52 pm:   

yes still 50% while service active..
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5077
Registered: 08-2008
Posted on Monday, October 13, 2014 - 06:38 pm:   

The only thing I can think of is some sort of conflict with a virus scanner. We have seen issues where there was unexplained high CPU utilization because a virus scanner was intercepting all I/O requests. But it was not like you describe, utilization was spiky, not stuck at 50%..and the problems were noticed under heavy load, not during idle.

If you can try temporarily disabling any virus scanner, or at least exclude the NowSMS directory from real time scanning, that would be worth trying.

I will ask our engineering team for more ideas. The only other piece of information that I can think of asking for is a file/directory list. Open up a command prompt window and change the current directory to the NowSMS directory. Then issue the command

dir /s > dir.txt

This will output a directory list of all files in the NowSMS directory structure to a file named dir.txt, and maybe this will show us something unexpected.


One other thought. What happens if you disconnect the modem for a few minutes? Does utilization stay high or does it drop?

--
Des
NowSMS Support
Mundos
New member
Username: Coajack258

Post Number: 20
Registered: 05-2009
Posted on Tuesday, October 14, 2014 - 04:39 am:   

Here is the dir.txt
dir.txt

One other thought. What happens if you disconnect the modem for a few minutes? Does utilization stay high or does it drop? it drops cpu usage to 0-5%
Mundos
New member
Username: Coajack258

Post Number: 21
Registered: 05-2009
Posted on Tuesday, October 14, 2014 - 05:31 am:   

btw, I only have Windows Security Essential running on my pc added my NowSMS dir to the exclude list. Still stay on 50% cpu usage.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5078
Registered: 08-2008
Posted on Tuesday, October 14, 2014 - 08:09 pm:   

Interesting.

I've discussed this and have gone over the files with several different members of the team.

Our consensus is that there is some sort of utilization loop occurring on your system related to modem communications. Even when idle, NowSMS is always checking with the modem for received messages. But it is rare to see any CPU utilization related to this communication.

Based upon this observation, we have run tests with a variety of different USB modems. However, none of these tests were able to recreate the problem described. I noticed you were using a Huawei modem, so we did test several models from Huawei.

All that said there are a few SMSGW.INI settings that might have an effect (all under the [SMSGW] header). Try this one first, and restart the service to force it to take affect:

OldModemTimeouts=Yes

If no difference, try adding:

MinimumReadDelay=100

--
Des
NowSMS Support
Mundos
New member
Username: Coajack258

Post Number: 22
Registered: 05-2009
Posted on Tuesday, October 14, 2014 - 09:29 pm:   

OldModemTimeouts=Yes
solved the cpu usage issue.

Will this affect my 60 messages per seconds license?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5082
Registered: 08-2008
Posted on Wednesday, October 15, 2014 - 01:38 pm:   

Interesting. I've never recommended even trying this setting before. The fact that it resolves the CPU utilization issue suggests a modem driver bug is involved. It may be worth checking the Huawei web site for modem driver updates.

Performance impact of the setting should be negligible.


quote:

Will this affect my 60 messages per seconds license?




I assume you mean per minute as you'd never see throughput of 60 per second on a single modem. Even 60 per minute is a stretch on a single modem.

On average I'd expect this setting to have a 2-3% performance slowing impact on throughput for an individual modem. And that is probably a high estimate.