Posts

Showing posts with the label Optimization

Solving Bin Packing with Powershell

Image
Welcome to another post regarding optimization algorithms in Powershell. Today we're going to examine the Bin Packing problem and a way to solve it using Powershell. Bin Packing is the problem of separating a set of items into subsets, in a way that their size does not exceed a specific value and the number of sets is the minimum possible. As you can imagine, there are multiple applications of such an algorithm in everyday life, such as in logistics (e.g. containers on ships), storage, and even job scheduling. More information on the Bin Packing problem is also available on Wikipedia .   To make things easier for people not familiar with programming languages like C# and Python, I've decided to convert my C# code to a cmdlet that will access Powershell objects and will separate them into groups. The cmdlet is called Get-BinPacking and is available as part of my AdvancedAlgorithms module published on PowershellGallery here , starting from version 1.2.0.0. There are two ways to...

Optimizing IIS server

After searching the web for a while, I found some useful tips for optimizing Microsoft IIS performance. The first thing to do is disable logging for your sites. Since you're interested in performance you have to be on a production server and there's no reason to have logging enabled. One other thing to do is adjust the CPU that every application pool can use. You can even have the server terminate an address pool if it's using to much CPU. You may also set the keep alive limit so you'll have less sessions. I've also excluded the inetsrv directory (located in system32) from antivirus scans. In my occasion there was no need to limit the bandwith for a website since there was no problem with it. You can always speed the server up by improving the overall performance by disabling unused services or excluding application folders from antivirus scans (only when it is absolutely needed, like on MS SQL or Exchange servers).