Are there any logs I can check in IIS maybe something is throwing errors? I have the same on my VPS also which is a little problematic since it doesn't have that much ram.
Have you checked how much RAM is allowed for the app pool / .NET in general. It doesn't have to be a memory leak - if .NET haven't reached the maximum RAM allowed it could continue to consume until it have to release memory (logic of the garbage collector).
@Lee Kelleher: Nothing in the Event Viewer that looks weird. In the Umbraco log the last 25 entries are Logheader: Open, Open, ... I guess that's normal?
@Niels Hartvig: Would that be app pool > Advanced Settings > Recycling > Virtual Memory Limit?
app pool > Advanced Settings > Recycling > Virtual Memory Limit : 80000 seems to work okay. Not sure how snappy the back-end is between recycles but didn't notice anything bad. It also looks like it starts up a second process and kill the first one so that's maybe why performance doesn't drop?
It seems when you set a virtual memory limit I get: "System.Web.UI.ViewStateException: Invalid viewstate." in between recycles. So I guess setting a virtual limit is a bad idea?
I guess that means I have to find a different solution for my original problem? I was wondering am I the only one with this memory problem or is it just bad configuration of my IIS? Each time you click on a node or load a page on the front-end the memory for w3wp.exe process goes up by 2mb.
I have the exact same issues with my Umbracosites (other sites including wordpress does not show the same behavior). Every node consumes an unbeleiveble amount of memory for the w3wp-process (a few mb per node).
Have been struggling with this a couple of months without any success (read most memoryrelated posts about umbraco). The sites keep consuming memory until the server craches with an OutOfMemory-exception. Only thing so far is to buy more memory...
My sites hosted on a virtual server running windows 2008 (IIS7), 1,5GB memory at the moment (one site on this machine that works, the site has about 300 nodes), the site uses ImageGen (version 2.0.1) with big images a lot (maybe thats the bad guy?).
Finally took some time to try and fix it. I think the invalid viewstate is caused because I am on a VPS (not 100% sure). So I googled some and found you can specify a machinekey in your web.config.
So to summarize this is what I did:
- Right click the app pool of the Umbraco site - Advanced Settings > Recycling > Private Memory Limit(KB) > 80000 (I guess 80k is enough?) - In your web.config > system.web > add a machinekey On this website you can generate one: http://aspnetresources.com/tools/machineKey So your web.config should look like this:
Not a server admin, but machineKey is already specified in machine.config, so you shouldn't really be gaining anything by adding it to web.config. The only time you should have to mess with it is if you're doing load balancing and need it synched up on two different machines. Since a VPS is really still an isolated machine with it's own machine.config, it shouldn't be the culprit. That said, I've frequently seen this error on single web servers and I've never been able to do anything about it. It's always fairly rare, so difficult to troubleshoot.
I know how to replicate the error. If you set the memory to like 80k and then go to the backend click on some node. Then you go to the front-end and you click around until the memory reaches 80k. Next you see an other w3wp.exe process started and the old one gets killed because the app pool recycles. If you then go back to your back-end and publish that node it will throw the viewstate error. I think this happens because the viewstate and server are out of sync?
Problem is that if the process is reaching 80k all the time you can't publish anything because the viewstate and server are out of sync the whole time.
Not sure what to do really. Maybe I am doing something completely wrong. Now it's just me visiting 2 websites but one is going public real soon and I am a little afraid it will be even worse.
That actually makes sense. I do remember in the past setting the app pool to recycle in the middle of the night to avoid it randomly doing it during business hours. That might keep it from growing too large over the course of a couple of days. I've got some sites using quite a bit of memory as well, but I've just throttled down sql (same server) and bought more memory.
Really depends on the content. A quick survey this morning - one site with probably 5,000 nodes is using 650MB. Other sites with a couple hundred nodes are using anywhere from 50 to 250MB. Keep in mind that preview on the new version might load an entire new copy of the xml into memory depending on which node you preview.
I've run into a very similar situation and wonder what the underlying
problem and best solution is. We have just launched two new websites on a new
Umbraco 4.5.2 instance, running on .NET 4 on a 64-bit Windows Server 2008 R2
platform, with 4 GB RAM and dual Xeon 3.16 GHz processors. Both sites are
small, with only about 20 nodes each. But memory and CPU usage on the server is
really high, and the sites are a little slow to respond. And on a machine that
isn't running anything else - SQL server is on a different server - that just
doesn't make sense.
We initially added the new 4.5.2/.NET 4 Umbraco instance to the same web
server that runs our first Umbraco 4.0.4/.NET 2 instance and another 9
websites. Website performance plummeted, so we took the 4.5.2 instance and
moved it to a new server. To our astonishment the same problem is occurring. I
could not figure it out at all, but after some sleuthing I installed the
Microsoft ProcessExplorer - http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
- and it shows the w3wp.exe process with a "virtual size" of 2.8 GB.
I've created a dedicated application pool for the Umbraco instance and set it to
recycle once a day - during the middle of the night to avoid problems for
users. The Windows Task Manger does not show the "virtual size", it
shows "Memory (private working set)" at around 90 MB, which is less,
but not that far off of what the ProcessExplorer shows for "Private
Bytes" (134 MB) and "Working Set" (154 MB).
Does anyone have any insights or solution to this problem?
w3wp.exe - memory usage 4.5.2 .net 4
Hello,
I notice when I use the back-end of Umbraco for a while the w3wp.exe is using a lot of memory. The max so far is 700mb after a couple of hours.
Anybody maybe know why this is happening? I am guessing it's not normal.
Are there any logs I can check in IIS maybe something is throwing errors? I have the same on my VPS also which is a little problematic since it doesn't have that much ram.
Try the Windows' Event Viewer ... see if there are any ASP.NET exceptions in there?
Have you looked at the Umbraco logs in the database? (in the "umbracoLog" table) - or try installing the Log Manager package?
Cheers, Lee.
Have you checked how much RAM is allowed for the app pool / .NET in general. It doesn't have to be a memory leak - if .NET haven't reached the maximum RAM allowed it could continue to consume until it have to release memory (logic of the garbage collector).
@Lee Kelleher: Nothing in the Event Viewer that looks weird. In the Umbraco log the last 25 entries are Logheader: Open, Open, ... I guess that's normal?
@Niels Hartvig: Would that be app pool > Advanced Settings > Recycling > Virtual Memory Limit?
Honestly can't remember - luckily for the stability of the Umbraco.org / Our Umbraco websites I'm no longer the server guy :-D
app pool > Advanced Settings > Recycling > Virtual Memory Limit : 80000 seems to work okay. Not sure how snappy the back-end is between recycles but didn't notice anything bad. It also looks like it starts up a second process and kill the first one so that's maybe why performance doesn't drop?
Useful thread on memory usage here too FYI http://our.umbraco.org/forum/getting-started/installing-umbraco/4148-Squeezing-more-sites-onto-a-dedicated-server?sort=newest
Rich
It seems when you set a virtual memory limit I get: "System.Web.UI.ViewStateException: Invalid viewstate." in between recycles. So I guess setting a virtual limit is a bad idea?
I guess that means I have to find a different solution for my original problem? I was wondering am I the only one with this memory problem or is it just bad configuration of my IIS? Each time you click on a node or load a page on the front-end the memory for w3wp.exe process goes up by 2mb.
I have the exact same issues with my Umbracosites (other sites including wordpress does not show the same behavior). Every node consumes an unbeleiveble amount of memory for the w3wp-process (a few mb per node).
Have been struggling with this a couple of months without any success (read most memoryrelated posts about umbraco). The sites keep consuming memory until the server craches with an OutOfMemory-exception. Only thing so far is to buy more memory...
My sites hosted on a virtual server running windows 2008 (IIS7), 1,5GB memory at the moment (one site on this machine that works, the site has about 300 nodes), the site uses ImageGen (version 2.0.1) with big images a lot (maybe thats the bad guy?).
Possibly not related but ensure you've installed the fix for a bug in that version of imagegen http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/2982-[UPDATE]-Fix-to-caching-bug-in-201
Rich
Fix, installed already. Don't know why it sais 2.0.1 in the packades-section...
Finally took some time to try and fix it. I think the invalid viewstate is caused because I am on a VPS (not 100% sure). So I googled some and found you can specify a machinekey in your web.config.
So to summarize this is what I did:
- Right click the app pool of the Umbraco site
- Advanced Settings > Recycling > Private Memory Limit(KB) > 80000 (I guess 80k is enough?)
- In your web.config > system.web > add a machinekey
On this website you can generate one: http://aspnetresources.com/tools/machineKey
So your web.config should look like this:
This seems to be working. If there are any server admins out there who can give more input on this issue I would appreciate it.
Not a server admin, but machineKey is already specified in machine.config, so you shouldn't really be gaining anything by adding it to web.config. The only time you should have to mess with it is if you're doing load balancing and need it synched up on two different machines. Since a VPS is really still an isolated machine with it's own machine.config, it shouldn't be the culprit. That said, I've frequently seen this error on single web servers and I've never been able to do anything about it. It's always fairly rare, so difficult to troubleshoot.
I know how to replicate the error. If you set the memory to like 80k and then go to the backend click on some node. Then you go to the front-end and you click around until the memory reaches 80k. Next you see an other w3wp.exe process started and the old one gets killed because the app pool recycles. If you then go back to your back-end and publish that node it will throw the viewstate error. I think this happens because the viewstate and server are out of sync?
Problem is that if the process is reaching 80k all the time you can't publish anything because the viewstate and server are out of sync the whole time.
Not sure what to do really. Maybe I am doing something completely wrong. Now it's just me visiting 2 websites but one is going public real soon and I am a little afraid it will be even worse.
That actually makes sense. I do remember in the past setting the app pool to recycle in the middle of the night to avoid it randomly doing it during business hours. That might keep it from growing too large over the course of a couple of days. I've got some sites using quite a bit of memory as well, but I've just throttled down sql (same server) and bought more memory.
What kind of memory usage should I expect from an Umbraco site?
Really depends on the content. A quick survey this morning - one site with probably 5,000 nodes is using 650MB. Other sites with a couple hundred nodes are using anywhere from 50 to 250MB. Keep in mind that preview on the new version might load an entire new copy of the xml into memory depending on which node you preview.
I've run into a very similar situation and wonder what the underlying problem and best solution is. We have just launched two new websites on a new Umbraco 4.5.2 instance, running on .NET 4 on a 64-bit Windows Server 2008 R2 platform, with 4 GB RAM and dual Xeon 3.16 GHz processors. Both sites are small, with only about 20 nodes each. But memory and CPU usage on the server is really high, and the sites are a little slow to respond. And on a machine that isn't running anything else - SQL server is on a different server - that just doesn't make sense.
We initially added the new 4.5.2/.NET 4 Umbraco instance to the same web server that runs our first Umbraco 4.0.4/.NET 2 instance and another 9 websites. Website performance plummeted, so we took the 4.5.2 instance and moved it to a new server. To our astonishment the same problem is occurring. I could not figure it out at all, but after some sleuthing I installed the Microsoft ProcessExplorer - http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx - and it shows the w3wp.exe process with a "virtual size" of 2.8 GB. I've created a dedicated application pool for the Umbraco instance and set it to recycle once a day - during the middle of the night to avoid problems for users. The Windows Task Manger does not show the "virtual size", it shows "Memory (private working set)" at around 90 MB, which is less, but not that far off of what the ProcessExplorer shows for "Private Bytes" (134 MB) and "Working Set" (154 MB).
Does anyone have any insights or solution to this problem?
is working on a reply...