MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Website is using 100% CPU  (Mono Support )

Viewed 9853 time(s), 22 post(s) 5/4/2016 3:24:40 PMby super
khorvat

khorvat

5/9/2016 11:56:51 AM
Too many files in folder is not related to MonoX but to NTFS, so do you have a large amount of files in the Log folder ?

The following error seems to happen to often:
2016-05-07 18:53:24,920 [37] ERROR MonoX [BaseHttpApplication] - Application Error
System.Web.HttpException (0x80004005): This is an invalid script resource request.
   at System.Web.Handlers.ScriptResourceHandler.Throw404()
   at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContextBase context, VirtualFileReader fileReader, Action`2 logAction, Boolean validatePath)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

It happens every 100-400ms and this could potentially flood your log files and Log folder causing the NTFS to be slow while accessing the folder, can you please check ?

Also do you have SQL server running on the same machine as Web ? 


Regards 
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

5/9/2016 4:36:20 PM
@Khorvat,

so do you have a large amount of files in the Log folder ?

Yes, I have 2393 files so far. I am using MonoX as-is without any customization so I don't know why there are so many errors. This could be the issue for 100% CPU usage? If yes, if I delete the log files, you think it will resolve the issue?



Log folder causing the NTFS to be slow while accessing the folder, can you please check ?

How can I check this? Please advise on the steps that I should perform to test this.



do you have SQL server running on the same machine as Web ?

Yes - Is this a wrong approach? I can only afford one VPS and I always had all my sites on same server as SQL server. What is recommended for ASP.NET websites with SQL database? 

I have a number of sites running on my VPS and all sites have SQL database (on same VPS server / machine)

This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

5/10/2016 5:43:25 AM
Hi,

2k files is not large number, 80k or 100k is so this isn't causing CPU issue, do you have RDP access to VM ? If so can you please confirm that w3wp.exe  process (IIS application pool) is the source of 100% CPU usage ?

It is not wrong to have SQL and Web mixed on small startup projects but be aware that SQL will consume CPU and memory and will slow down everything, especially on this kind of small VM.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

5/11/2016 12:24:27 PM
@khorvat, yes my app pool for the site is using all the resources. The CPU usage is always 100%.The hosting tech support restart the IIS to free resources but it does not solve the problem. It is only a temp fix because the CPU usage goes up again after some time and remains 100%.

Can you please recommend any solution? 

This is exactly what my hosting provider tech support is telling me:

The CPU usage in your VPS is 100% and RAM usage is 93 to 95%. Most of the resources are being used by IIS process. Checking the further, I noticed that ASP.NET 4.0 application pool was using most of the resource. This application pool is assigned to your site.
 
Most of the resources are being used by ASP.NET 4.0 application pool which is associated with your website. We request you to involve your webdeveloper to identify which  of the script/code is chewing up the CPU and RAM resource as high usage is being consumed by website itself. Any of the script/plugins (if any) must be causing the issue.
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

5/12/2016 3:18:41 PM
What we suspect is that the following error "This is an invalid script resource request."  is constantly happening and for some reason causing 100% CPU usage. We didn't have any similar issues with MonoX and 100% CPU usage. 

Can you let us know how big is your database, can you please provide row counts per table ? It's very hard do help you when we are in the dark and can't access your Web site.

Regards 
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

5/16/2016 9:33:32 AM
@Khorvat,

Please see the attached information (i  tried my best to capture all possible info):

- Usage 
- Usage 2
- SQL DB size
- SQL DB properties
- SQL DB Rows (all tables)
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

5/17/2016 12:53:50 PM
Hi,

thanks for the screenshots it seems to us that something inside the app is consuming a lot of memory alongside the CPU. Did you turn on Full text search on the database, as this will give you performance (probably not related to this issue) ? What exact version of MonoX are you using ?

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

5/17/2016 1:06:16 PM
I am using MonoX "as-is", no customization - Version v4.9.40.4906
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

5/17/2016 1:22:39 PM
If I can recall that version had two issues that are fixed in 5.1.x and they are related to Blog comments regex validation and server side code regex parsing. In order to fix this issue you will need to upgrade to 5.1.

Let us know if you need more information about upgrading to latest version.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

5/18/2016 1:33:37 PM
Hi Khorval - But, we are not discussing the blog comment issue here. We are discussing the issue regarding 100% CPU usage.

Regex issue should not cause CPU usage (Regex issue can be considered as an issue in the monox feature or functionality but not something that should use 100% resources). The above comment for upgrading the website doesn't seem right and it involved a lot more work to upgrade to another version and I might end of with same issue if regex is not causing the CPU problem.
This content has not been rated yet. 
6018 Reputation 709 Total posts
1 2 3