Virtual server hosting - resource usage tuning

Share on FacebookI recently worked on deploying a web application to a virtual server hosting package from 1and1 Internet. To be specific, the virtual server home package.

The package advertised 250MB of RAM and 5Gig space among others. This was during the early stages of 1and1 offering this product for the microsoft platform. It was not long before the hosting company increased the allocated memory on the VS to 352MB. The system depletes all its memory allocation before an attempt is made to run the smallest of programs.

So, well I deployed our web application and found out to my horror that the server uses all its resources (typically memory) in the first 10 minutes or so just after the web application is restarted or the server is restarted.

I kept monitoring processes to find out which process was responsible for the sporadic memory usage spikes.

I found three main culprits: These were sql sever (Desktop edition), asp.net worker process, plesk task schedules.

A bit of googling led me to an article which explained the need to cap sql server memory at a limit of 28MB, otherwise sql server quickly starves other programs of memory when running on virtual servers where memory resource is a high premium. So yes, first thing, limit how much memory sql server uses, there are many ways of doing this, by sql command or user interface program such as management studio express. I used management studio express and right clicked on the server object, selected properties, and then the memory item listed in the LHS pane. There is a setting captioned "maximum server memory (in MB). You can set this to a value dictated by your application so as to limit memory consumption by the server.


The asp.net worker process running the web app was also consuming so much memory, so I had to launch IIS and since I was using the defaultAppPool, right click on the application pool and select properties.
I then set various properties to make sure the process does not allow too many concurrent users and also to recycle memory over shorter intervals.

In my unique case of 1and1 VS hosting, there were scheduled tasks for the plesk interface installed on the VS. Some of these tasks were set to run daily and some weekly. If you look  in the scheduler, you will find them listed. Since memory on the VS is so limited, It is recommended to disable plesk if you can use Remote Desktop Connection and are familiar with windows server admin. So there is no reason for scheduled plesk tasks to be running if you are not using plesk, so what I did was to expire all the task, ie. set the end date to a past date.

After doing these three things I restarted the server and the web application was running a lot more smoothly. I verify resource usage with the virtuozzo control panel and was amazed to see the resource usage drop from the high 92-99% yellow colour to 36-66% olive colour.

I cannot pin point exactly what helped solve the problem, but these three steps I believe contributed to the solution, so if you are facing a similar problem, well you could begin with the above three. If I find any other contributors, I will revise the post and include them. I am not an expert in virtual server performance tunning so if you find some naive statements here, please do not hesitate to offer your comment. I know I haven't been precise in the solution instructions, but that is because I am writing this from memory at home and don't have access to the exact steps I took.
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListkick it on DotNetKicks.comTwitThis

Comments

Comments are closed

About Me

When not scratching my head for solutions to software challenges, I spend my time playing with my little boy - Michael Jnr.

Quotations

"Anger is never without Reason, but seldom with a good One."
Benjamin Franklin

Donate with PayPal - it

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2005 - 2010

Search