Umbraco, memory. How to find the cause? - asp.net

Since two weeks we have a problem with one of our websites, in „rush hours” (Analitycs shows ~170-200 people in real-time) it consumes all available memory (16GB). Normal state is between 2-3GB allocated. Memory growth isn’t constant, sometimes is very rapid, like 4-16 GB/2 min, another time growth is gradual. This behaviour looks the same on both of our servers (Server1 and Server2).
Server configuration:
Traffic between public internet and the actual application servers is being handled by haproxy, currently all traffic is directed to Server1, if Server1 stops responding traffic goes to Server2 (active –backup configuration). Website database (MSSQL 2008 R2) is placed on Server3. On Media server we store all files from application virtual /media folder. That server is powered by Linux and no problems here.
Server1, Server2, Server3 are VMs placed on one physical machine (Linux Debian KVM, latest version of libvirt from backports, machines are rock-stable, especially the DB Server). Media server is a physical storage machine.
Server1:
OS – Windows Server 2012 Standard
CPU – 8x2GHz
RAM -16GB
IIS8
Server2:
OS – Windows Server 2008 Web
CPU – 4x2GHz
RAM – 4GB
IIS7
Common things for both servers:
Site is based on Umbraco 4.7, .net 4.0. Media folder is connected as „network location”
physically placed on Media server (Linux Samba 3.x). In database we have about 25000 nodes.
We observed that website intensively use connection with Media server (up to 200Mbit/s).
We have changed the URLs so that media requests no longer pass through IIS.
Website was moved beetwen Windows Server 2008 and Windows Server 2012, yet the problem remains.
We thought that problem lies in the code, so we rolled back all the changes since last month (using our code repository), that didn’t solve the problem though.
We already have used programs such as DebugDiag and Ants Memory Profiler
http://imageshack.us/a/img823/8151/p4performancemonitor.png
http://imageshack.us/a/img838/2319/p4tasks.png
How else can we check where the problem lies?

Here are some things to check for that I've used when I've had memory issues in the past with Umbraco sites:
1) Is the site using Linq 2 Umbraco in the code anywhere? This has quite a few problems with memory usage, especially under heavy load, so it's possible that this could be the cause of your problems. If you are using it, look at your code for inefficient Linq queries, and consider replacing the code with something using the Node API or XSLT instead.
2) Is the site running any custom .net code that uses the Document API on the front end? In general this can be pretty slow and resource intensive, and should be avoided if possible on the front end (back office is fine).
3) Check any other custom code for potential memory leaks or inefficient use of resources.
4) Have a look through the old issue logs for Umbraco (can't find a link at the moment, sorry!), that should give you an idea of whether you're experiencing a known issue with that particular version of Umbraco. If it is, you may need to upgrade (which may or may not be a major hassle depending on your Umbraco setup).
Hope that helps!

Related

Running SQL Server & IIS on same Windows server without making site go slow

I have a dedicated Windows 2008 Server with 32GB RAM & Intel Xeon E3-1230 v2 processor and SQL Server 2008 (Standard Edition).
There's a heavy data import & cleaning process i.e importing data from CSV files which runs daily and whole process takes about 8-10 hours.
My problem is that ASP.NET MVC website which is hosted on this same sever gets slow for small periods during that import process. Most of the time, it runs fine, but in between, the site will become unresponsive and slow. The import process doesn't touch the database which the site uses.
What are the options for me to ensure my site runs smoothly throughout?
is it even possible to achieve, keeping in mind some very resource-heavy operations get performed during the data import on the same server?
The import process is a Windows application which uses SSIS packages to import data and after that runs server SQL Server stored procedures.
Ankit quick solution for your problem is to have 2 VM on your dedicated hosting server. One one VM you can host your website and another VM you can host you database and import process.
From performance perspective it is case by case as your problem is very generic and broad so community can't help but tip still you can follow.
For your website create separate application pool.
You can assign min and max CPU and memory utilization for your processes like import, IIS etc based on your need.
Check clock speed;whether it is matching between your processor and virtual memory. It doesn't matter how much virtual memory you have you need your RAM in sync with you processor cores.
As SQL Server Standard version supports max 4 cores of processors. Check how much cores you have in your dedicated server.
I have got some really good ideas from the community for my problem. Having two Virtual machines is a very good one but it's restricted by my lack of knowledge on the topic. Solution proposed by Anil in comments in also a good one that we can two seperate SQL Server instance and use Resource governor to restrict resources but for that we'll have to first upgrade to enterprise edition which is not feasible for us at the moment.
So keeping the cost in mind, we have decided to try Varnish. Plan is to get a separate Linux VPS and set Varnish there. Window Server will be the backend for Varnish. As once the data is prepared by our import process, our pages stays more or less static, I think we'll do good with this.

FoxPro sometime doesn't find files in the LAN

Sometimes a visual FoxPro App doesn't find files in a FileShare, which are there.
for example when checking in a loop File() on a existing file on a Network share about 5% of the tries don't find the file.
This works on most machines but sometimes it doesn't work. In the curren scenario I've a Windows Server 2K8 as file server (perhaps a SMB2 issue?)
I would patch your 2K8 server to SP1 (and any Windows 7 clients too), this will take care of any SMB2 issues. Those issues were around CDX index file corruption, though.
It's also possible that this is due to the caching that SMB2 uses, which can produce 'File Not Found' errors. The client registry settings involved are:
FileInfoCacheLifetime
FileNotFoundCacheLifetime
DirectoryCacheLifetime
There is a discussion regarding this on Alaska Software's website, and a useful MSI installer which can be run per workstation to adjust the settings. This company produces a product called Xbase++ but I would guess it is close enough to Visual FoxPro in terms of low-level file IO and locking.
Not positive if its an issue of Fox, or your network. Going way back in time, I had a client that had problems somewhat similar. Took Foxpro out of the equation and just used Windows Explorer and it would hang for a moment. It ended up that their network cards were set to energy saving mode and would basically time-out / shut down due to inactivity. The network drive share would apparently be released. Until the network card would re-connect and get established again, they had issues. By changing so the network card NEVER went into energy save mode, problem went away for them.
Yes. I have versions of fox pro deployed on various different servers, with various versions of windows server and never experienced an issue as described.
Maybe you could try a similar test using a different programming discipline, .Net , access, Ruby ...., etc
Post you test loop, just out of interest ?

System.Data.OracleClient requires Oracle client software version 8.1.7

I have the same problem as the poser of this question:
System.Data.OracleClient requires Oracle client software version 8.1.7
I have made the changes to the security settings on the oracle folder, and have to wait for the server to reboot overnight.
My question is why is this reboot necessary? I am getting the same error after making the changes without rebooting, so I don't doubt that it is. Is there an alternative to rebooting the server, like IISRESET? (Although I wouldn't be allowed to run IISRESET during the day either)
Perhaps not an answer to your specific question, but for the record it is for this kind of reasons that I always favor Oracle Instant Client :
You don't have to install anything on the target machines (including dev boxes !). So no tricky manual setup and goat sacrificing.
You can make sure that your application will run with the specific client you picked (version, x86/x64).
You could even easily have multiple applications work with different client versions on the same computer.
As a downside, it adds a significant weight to your application (~19Mb minimum), and you can't participate in distributed transactions.
If you still can switch, this is the way to go IMHO. Check What is the minimum client footprint required to connect C# to an Oracle database? for more information.
Starting with Server 2003 (hosting IIS6) it is enough to restart the service to bring environment changes and security changes into effect.
But this is done with iisreset. What is not allowed too.
Thats a pity, I see no other way as wait.

Local SQL Express for ASP.NET/Sharepoint Development?

In your development environment, do you install a local SQL express or a dedicated SQL server? What are the pro/con's of these two options?
From my own experience so far:
Local installation slows down the own development workstation due to resource consumption
Local installation is easier to debug/manage
Dedicated installation eases central administration (backup, etc)
What are your personal experiences and suggestions?
I think it really depends on how busy you expect the app to be & any cost restrictions (number of boxes, rack space etc.). If it's a low traffic inter / intranet server I'd be inclined put them on the same box. If the SQL was a small part of a busy web server, separate them. If you encapsualte them well enough then the deployment differences are a matter of configuration, rather than re-coding. ie. Code for both eventualities.
SQL Express can only use 1GB of RAM & a 4GB database - it will get only-so busy.
Local is useful when working on a laptop/from home where don't have access to a network.
Also useful when want to work on isolation from other developers and not worry about someone elses work on the same database / other activities on the server slowing you down.
I work on the server but use a local instance for the above cases

Can Windows Web Server 2008 be used to host games?

I'm currently using a linux server, we run a couple of web sites of it, PHP apps with MySQL, the usual. Since the server is privately owned by some friends and myself (we do have it hosted at a professional datacenter though), from time to time we also use it to host our smallish counter-strike source and call of duty 4 matches by running the released dedicated game server packages.
I've recently subscribed to DevExpress' excellent WinForms and ASP.Net component suite, and is contemplating moving to Windows to make use of those ASP.Net components. I'm currently trying to decide between the Web and Standard editions of Windows Server, since there is a difference of nearly a thousand bucks (where I come from)
For Windows Web Server 2008, Microsoft has softened the database server restrictions and made it clear there is no need for CALs. But would one be able to run the above mentioned web servers? I've been googling and searching through forums to no avail.
Need some help before I plunk in the cash.
Thanks.
Before I give any opinion, I'll start by answering your core questions:
Yes, you can run dedicated game servers on Windows Server Web ed.
The differences between web and standard:
Web only supports 2 gigs of ram. Standard in 64bit mode can support 32gigs (and more?).
Standard comes with more things that are better suited to local server environments (eg: active directory). If you want LDAP controlled Exchange email, you'll need Standard. Most web server don't need these.
Web (apparently) won't support full-on SQL server versions. Express should run though.
Opinion time.
Dedicated and virtual dedicated monetary overheads on Windows servers are a lot... To the degree where you're paying more for the software than the hardware costs, at least for the first year.
Renting the software (as part of a managed dedicated server or VPS) is initially a lot cheaper, but over the course of a couple of years, will cost you about the same and if you run it longer, it'll eventually cost you more.
Shared Windows hosts can be good. I've been with a company called Hostek (Florida-based) and they've bent over backwards to make hosting a fairly busy site (around 6000 uniques a day) very cheap for me. It can also be atrocious. I've had bad hosting companies too. Shop around.
About a year ago, I dropped Windows at home in favour of Linux. I'm not going to enumerate the many benefits and drawbacks; I'll just tell you that that's when I stopped doing .NET in favour of more open Frameworks. I'm not using Django (a Python-based web framework). While you might not like it (or other frameworks - eg Ruby on Rails), I plead that you do check out what's happening in the open-source world before you plonk for anything Windows related since you already have the infrastructure available for hosting Django/Rails/et al.
If you wanted your own Linux server, VPSs start from around $20pcm. As I said before, severely cheaper than Windows counterparts. I now use Linode to host everything new I make. Highly affordable and they'll easily run dedicated games like your current set-up does.
Mono isn't an option for you. Not yet anyway. It does go some length to help people migrate their applications but it's still pretty sketchy on the ASPNET front. And as a comment says on another answer: the controls you want to use are strictly Windows-only for the moment.
Linux will consume fewer baseline resources than Windows will. On an old server (Windows 2000, IIRC) I had to administer, the core of Windows would consume anywhere from 100-200 megs of RAM. My current Ubuntu server eats 40megs. I'm not sure how much RAM you have to play with on your server but if it's a lower amount, you're going to fit a lot more on a Linux host. (Remember that if you have more than 2gigs, you don't have the choice of the Web Server edition)
It's clear from this that I'm a complete Linux super-enthusiast, but I know my needs differ from yours. ASP.NET is a great platform but it costs a lot of money even if you're splitting it between friends. You could opt for Windows... Or you could go Linux, donate a bit to the projects you use and buy a new plasma or something shiny for the lady.
SPLA? Isn't that for service providers? My friends and I use the hosted services for ourselves (games, email and web), though of course our web sites are publicly viewable by all; but I think that hardly qualifies as "providing a service"?
Unfortunately, staying with Linux would make it such that I would not be able to use my DevExpress components, which is my reason for considering Windows Server in the first place. .NET may be partially supported by Mono, but not fully, and DevExpress makes use of certain features of .NET that aren't (at least as yet) supported by Mono.
We also already own our own dedicated server, so are only looking for a suitable OS.
Still, your reply is appreciated.

Resources