![]() Other notes: no need to create a unique folder for every user since every time a Windows app wants to throw some stuff into a temp folder, it calls the "GetTempFileName" Win32Api function, that generates a unique file name. The above command creates the folder and grants "Everyone" full-control permissions. Icacls Z:\TEMP /grant "Everyone":(OI)(CI)F bat file or a startup job in TaskScheduler that creates the folder and grants permissions to, say, "Everyone": mkdir Z:\TEMP\ Startup script: the temp folder should be re-created every time you start the server, so make sure you have some. Open regedit, go to HKEY_USERS\%userid%\Environment for every user, and change the location. ![]() Make sure you change "user-variables" for all user accounts on your server, including system users like "MSSQSERVER", "SQLSERVERAGENT" etc (because - yes - these accounts write stuff to temp-folders too). Then open "Control Panel" - "System and Security" - "Advanced system settings" - "Advanced" - "Environment variables" - and set the TEMP and TMP variables in both "system variables" and "user variables" sections. Adjust your environment variables (both user-specific and system-wide) to point to a folder on the instance-store drive.Ĭreate the Z:\TEMP folder. PART 1: Data that is safe to move to instance/ephemeral store Tmp/Temp Folder While these tricks are Windows-only, clearly there are ways to "port" it to any stack, LAMP/RoR etc.These are just standard Windows commands you can paste into a. That is why every "performance trick" has a "startup script" paragraph below it. ![]() Because all the data is lost after restart - you will need a startup script, that will re-configure all the prerequisites on the ephemeral drive (like, configuring permissions, creating directories, etc.).For the sake of this tutorial let's assume your ephemeral drive is on Z: drive-letter.Obviously, these tricks require an "instance-type" that comes with an ephemeral drive.Obviously this means we can move only temporary data that we don't need to persist to an ephemeral disk. Simply because after restarting your server - it runs on a different physical machine across the hall. losing all your data forever when your EC2 instance is restarted (as in "stopped and started again", not as in "rebooted Windows"). The only little downside of using ephemeral drive is. Which is exactly what "instance store" is - a local SSD drive. etc.) but EBS will never be as fast as a local SSD drive that literally lives inside your server, inches away from your CPU. Amazon keeps coming up with performance optimizations every now and then (like introducing the "Provisioned IOPS" model, "EBS-optimized" network adapters, etc. To put it simple, EBS is just a network drive that lives on different hardware than your server. Why would you do that? Because EBS drives are slow as fuck are the EC2's biggest performance bottleneck. And not just on Windows - on any platform. You can move the "temp" folders, TempDB database, page file, IIS logs, mail pickup folders, transaction logs etc. You can get a significant performance boost by moving some of your stuff from EBS to "instance-store" (aka "ephemeral storage"). Here are some I/O performance hacks I came up with when trying to optimize our Amazon EC2 instances on Windows ![]() Say you have a pretty general Windows server, that runs Microsoft IIS (webserver), MS SQL (database engine) and probably some basic stuff, like SMTP, SSH etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |