Tag: performance tuning

  • SQL Server Performance Tuning with SSD drives

    SQL Server Performance Tuning with SSD drives

    Recently when explaining to a student the basics of database design and the need for primary keys, foreign keys and indexes generally, I fired up SQL/Server 2012 and typed in a few simple examples on my laptop.

    A very brief summary of this is that you need primary keys to uniquely identify rows in a table, and you use foreign keys to link to primary keys in other tables. Additionally an index must be specified on each foreign key (if you use it as an access method rather than just referential integrity). You can also specify additional indexes unique or otherwise as you see fit, taking into account your access methods (paths) and also being careful not to get too carried away with indexing due to insert performance and space considerations.

    So I set up a simple example with a couple of tables, customers and orders. I then used Red Gates SQL Data Generator 2 to generate a million rows in the tables because the first time I tried my laptop was taking less than a millisecond to return the data and the times were coming out as zero.

    So to repeat the tests with more data: I then started off with a table scan, tried to access via a unique id (without a primary key defined) and compared the timings, so far so good.

    When I tried to access all customers whose names begin with “A”, I got 70,000 returned in a quarter of a second or so. It was doing a table scan. When I added an index to customer name, the times increased by about 25%. The only explanation I have is that because my laptop uses dual Samsung 256GB SSD’s, data access is so quick anyway, using an index results in more IO and hence slower access.

    I need to do some more work here to understand whats happening here. Expect future blog posts on this subject.

     

  • WordPress on Linux vs Azure

    WordPress on Linux vs Azure

    Although I’m a .NET developer, and I haven’t used the LAMP stack for a number of years, when it came to creating this blog, there was no choice other than WordPress. Its well established, quick and easy to set up a WordPress blog, and this can be polished and finished off with little effort and the help of carefully selected plugins.

    Having an Azure account, I couldn’t help but consider how Azure compared to Linux for running WordPress. Microsoft is clearly putting a lot of effort into Azure and the latest versions of ASP.NET, and Azure is coming on leaps and bounds as a result.

    I was pleased to see that setting up a MySQL database is now a lot easier in Azure, with an unlimited number of free MySQL databases available through ClearDb. You can also run WordPress in multi site (if you run more than one site like I do) and share the same database, although I haven’t tried that.

    I set up some example sites on Azure and Linux. The Azure sites were real Azure sites, not on a VM.

    The first thing I noticed was the email needed setting up on Azure. Using the Swift Mailer plugin and SendGrid, this was easy to set up so that forgotten password and other emails could easily be sent (SendGrid provides a SMTP server for emails – this appears to be a good service that I’ll consider using and recommending for other websites, not just WordPress ones).

    There were a couple of themes that didn’t work properly, so I would say WordPress on Windows from my limited experience is about 99%.

    The one thing I did note though, is that performance was far superior on my shared Linux account in Germany than the North Europe Azure in Ireland. The startup times and also the response times when editing pages was markedly different – Azure took a few seconds and the Linux sites were instant. I’m guessing its not the MySql databases either, but I could be wrong there. So I’m staying with Linux for the foreseeable future.