Knowledgebase: Cloud VPS - Windows
Controlling VPS Memory Usage (Windows)
Posted by Helpdesk Admin on 09 November 2010 12:59 PM
Although a VPS is much like a dedicated server, you are typically paying for a smaller set of resources than would be present on a full-blown dedicated box. A typical VPS will have between 768 and 2048MB memory available, although some packages can have much more than this. The amount of memory represents the maximum amount of memory that your VPS can use and allocate. This limit consists of three parts. Firstly, there is a guaranteed amount of physical memory that your VPS is always able to access which is never less than 50% of the overall limit. The remainder of memory usually also be provided from physical RAM (usually all memory is physical except in the unusual situation where all VPS's on the same machine are using close to their maximum in which case the available non-guaranteed memory is distributed evenly and the remainder is provided from swap).

As Windows applications are notoriously memory hungry, it is important to keep an eye on memory usage, particularly on a smaller VPS running IIS and/or SQL Server. 

The most important method of checking memory usage is your VPS control panel (VZPP). You can access this under the VPS management link in the hosting section of your control panel. The resources menu item will display current usage of RAM, Disk and CPU resources. It will also show any logged alerts - a warning (Amber) if memory or another resource was low at any time, and Error (Red) if memory allocation failed at any point. Memory warnings are not unusual, because some applications will allocate more memory than they need but will free it if other applications need it (IIS and SQL server are very good examples of this). However, a pattern of memory errors usually indicates either that an application is misbehaving, or that you need a larger VPS.

You can also use the task manager (Start-> Run -> "taskmgr" from your VPS desktop) to view current processes & their memory usage. You should also periodically check out the Application & System Event logs (Event Viewer) for memory errors or low memory warnings.

To use memory efficiently and make the best use of your resources, keep the following points in mind.
  • By default SQL server will over allocate memory, usually much more than it will ever need. You can tell SQL server to limit its overall memory usage to a specific amount. We recommend setting this initially to 256MB as it is usually only very busy sites or applications with large datasets that benefit from additional application.
  • If you are running multiple IIS websites, avoid using individual applicaton pools as each will incur an additional overhead. Use application pool recycling to place upper limits on the memory use of each process, and schedule regular recycling to free up memory especially from badly behaved applications.
  • If you are short of memory, avoid using multiple RDP sessions to access the VPS, instead connect to the console session and kill off other sessions. Also, avoid using memory intensive tools such as SQL Server studio when memory is short - if you need to do run reports or perform regular database maintenance, consider connecting externally to the database.
  • Avoid having slow loading pages or excessively long queries on your website as this will cause requests to queue and increase memory usage at times of high traffic. Instead, consider pre-accessing or caching regular queries or content.
If you anticipate high traffic at any time, you should increase the resources of your VPS well in advance. Because VPS resources can be purchased on a monthly basis and usually provisioned in minutes without restarting your site, you can scale up and down to match seasonal requirements without worrying about long-term contractual commitments.
(222 vote(s))
This article was helpful
This article was not helpful