Outage report; or, the perils of using 502s to trigger web application initialisation

Last weekend, we had two outages, both in the early hours (UK time) of the morning; we were finding it hard to diagnose the cause, because our outage alert system had failed and we only discovered it in each case when someone happened to check their email. On Monday we fixed the outage alert system.

Yesterday we had another, every phone in the office started beeping loudly, and we logged in right away – so we know what made it happen. While we’re not 100% sure that the cause of this problem was the same as the one on the weekend, the symptoms were similar enough that we’re pretty sure that it was.

The symptom in all of these cases was that the main PythonAnywhere website was down, giving “502 Bad Gateway” errors. Over the weekend, all of the customer websites we checked were OK, but when it happened yesterday, we noticed that one specific customer website was extremely busy, and getting the same 502 error. Further investigation showed that it had been linked from the front page of Reddit and was getting about 100 hits/second. So that would explain why it was so busy – and the site’s author hadn’t expected so much traffic so soon, so it was not super-optimised, which would explain why it couldn’t handle the load.

But the question was, how was it affecting the main PythonAnywhere site? We have a lot of stuff in place to stop web applications from affecting each other, which is why the other user websites on the same server were up and running.

Explaining what happened requires a little background, both about how nginx works and about how we use it and uwsgi to serve large numbers of Python web applications.

Read more…

New release :-)

We’ve just released a new version of PythonAnywhere. This is a scheduled release of a set of new features, and is not related to the weekend’s outages (which are still under investigation, hopefully we’ll have more information soon!).

The new stuff is:

  • We’ve upgraded our Python 3 version from 3.2 to 3.3.
  • Bugfix: if you quick-start a web2py app in a directory that is not ~/web2py, the admin password will now be correctly set.
  • Improved UI on iPads – you can now hide the space that we reserve for the on-screen keyboard, which is useful if you’re using a Bluetooth keyboard, or are just monitoring a log file.
  • New packages: R, RPy, gettext, geventhttpclient, npm (yes, that’s right – node.js on PythonAnywhere – you can’t run a node server yet though), PyStemmer, mysql.connector, asciidoc.

Thanks to all of the people who suggested these fixes, including marladarla7, pigeonflight, pwoolcoc, gebloom, djfinton, chanin, markstocks, jpic, ezamr, and Kernie_xvid.

Outages over the weekend

Over the last weekend we had three separate outages; it appears that something on one of our servers was rapidly increasing the memory it was using and took down the main PythonAnywhere website. The majority of our users websites were unaffected.

We’re investigating the problem and will post again with an update.

New release - more console stability improvements, unicode fix

Today’s new release features:

  • a fix to the file browser unicode bug. This was a regression whereby non-ascii characters in filenames caused problems. Shame on us! fixed now.

  • I’m counting chickens here, but we may have fixed one of our resource leaks, which means we should need to restart console servers less often. That should mean that your console sessions can stay live for longer

  • Improvements to load-balancing between console servers.

  • and finally, a bugfix that was causing errors in “Reload Web app”.

Thanks to everyone that’s been pestering/encouraging us to get these fixes and features in, and people who’ve reported bugs, including a2j, in4paschenko, btccharts, web2pyslices, lmsmodule , nim4n, SignumSol, viralto, hardsoft, xdanyelo, afinney, rudi, tanay009 + sansoftaus

Keep in touch!

WEBAPP ALL THE THINGS!

Map of the internet

Well, it’s been weeks and weeks and weeks, but we’ve finally (finally) managed to get a version of MULTIPLE WEBAPPS out.

This is a soft launch, so all you avid blog and forum readers are finding out about it first. We’d love your feedback! Is it working OK? Can you break it? What should we improve?

Read more…

Calling all LaTeX experts...

LaTeX Lion

We’ve just released a new version of PythonAnywhere which features a full suite of LaTex executables, available for you to run, in a browser, in our Bash consoles.

We’ve been experimenting with this for a couple of weeks, and we’ve had people in floods of gratitude, saying “YES! Never again will I have to install LaTeX! Thank you thank you thank you!”.

So, perhaps it’s of use to other people out there, even outside the world of Python?

Read more…

Faster file creation and saving

Hi all,

We deployed a new version this morning. The visible changes are

  • a speed up of file creation and file saving. This means that all of the most pressing issues around the file browser performance have now been fixed
  • The Python mimetypes module now works correctly

Progress on multiple web apps is looking good. We are rewriting the last couple of ‘Quickstarts’ right now.

Cheers

Even-even-fasterer file browsing and editing, woo

We’ve just released a new version with some more improvements:

  • browsing files a tad faster
  • opening files for viewing + editing much faster
  • saving files still slow

We’ve also added a few packages:

More improvements on their way - speeding up saving files is next, and we’re back to work on finishing multiple webapps, so hopefully that won’t be long either.

Keep your feedback and suggestions coming!

Faster file viewing

We’ve just pushed an updated version of PythonAnywhere! The biggest change this time around is that browsing through directories in the “Files” tab is much quicker.

Some background: in the older version of PythonAnywhere, every time you browsed a directory, we launched a new process that ran inside your sandbox. This gave us great security pretty much for free – as the file view was running in your sandbox, it was certain that you couldn’t see anyone else’s files. The problem was that as more and more people started using PythonAnywhere (yay!) more and more processes were being launched, and it got slower and slower (boo!). So we’ve had to bite the bullet and code our own secure sandboxed file browser. The first cut of this, which just uses the new system for browsing directories, is what we’ve just released. We’re also working on using the same technique for viewing, saving and editing files – that’s coming soon.

There have also been a couple of minor tweaks: head and ping are now available from Bash consoles, and user web applications can now accept requests of 32kB, up from 4kB (which was too small for, in particular, web apps that wanted to use OpenID).

New release - a first crack at scaling issues

Hi all,

As many of you know, we’ve been having some scaling issues in the last week or so. This new release is our first crack at addressing them.

Read more…