Archive for März, 2009

Cligs Stability: History and Fix

Montag, März 23rd, 2009

As regulars would have noticed, Cligs hasn’t been doing well with respect to uptime lately. Firstly, big apologies for that. Cligs has been growing at a rate faster than I was able to deal with, and I could have pre-empted this kind of growth given the hints that were coming in back in January.

Secondly, and that’s what I want to talk about, is that the source of the instability has been identified and, I believe, fixed. Although the fix has been uploaded and is live and working, I need to do a bit of a clean-up before the server is completely stable.

The clean up will take a few hours, probably overnight, and while it’s going Cligs might be a bit slow. Rest assured that once it’s done, I think we’ll be all set. I’ll be keeping an eye on this of course, and will intervene if something doesn’t look right.

What follows now is very geeky so please feel free to stop reading :)

What’s the source? Cligs runs on Ubuntu, which is based on Debian Linux. Debian has a very strict security premission setting for the directory PHP stores its session files; by default that’s /var/lib/php5. The side-effect of the security settings is that PHP itself can’t clean up the directory with stale sessions and so the Debian solution is to run a "garbage collector" cron job that once a day does the cleanup.

All fine and good until you get a very popular service that generates session files faster than the garbage collector can deal with them. This triggers a cascade in which the cleanup takes longer and longer chasing down more and more session files. It takes up significant memory and uses up the processor: on Cligs, one of the 4 CPUs on the server has been constantly in use by this cleanup process!

This run-away scenario has another side-effect: the more files that accumulate in the directory, the more time it takes PHP to find the right session file. This slows down access significantly (seen as doubling the latency from ~200ms to 400+ms) and slows down Apache. This cascades more as each Apache process would need more memory and more time to work, which uses up more resources, which squeezes other processes themselves wanting more resources, and you know how this ends.

Which brings us to today’s fix: I’ve changed the way the core of Cligs works to generate fewer session files - don’t ask, we live and learn and think about things differently :) But that still leaves the directory with lots of session files. That’s what the cleanup is doing: clearing out the stale session files to get the server back to a clean start.

Keen readers would note that I’ve talked about this very exact problem before. Back then I talked about a full fix which was working until recently. That’s how it goes: you live to go down another day.

DNS Issues

Donnerstag, März 19th, 2009

This morning I started getting reports that Cligs has been hacked or hijacked. It’s fixed now, but might take a few hours for you to see the fix. This post details the problem and the fix.

The Problem

As Cligs is a very important site, it’s set to auto-renew every time the domain name cli.gs is nearing expiry. This mechanism failed and I was not notified by my registrar that it failed. Actually, I’ve been getting automated emails from them over the past few weeks saying it will renew, with the most recent being 2 days ago.

But fail it did, and the registrar put the domain up for deletion and changed the DNS to its own server. The effect of this is that cli.gs would end up forwarding to an advert laden site that (presumably) my registrar controls. This triggered the reports from users saying the site has been hijacked.

The Fix

Quite easy really: manually renew the domain name, which I’ve done.

I also took the opportunity to give the poor support guy a good earful about how rubbish this system is. Not once did I get any notification that the auto-renew failed and I was not notified that the domain was put up for deletion. This poor showing is inexcusable and I’ve filed a formal complaint via the tech support guy. Not sure if it actually got filed…

So anyone know of a good .gs registrar? I need to move away from this kind of service.

Updated Posting to Twitter Feature

Dienstag, März 10th, 2009

A minor but very useful tweak for today: When you post a clig to Twitter, the title of the clig is now automatically embedded into the tweet, along with the clig URL itself.

Why is this useful? Imagine this scenario: you find a page you’d like to tweet about, so you click the Cligs bookmarklet, and then click the Twitter link. With this new addition, you simply edit the text of the tweet instead of copy/paste or otherwise compose the text.

Let me know how I can improve the feature more!

Announcing Cligs-Powered White Label Short URLs for Your Business

Dienstag, März 3rd, 2009

Today I’d like to share with you one of the most exciting developments in the Cligs service that I’ve been working on for a while: White label, i.e. custom branded, short URLs powered by the Cligs technology. This launch marks our partner, UK start-up Twitblogs, going live with their own Cligs-powered URL shortner.

Service Description

In summary: you point a domain name to an IP address of a dedicated server that hosts a completely branded, customized, and fully managed copy of Cligs.

Some details:

  • You own the domain name and it is completely brandable by you; it can even be a subdomain from your main website.
  • The server runs the service just for you - it’s dedicated - and it’s design is also completely brandable for your business. The result is total integration between the short URLs and your business. If the main Cligs site is not available for any reason, your service will not be affected.
  • It’s a for-pay service: you pay for the server costs which depend on your level of traffic, plus a management fee. While the service is being developed over the next few months, the management fee is zero.
  • You can choose to run the standard version of Cligs or you can specify changes to the functionality. This customization can cover anything really; for example, you can choose to append Google Analytics tracking codes into every destination URL automatically. Minor changes are free and we can discuss your requirements for more drastic changes.
  • The service comes with support and service level agreements. I personally will help you and your team integrate the service into your business processes.

This is a new service and obviously it will evolve. The key point right now is that the service is here and it’s ready for your use.

If you think a custom-branded short URL service could be useful to your business, please get in touch. Email me the details/background and we’ll set up a phone call to discuss details and requirements.

The Twitblogs Case Study

So what does such a service look like? Let’s take a look at Twitblogs, our launch partner.

Twitblogs is a blogging service built on top of Twitter. When you write a blog post with Twitblogs, it automatically gets tweeted with a link to the full post. Twitblogs wanted to have the link branded, and so they registered twitblo.gs. The service at twitblo.gs is the short URL service that is powered by Cligs.

I asked Sam Sethi, co-Founder and CEO of Twitblogs, to explain in his words how he sees the white label Cligs service helping his business:

Without Cligs twitblogs could not exist. We needed a short url partner whose API could enable our service to go live. In Pierre Far we found not only a technically smart CEO but someone who was prepared to be a true partner and understand our business needs.

Today we have a branded solution - twitblo.gs - that is powered by Cligs and in the future we will work together to offer our users a high degree of analytics to better undertand who clicked and shared their Twitblo.gs URL

To any application developer I would recommend without hesitation to work with Cligs and Pierre Far

To see it in action, simply sign into Twitblogs (using your Twitter account details) and write a post. The post title will be sent to Twitter with a link back to the full post using twitblo.gs.

Get in Touch!

So please get in touch and let’s talk: your brand will thank you for it! The fastest way to contact me is via the contact form.