April 16, 2007

Some Quick Notes About Caching

The caching module is designed to keep the most frequently requested pages in memory so that they can be served more quickly.  Every time you request a page, the server first checks if it already has a copy in the cache.  If it doesn't, it creates the page from the templates, and then saves a copy in the cache - possibly pushing an older page out of the way to do so.

Pages live in the cache for a limited amount of time, currently 120 seconds.  They are automatically flushed (removed from the cache) after certain events; leaving a comment on a page, for example, will flush that individual page.  And pages are never cached if you are logged in, so you will never see an old copy of a page while you are maintaining your site.

The real benefit of the cache comes in when you get a link from a high-traffic site like Slashdot, Fark, or Instapundit.  The main page of my blog currently takes around 400 milliseconds to generate (it has a lot of comments...) Once in the cache, it takes just 3.5 milliseconds - over 100x faster.  You can imagine the difference that would make to the server if I got 10,000 visitors in the space of an hour.  Typically the performance gain would be somewhat less than that, in the range of 20x to 60x, but still definitely worthwhile.

If you log out and reload a page a couple of times, you'll see that the system actually tells you that it's coming from the cache, so you can keep an eye on this yourself.

Posted by: Pixy Misa at 08:06 AM | No Comments | Add Comment
Post contains 274 words, total size 2 kb.

Update Schedule

I'll be applying a number of smaller updates this week, beginning with Tuesday 17th, again at 6AM GMT.  None of these updates should cause any more than a minute or so of downtime.

Update: April 17th update done.  This puts in place several minor fixes, and the new sorting and selection options for the [posts] tag.

Posted by: Pixy Misa at 07:21 AM | Comments (7) | Add Comment
Post contains 57 words, total size 1 kb.

Update - April 16th

Okay, the update that was held over from yesterday is now in place.  Here's a brief description of what's new; I'll be running tests to make sure that everything made it okay, then post some documentation.

New Features

Caching Module: The system now caches pages in memory as they are created.  If additional requests for a given page arrive within the timeout period (currently 120 seconds), the page will be served directly from the cache rather than generated by the template engine. 

The purpose of this is to improve the handling of situations where a high-traffic site - Slashdot, Fark, Instapundit, Drudge Report - links to a site or page on mee.nu.  Fetching a page from the cache can be 20x to 60x faster than re-creating it from the templates.

I'll post more details on the caching system in the Docs section shortly.

Archives: Simply by appending /archive/year/month to any folder-level request - your main index, for example, or a category page - you can get an archive for that folder.

So mee.nu/archive/2007 will show all the news for 2007, and mee.nu/archive/2007/4 will show the news for April 2007.

Templates: BBCode and smilies are now supported in your templates.  This can be set as an option on each template.

Video: New BBCode tags for Google Video, LiveLeak, Jumpcut, Vimeo, Revver and Heep.

Wiki and Search Links: New BBCode tags for Wiktionary, TVTropes, ThePPN, Google, Technorati and Sourceforge.

Bug Fixes and Minor Changes

  • The search function now works. It was actually searching properly, but not displaying the results due to a problem in the standard templates. (7), (165)
  • Spurious timeouts when uploading large files should no longer occur.  Please report back to me if this still happens to you. (145)
  • No error is generated if you don't specify a file for upload.  You will simply be redirected back to the upload page. (133)
  • If you clicked in the More editor, but didn't enter any text, the editor would generate an invisible line break, which would cause the more... link to appear on your page.  This no longer happens for new entries, but you may need to re-save your old entries. (140)
  • The page generation data shown at the bottom of many pages has been simplified. (158)
  • The pager (the widget that allows you to move from one page to the next) and the page generation data now follow the pager and pageinfo CSS classes, and no longer have any embedded styling or positioning. (146)
  • Converting images to GIF format no longer produces a low-quality dithered image.  A new image filter, Dither, has been provided if you want to use this effect. (120)
  • Several fixes have been made to improve the set of tags for posts, comments, and topics, and bring them into line with the documentation. (164)
  • Fixed issues with relative paths for images added using the editor. (163)
  • Mixed case supported in filenames. (161)
  • Image and video tags only allowed in comments by registered users. (136)
  • Syndication feeds now work correctly for categories and other subfolders. (166)
  • Corrected issues with conditional tags: handling of undefined variables; handling of numeric zero; else case with multiple conditions in template. (131), (177), (179)
more...

Posted by: Pixy Misa at 02:37 AM | Comments (4) | Add Comment
Post contains 549 words, total size 7 kb.

April 15, 2007

That Was NOT The Scheduled Outage

Sorry about that, folks.

Our main server cluster is hosted at the Softlayer datacenter in Dallas.  Yesterday (as I understand it), the DFW area was suffering severe thunderstorms, and our hosting company switched to their own generators in preparation for this, in case the power went out.

Well, the power didn't go out, the thunderstorms passed, and they switched back to utility power.  And then a 2500 amp circuit breaker blew, taking down most of their operation.

We've recovered now; I had to repair the database, but that's completed, so we should be back to normal.

However, because the unplanned outage ran over my planned outage, I'll have to reschedule that.  It's now set for the same time tomorrow: Monday April 16th 6AM GMT.  Downtime should be less than 30 minutes, assuming we don't get any more tornadoes.

Posted by: Pixy Misa at 06:23 AM | Comments (1) | Add Comment
Post contains 144 words, total size 1 kb.

April 13, 2007

Scheduled Outage - April 16th 6AM GMT

I'll be applying another code update this Sunday, April 15th 16th, at 6AM GMT.  This also involves updating a number of the standard templates.  This should only take five to ten minutes, but please allow for an outage of up to half an hour.

This update will fix a number of minor issues like the timeout problem when uploading large files, add some features including archive pages, and bring the post and comment tags properly in line with the documentation (rather important, that one).

Posted by: Pixy Misa at 06:07 AM | Comments (2) | Add Comment
Post contains 91 words, total size 1 kb.

Working With Custom CSS - Part 2

[Part 1]

There's a second way to work with custom CSS - use the template engine.

There are two steps to this:

First, create a folder. Give it a type of "Style" and a name that you find appropriate - let's say "Default", since this will be your default CSS. Set the path to be something like "css/mystyle.css", or "css/mee.nu.css" if you don't want to change your Header template just yet.

Set the index template and page template both to Style.Default.

Make sure that it's not marked private! If you mark a folder as private, only you can access its contents - which is not a good thing for your CSS files (unless you want to try out a new design, in which case it's ideal).

Save your new folder.



Now create a template. Set the type as Style and the name as Default. Make sure you set the content to "text/css", or you may have problems.

Now, just put your CSS code into the template. Make sure it's marked as active. Save it, and you're done!



The advantage of this method is that you can use template tags, including conditional tags, in generating your CSS. The downside is that because the CSS is generated dynamically, it won't be cached by the browser, so your pages will appear just a little more slowly.

Posted by: Pixy Misa at 02:43 AM | Comments (1) | Add Comment
Post contains 228 words, total size 2 kb.

April 12, 2007

Item.Comment - Standard Template

Current version.  This will be changing slightly this weekend, to reflect the updated software: The [comment.iphash] tag will become [comment.ip.hash].
more...

Posted by: Pixy Misa at 03:18 PM | Comments (1) | Add Comment
Post contains 35 words, total size 1 kb.

Posts

[Note: This documentation is for the updated version of the system that is in testing right now.  Some features documented here may not work correctly just yet. The new version is expected to be available by the end of Sunday, April 15th.]

Quickly
View posts.

Usage [posts {paged|unpaged} {page=n} {count=n} {skip=n} {show=all|publish|draft|pending|expire|user}  {sticky|unsticky|nosticky|stickyonly} {sort=posted|updated|title|comments} {order=asc|desc}]
[posts:here {template=type.name} {options}]

Type block tag, here tag

Data Fields

Text Fields

title, subject, text, keywords, more, memo, meta, misc, abstract, excerpt, notes, custom, tags, reply, warn, mod
{.raw|.esc|.text|.clean}

Info Fields

data, xml
{.raw|.esc|.text|.clean}

Date Fields

date, time, datetime, shortdate, day, month, year

create.date, update.date, start.date, end.date, comment.date, ping.date
[.date|.time|.datetime|.shortdate|.day|.month|.year]

Status Fields

status, type, category, comments, pings, edits, reads, locked, allow.comments, allow.pings, allow.attach, sticky, hidden, defer, expire, flag, ip, ip.hash, filter, number, even, odd, mod.[3|4|5], bytes, kbytes, words, first, last

Display Fields

show.html, show.bbcode, show.smilies, show.macro, show.dict, show.sig

User Fields

author.name, author.nick, author.mail, author.web, author.aim, author.msn, author.yim, author.icq, author.location, author.occupation, author.interests, author.sig, author.hash

ID Fields

id, tid, pid, fid, etid, cfid

Category Fields

category.name, category.desc, category.path, category.nospace

Sub-tags [1]

[post:comments]
[post:pings]
[post:attachments]
[post:links]
[post:images]
[post:stats]
[post:categories]
[post:folders]
[post:sites]
[post:next]
[post:prev]
[post:first]
[post:last]


[1] Sub-tags aren't working yet, but these are the ones that will become available for posts.
more...

Posted by: Pixy Misa at 02:47 PM | Comments (7) | Add Comment
Post contains 134 words, total size 4 kb.

Bug Update

I still don't have a fix for the bug that occasionally causes the application to fail, but I do have a workaround.  I will be running multiple copies of the application so that if any one instance fails, the other copies will take up the load until the failed instance can be restarted - which should happen within a matter of seconds.

I'll be putting this in place tomorrow; unfortunately the change itself requires a brief outage, so the system will be unavailable for up to 5 minutes from Friday 13th April 2:00 GMT.

Right now - you may have seen a brief hiccup - I have put a new and more reliable automatic restart script in place.

This should give us a more stable system while I track down the problem.

Update: The change is in place - five minutes early.  We now have load balancing and automatic failover between three copies of the application.

Posted by: Pixy Misa at 10:19 AM | No Comments | Add Comment
Post contains 158 words, total size 1 kb.

Item.Post - Standard Template

Latest version.  It's a bit untidy, but I'll get it cleaned up soon.
more...

Posted by: Pixy Misa at 03:35 AM | No Comments | Add Comment
Post contains 102 words, total size 2 kb.

<< Page 10 of 13 >>
30kb generated in CPU 0.4429, elapsed 2.901 seconds.
32 queries taking 2.8909 seconds, 83 records returned.
Powered by Minx 1.1.6c-pink.