Windows PageFile Settings on VMs
Posted by CGregP@reddit | sysadmin | View on Reddit | 55 comments
I've read so many conflicting best practices on this topic, so I'd just like to hear your real world practices.
Our current practice, inherited from years past before I worked here, is to set it to system-managed on a separate drive which is 1.5x memory. From what I can tell, this was done for two primary reasons
- Easier to exclude from backups
- No risk of filling the system drive if the page file size gets out of control (I recall running into this problem on occasion years ago)
What are y'all doing with your Windows Server page files on your VM builds?
Nexzus_@reddit
I haven't thought of page files in like 25 years.
Pineapple-Due@reddit
Put the page file on a ram disk! Infinite memory glitch!
Nexzus_@reddit
Don't forget to install RAM Doubler.
theEvilQuesadilla@reddit
Installing unverified shit like this is EXACTLY how you get malware, genius! Just stay safe and download all the RAM you need.
TheFluffiestRedditor@reddit
Ram Doubler was a fully proper commercial product. Twas never an unverified malware
vinetari@reddit
I paid for the pro version and got tripple the ram
bobsmagicbeans@reddit
Downloading RAM like a boss!
BillSull73@reddit
Just last year a friend of mine was so excited to tell me a story. Was having issues with a bunch of engineering department laptops and through looking at some logs found an old GPO that was setting the page file to double the RAM size. He was like "Hey do you remember when we used to do this?". Smiling the whole time.
svv1tch@reddit
The exact reason I clicked. Reliving my youth!
Mountain-eagle-xray@reddit
I set them to 8gb static. It get set as part of deployment automations.
Why do we set them? Absolutely no modern reason outside of the age old guidance for protecting disk space.
You could probably get away with not caring since ram availability is much higher, and software actually touching page file is declining to basically nil.
devs born after 2000 probably dont even know what this is.
buzz-a@reddit
If your server has enough ram it doesn't need page file.
We leave all the settings default on 99.9% of vms.
SnakeOriginal@reddit
DCs have page files mandatory. Dont ask me why, but I found out through recent MSFT documentation :)
doubleUsee@reddit
In general it's a good idea to have a page file on any windows machine, I don't recall details, but I recall that you get real weird issues with software if there is no page file at all.
picklednull@reddit
It’s not about having enough RAM, inactive memory is paged out.
BrentNewland@reddit
Page file is also needed for crash dumps.
And if you have a program go crazy and eat up all your RAM, page file might just save you.
sryan2k1@reddit
That's not actually true.
im-just-evan@reddit
Very enlightening! Contradict the man without even the tiniest iota of information to support your assertion.
CGregP@reddit (OP)
Crash dumps, for one, require an appropriately sized page file. It's not just about memory. How to determine the appropriate page file size for 64-bit versions of Windows - Windows Client | Microsoft Learn
TaliesinWI@reddit
Y'all leave crash dumps turned on on VMs?
CGregP@reddit (OP)
Wait...are y'all disabling them?
TaliesinWI@reddit
Like someone else said, I think I've found a crash dump useful exactly once, and that was back in the days of bare metal.
If I have a guest OS crashing on a hypervisor I'm looking at what the hypervisor is telling me. And I can't think of the last time a Windows guest BSODed on VMWare or HyperV.
aMazingMikey@reddit
I've been supporting servers since 1996 and I've used a Windows crash dump exactly once.
Brandhor@reddit
pagefile is used to create the bsod minidump so it's better to have at least a tiny pagefile
but also even if you have enough ram it's always possible that a program will occasionally use more memory and so it's better to have a pagefile rather than let everything crash
hurkwurk@reddit
I set OS drives to 250GB these days for servers. I do not want to think about issues as we move Server versions considering i have servers that have been upgraded from 2003 to 2022 and from 20gb to 250gb drives during the same window.
We stopped managing swap files once server ram exceeded 8gb or systems became VMs. on a VM, there is literally no reason to manage the swap. the system settings will do it for you and the VM tools driver will integrate to it to manage things properly.
the only place we even consider swap management is our SQL servers because they have direct SAN disk presentations, so we dont want disk activity for active things causing issues. so for the 3 back end cluster members, the swap is moved to a dedicated disk presented for that purpose and the size is locked to be 100mb larger than the ram (256gb in our case) so that if we ever needed to recover a full memory dump, we could.
all non-critical VMs have a fixed swap size of 4GB.
picklednull@reddit
The system managed size doesn’t really work at all. Especially on busy RDS servers. It’s best to set it to some static size based on the machine’s specs and load (e.g. 8 GB page file with 8 GB memory).
The disk doesn’t really matter unless you want to spread the I/O around or disk space is an issue.
Stonewalled9999@reddit
we do a 16GB static pagefile on an RDS worker that has 24GB RAM and its been working pretty well. Our SAN is all spinning disk and performance is acceptable for us
CeC-P@reddit
We didn't feel need to performance tune it because just always assigned enough RAM to each VM that the page file stayed super small in recent Windows OS builds. And I performance tune EVERYTHING. It just never really came up. Now that I read your post, I'm reconsidering though, as that does make sense. But I don't think we'd save much and it'd make recovery potentially complicated. If we're ignoring an entire partition then have to restore from a backup without that partition, I assume Windows would move the page file back to C: but not 100% sure.
Stonewalled9999@reddit
It will dump a temp pagefile and C:\ and cry about the missing drive. TBH it's not that hard to drop a dummy vdisk in if you restore but also if you only restore the c:\ the other drive the pagefile is on should still be there after the restore.
picklednull@reddit
Have you ever actually set up monitoring to monitor its usage? The
\\Paging File(*)\\% Usageperformance counter shows it clearly.thomasmitschke@reddit
Didn’t looked at the page files since Windows XP/Server 2008R2 Modern Backup Software (Veeam) excludes those files automatically (with a tick of a checkbox)
jwalker107@reddit
Just about every backup application out there automatically excludes the page file anyway. In fact there is a Registry key that defines a bunch of files that should be ignored by backup software, and Windows automatically adds the page file(s) there, however many there are and whatever drives on which they reside.
Stonewalled9999@reddit
If its a VM and you snap the drive thought you still have the overhead of snapshotting the IO for the pagefile - so if you want to micromanage another drive would be fine. Most of my VMs are scaled so they don't page much (think like 2GB pagefile to shut Windows up) - for bigger servers I do its own drive with 64K cluster.
jwalker107@reddit
Excellent point
admiralspark@reddit
We do 128gb drives for C:, and if it's running a DB or anything needing space, put it on a separate drive. So many reasons esp with virtualization to not waste time stuffing it all on C:.
Funkagenda@reddit
I don't know why we do it this way, but our standard for VMs is installed memory + 10MB. (So 16GB of RAM means a page file of 16,394MB).
Professional-Heat690@reddit
W2k3 recommendation, some orgs never changed.
Master-IT-All@reddit
That's for the memory dump feature. You need to have just a bit more page file than you do memory.
CGregP@reddit (OP)
"I don't know why we do it this way..."
Ha, I empathize. There are things I've inherited from past admins that, unless I have the time to really dig into and research them, I take a "Chesterton's fence" approach to leaving them in place.
Fit_Prize_3245@reddit
If you configure it correctly, the pagefile will always have the same size.
I understand the part of a separate drive, which is a pretty good idea, so when you backup the OS drive, you won't be including the pagefile.
However, 1.5x memory seems too much for me. If you need that much paged memory, you desperatelly need more real memory. Usually, up to 0.5x memory should be OK.
Curious201@reddit
i would not put pagefile on every vm out of habit, but i also would not disable it everywhere just to save space. for normal windows servers i usually leave a small system-managed pagefile unless there is a specific reason not to, because some apps, crash dumps, and weird memory pressure situations still expect it to exist. the bigger issue is that pagefile is not a replacement for sizing the vm correctly. if a vm is actively paging, performance is already in a bad place and you should be looking at ram pressure, ballooning, host overcommit, app leaks, and monitoring data. for critical servers, decide what kind of dump you actually need, set the pagefile accordingly, and document the exception. for generic app servers, keeping a modest pagefile is usually less painful than rediscovering later that some vendor app or dump collection needed it.
Master-IT-All@reddit
128GB is the standard OS size for an Azure VM. Seems to work fine. I used that value for decades too.
hosalabad@reddit
I just manage ram. The page file bits are going to move to flash.
Bu22ard@reddit
I hope this is AI trying to fill in its gaps for current recommendations. Like everyone else, haven’t thought about it in decades. Linux swap partition is a different story tho
pdp10@reddit
2x memory size is a fairly ancient BSD recommendation and unnecessarily large, but on the other hand, flash is abundant on non-embedded instances.
pdp10@reddit
If memory is right-sized, then there should be a relatively low amount of paging.
We only use Windows Server for testing, so our use is very ephemeral, but our latest template says one 40G virtual drive.
Dry_Ask3230@reddit
We're tight on space so my standard is setting page file as a range from 1GB - 2GB on OS disk. If a VM is trying to use a lot of page file I think the better solution is to just give it more RAM instead. I make exceptions for VMs that 'require' large page files like SQL and Exchange.
Expensive_Plant_9530@reddit
I have not touched or even thought about the page file or its settings on a windows server in years.
Just… leave it alone unless there’s a specific need you’re addressing.
Hangikjot@reddit
Haven't thought about page file in a long time, leave it system managed. OS drives are setup as dynamic 127gb. Even on the VMs with TBs of ram.
Sroni4967@reddit
i usually just set it to system managed unless the vm has specific memory constraints
dracotrapnet@reddit
No page file tuning unless vendor app says so. Even then I question it. Too many are used to small shops that will buy a desktop pc to run their application on so they will ask for the max you can buy at best buy.
hoagie_tech@reddit
Using Windows defaults here too. You should be excluding the page file at the back up job level if it’s not automatically being excluded with your backup solution already.
Stonewalled9999@reddit
I set the cluster to 64K on my page file drive as well for my bigger SQL/worker servers.
Smith6612@reddit
On Windows I leave it all to the system managed setting. The last time I honestly did anything with the page file was back when 32GB and 64GB SSDs were bleeding edge, and you absolutely needed to spare the things from writes.
DeadOnToilet@reddit
Leaving the default settings well enough alone.
itishowitisanditbad@reddit
Not even thinking about it for at least a decade, tbh.
I couldn't even guess what the settings currently were.