Untweaked

The ‘performance tweak’ has had to be rolled back – I can’t get the other areas of the code to retro fit without spending considerable effort and that effort is probably better spent on getting the new version out the door – one day…

As such, everything should be back to how it was yesterday before I started playing!

Booyah – but them’s the breaks I suppose.

Update on the 'performance tweak'

The performance tweak I made to the DD codebase WILL have made it look like your diary is missing some entries if you have over 250 entries in your diary. Don’t panic, all the entries are still there and I shall be investigating a better way to ensure that DD can still see all your entries in the calendar/entry list, but not perform like a dog too. I have an idea how to make it work and I’m hopeful that tonight I can implement it properly.

Looking through the logs it would appear that this performance improvement is also responsible for the Internal Server Error issue, which is certainly a plausible idea. With some diaries having over 1200 entries, and each time any page on that diary is loaded the database is being asked for ALL 1200 entries (even if only 1 of them is to be displayed!) then it doesn’t take much of a step forward to realise that the web server is going to become overwhelmed quite quickly – especially when you consider that the loading of 1200 entries is for every request – so if you get 4 or 5 people looking at the same diary at the same time, the server is loading up 4800 entries or more just to service 4 people.

I’m just surprised I hadn’t noticed this earlier – and especially since Matt and I used to go on hunts for big performance bottlenecks in the past and this one should have been found then! Ah well, such is life eh? :)

Performance Improvement – Possible Side Effects

I have discovered an area of the DearDiary code that is hopelessly inefficient, and that is the area that generates the diary Indexes – that’s to say, either the calendar listing or the ‘long listing’ of your entries. To cut a long story hopefully somewhat shorter, the code would ask for ALL entry data from the database for that diary, possibly stretching back of DD’s 6 year history, even if it was only going to display the last 3 months of it. As you can imagine, for the busy diaries with lots of entries, this is pretty awful.

I have adjusted the query to limit the number of entries that DD will look for to 150. This is a hard coded ‘magic number’ which is a coding practise I hate but it is nothing more than a sticky plaster to hopefully Band Aid a somewhat sluggishly performing server of late. This whole area is being radically redesigned at the moment anyway so it’s a temporary fix.

It does possibly mean that your Diary Index isn’t showing you all the months you expected – or appears to have missing entries. There may be side effects to this that I haven’t considered – so if you think you’re experiencing weirdness with your Calendar or some entries aren’t appearing properly on your Index or Welcome page, please drop me a note. I shall try to set the ‘magic number’ at a level where I don’t think anyone will be affected but still give the database server half a chance of sending everything out :)

Thanks for your patience,
Steve.

Impromptu Outage

Hello all, I hope you all had a great Christmas – we certainly enjoyed the break and are looking forward to 2006, which promises to be an exciting year for DearDiary.Net so far!

We had a small outage today where I discovered some indexes (or should that be indices?) on the database that were never used and maintaining them was a lot of extra work for the database. In theory it should speed things up although I don’t imagine it’ll really be all that noticeable to end users, but perhaps it’ll stop the disk thrashing and warming the server room up a little…

We’re enjoying some rare snow coverage and looking forward to the New Year.

Email Posts – Example

Below is an example screenshot of how to post using the e-mail posting mechanism, which hopefully explains things significantly better than I could hope to with words :)

[ Email Posts Screen Shot ]