<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>PythonAnywhere News</title><link>http://blog.pythonanywhere.com/</link><description>All the latest updates from the PythonAnywhere team</description><atom:link href="http://blog.pythonanywhere.com/feed/" rel="self"></atom:link><language>en-us</language><lastBuildDate>Mon, 13 May 2013 16:10:55 +0000</lastBuildDate><item><title>The story of brer programmer and the tar-pit</title><link>http://blog.pythonanywhere.com/64/</link><description>
&lt;p&gt;We're experimenting with different ways of balancing resource usage between our users.  One problem we've been experiencing is that individual users could quite easily suck up almost all of the CPU power on a console server.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;cgroups to the rescue!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We've set up some &lt;a href="https://wiki.archlinux.org/index.php/Cgroups"&gt;cgroups&lt;/a&gt; at:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/cgroup/cpuacct/users/$username
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/cgroup/cpu/user_types/anon (150)
/cgroup/cpu/user_types/free  (300)
/cgroup/cpu/user_types/paying (700)
/cgroup/cpu/user_types/tarpit (2)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The cpuacct cgroup lets us keep track of how much CPU time each user is using.  Then we use the cpu cgroup by setting a value called &lt;em&gt;cpu.shares&lt;/em&gt;, the figure in brackets above, which defines what relative proportion of the processor the user is allowed, at busy times. &lt;/p&gt;
&lt;p&gt;We then set a daily allowance for each user type -- currently, 100 seconds for free users, 5000 seconds for Hacker users, and 20,000 seconds for Web-Developer users.  When a user goes over their daily limit, we move the into the tarpit.  We then reset the counters once a day (at different times for each user).&lt;/p&gt;
&lt;p&gt;The tarpit is used by the scheduler when the server gets busy -- so, if no-one else is using the server, you still get 100% of the CPU.  But, once there is contention, your jobs will start to run much more slowly.&lt;/p&gt;
&lt;p&gt;It's not a perfect solution, and sometimes we find ourselves needing to straight-out kill user processes when they're causing trouble for others (that only happens rarely though).  But at least now, users will have some kind of visible warning that they're exceeding their resource allocation.&lt;/p&gt;
&lt;p&gt;There's more info at &lt;a href="https://www.pythonanywhere.com/tarpit/"&gt;www.pythonanywhere.com/tarpit/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We're keen on feedback!  What do you think of this system? How would you improve it?  What is it like, from the user's point of view?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Mon, 13 May 2013 16:10:55 +0000</pubDate><guid>http://blog.pythonanywhere.com/64/</guid></item><item><title>Using PythonAnywhere in Chrome's App mode</title><link>http://blog.pythonanywhere.com/63/</link><description>
&lt;p&gt;Using Vim inside a PythonAnywhere console could be a bit annoying. A number of keyboard shortcuts are caught by the browser before they ever hit our site. Notably for Vim these include Ctrl-W and Ctrl-T. &lt;/p&gt;
&lt;p&gt;But there is a better way! And it involves making Chrome open PythonAnywhere in it's special application mode. In this mode absolutely none of the keyboard shortcuts are captured. It's neat. Which is my reserved way of saying that it fixes EVERY problem I've had with PythonAnywhere and Vim. &lt;/p&gt;
&lt;p&gt;I also imagine that those intrepid Emacs users will be happy to be able to send all those torturous escape sequences as well. Bless them. &lt;/p&gt;
&lt;p&gt;Anyway, it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt="PythonAnywhere as a Google Chrome app!" src="http://www.pythonanywhere.com/static/anywhere/images/chrome-app.png" /&gt;&lt;/p&gt;
&lt;p&gt;Notice that all of Chrome's chrome is gone. It looks a bit like a native application. To get into this mode you have a couple of options. Firstly you can start chrome with the command line switch &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;"--app=https://www.pythonanywhere.com"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or, even easier you can create a desktop shortcut via Chrome itself. &lt;/p&gt;
&lt;p&gt;Simply &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit http://www.pythonanywhere.com&lt;/li&gt;
&lt;li&gt;Open the Chrome menu and select: Tools / Create Application Shortcuts...&lt;/li&gt;
&lt;li&gt;Tick the locations you want the short cuts to appear &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And there you have it. Now you can start an appified version of PythonAnywhere from your Start / Application menu and or desktop shortcut. &lt;/p&gt;
&lt;p&gt;Try it out, it's made vim in a PythonAnywhere console indistinguishable from using it in a local console for me. &lt;/p&gt;
&lt;p&gt;ps: If you are wondering what the hell that decorator is actually doing in the screenshot. It's something we use for testing. It's a decorator that decorates decorators and provides a set of the decorators used to decorate the function. It means we can easily assert that a function has been decorated by a particular decorator. Clear? &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hansel</dc:creator><pubDate>Fri, 19 Apr 2013 12:11:12 +0000</pubDate><guid>http://blog.pythonanywhere.com/63/</guid></item><item><title>Loads more packages, AsciiDoc, plus paginated forums, finally!</title><link>http://blog.pythonanywhere.com/62/</link><description>
&lt;p&gt;We've got several infrastructure stability + reliability improvements in this release, but more visible are some of the new binaries and packages.&lt;/p&gt;
&lt;p&gt;Someone (&lt;a href="https://www.tdd-django-tutorial.com/tutorial/6/"&gt;I wonder who?&lt;/a&gt;) demanded a whole &lt;a href="http://www.methods.co.nz/asciidoc/"&gt;AsciiDoc&lt;/a&gt; toolchain to be able to write books with.  Aside from that, you'll find:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pycurl.sourceforge.net/"&gt;pyCurl&lt;/a&gt;  (thanks jquacinella)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.python.org/pypi/pyquery"&gt;pyquery&lt;/a&gt; (thanks chnrxn)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/knowah/PyPDF2/"&gt;PyPDF2&lt;/a&gt; (thanks madsquint)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.python.org/pypi/pyUnRAR2"&gt;pyunrar2&lt;/a&gt; (thanks Brian)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.python.org/pypi/django-openid-auth/"&gt;django-openid-auth&lt;/a&gt; (thanks ferens_dima)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://epydoc.sourceforge.net/"&gt;epydoc&lt;/a&gt; (thanks mdipierro + rochacbruno)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/glamp/bashplotlib"&gt;bashplotlib&lt;/a&gt;  (we found that one ourselves - v cool!)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.python.org/pypi/census/"&gt;census&lt;/a&gt; (thanks Brett)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.google.com/p/sqlalchemy-migrate/"&gt;sqlalchemy-migrate&lt;/a&gt; (thanks )&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.python.org/pypi/Whoosh/"&gt;Whoosh&lt;/a&gt; and &lt;a href="https://github.com/gyllstromk/Flask-WhooshAlchemy"&gt;flask-whooshalchemy&lt;/a&gt; (thanks )&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You'll also find Twitter's &lt;a href="https://npmjs.org/package/bower"&gt;Bower&lt;/a&gt; browser / front-end web-dev package management tool.&lt;/p&gt;
&lt;p&gt;Other minor fixes include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fixing an issue with restricted internet access in SSH&lt;/li&gt;
&lt;li&gt;the "reload" button for web apps is now clearly labeled with the domain it reloads&lt;/li&gt;
&lt;li&gt;Trailing spaces no longer break static files mappings&lt;/li&gt;
&lt;li&gt;And the &lt;a href="https://www.pythonanywhere.com/forums/"&gt;forums&lt;/a&gt; are finally paginated!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let us know if everything looks OK!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Thu, 21 Mar 2013 13:38:05 +0000</pubDate><guid>http://blog.pythonanywhere.com/62/</guid></item><item><title>How do I serve static files using django &amp; PythonAnywhere?</title><link>http://blog.pythonanywhere.com/60/</link><description>
&lt;p&gt;Static files are the bits of your web site/application that are not created on the fly by Python. They might be images you want to embed, css files for styling, or even a PDF that you want people to be able to download. &lt;/p&gt;
&lt;p&gt;If you use &lt;a href="https://www.pythonanywhere.com/details/django_hosting"&gt;PythonAnywhere's Django quickstart &lt;/a&gt; then we already provide some sensible defaults which will get things working without you having to do anything. If however you are migrating an existing site or want to set things up manually then I will walk you through the process.&lt;/p&gt;
&lt;p&gt;Out of the box Django needs static files for the admin interface. If you visit www.yoursite.com/admin and it doesn't have any styling then this is the problem. Django looks for these static files at www.yoursite.com/static/admin. So under the web tab of your PythonAnywhere dashboard you need to select the tab for your site and add your first entry for static files.&lt;/p&gt;
&lt;p&gt;The url should be:&lt;code&gt;/static/admin/&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;The directory (or path) should be: &lt;code&gt;/usr/local/lib/python2.7/site-packages/django/contrib/admin/media&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next you probably want to serve some css or images out of a folder called static in your project folder. If your username was &lt;code&gt;eliza&lt;/code&gt; and your Django project was called &lt;code&gt;suitcase&lt;/code&gt; the following setup would work for you.&lt;/p&gt;
&lt;p&gt;The url should be: &lt;code&gt;/static/&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;The directory (or path) should be: &lt;code&gt;/home/eliza/suitcase/static&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;You resulting static files settings should now look something like this. Of course your username and project name should be different. That's the "eliza" and "suitcase" part of the path. &lt;/p&gt;
&lt;p&gt;&lt;img alt="PythonAnywhere static files" src="/static/images/static-files-for-eliza-suitcase.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Any sub folders are also searched. So you could put your css files in a folder at &lt;code&gt;/home/eliza/suitcase/static/css&lt;/code&gt; and a visitor going to &lt;code&gt;http://www.yoursite.com/static/css/my.css&lt;/code&gt; would be sent the file &lt;code&gt;/home/eliza/suitcase/static/css/my.css&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As always, remember that you will need to reload your web app before these changes actually take affect. &lt;/p&gt;
&lt;p&gt;Happy Pythoning.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hansel</dc:creator><pubDate>Fri, 01 Mar 2013 15:56:17 +0000</pubDate><guid>http://blog.pythonanywhere.com/60/</guid></item><item><title>New release - fileserver fixes and a couple of tweaks</title><link>http://blog.pythonanywhere.com/59/</link><description>
&lt;p&gt;&lt;img alt="London sunrise by A nosa disco necesítanos, on Flickr" src="https://farm3.staticflickr.com/2148/5767790714_e6c2f55f63.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Giles and I are just winding down following our early morning deploy -- it was a 3AM start for the two of us.  Our best case was 20 minutes of downtime, our worst case prediction was about 3.5 hours.  We came in at just under an hour and a half in the end.  Definitely glad we did it so early in the morning.&lt;/p&gt;
&lt;p&gt;The main reason for the deploy was an infrastructure upgrade, the fileserver has been upgraded from Debian to Ubuntu.  It's been in testing for 3 weeks, and it should fix an intermittent issue with user quotas.  Will follow up with more highly nerdy technical detail about XFS and NFS, later.&lt;/p&gt;
&lt;p&gt;We still managed to slip in a couple of tiny improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;envsubst&lt;/code&gt; now works in chroot jails, which was otherwise causing some worrying messages for anyone trying a &lt;code&gt;git rebase&lt;/code&gt;.  But, to be honest, &lt;a href="http://tartley.com/?p=1267"&gt;git rebase is terrifying&lt;/a&gt; at the best of times.&lt;/li&gt;
&lt;li&gt;a small bugfix to the &lt;a href="http://blog.pythonanywhere.com/56/"&gt;PythonAnywhere static files UI&lt;/a&gt;, where users with multiple webapps had duplicate "Add new entry" elements&lt;/li&gt;
&lt;li&gt;And a fix to our &lt;a href="http://bottlepy.org/"&gt;Bottle.py&lt;/a&gt; quick-deploy wizard, which means templates now work out of the box&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anyone else had some fun with early starts recently?  I don't think Giles even went to bed to be honest...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Image credit: &lt;a href="http://www.flickr.com/photos/xabiercid/5767790714/"&gt;London sunrise by A nosa disco necesítanos, on Flickr&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Thu, 28 Feb 2013 05:22:53 +0000</pubDate><guid>http://blog.pythonanywhere.com/59/</guid></item><item><title>The Python trademark in Europe</title><link>http://blog.pythonanywhere.com/58/</link><description>
&lt;p&gt;Last Thursday, &lt;a href="http://pyfound.blogspot.ca/2013/02/python-trademark-at-risk-in-europe-we.html"&gt;the Python Software Foundation announced&lt;/a&gt; that a UK-based company had applied for the exclusive European-wide trademark on the word Python as applied to software, web hosting, computer services, and so on.&lt;/p&gt;
&lt;p&gt;Obviously we're a little concerned about this, and we recommend that anyone else who's using Python in a business in the EU should go to the PSF post linked above and see if there's anything they can do to help.&lt;/p&gt;
&lt;p&gt;The company who's applied for the trademark (whose name is surprisingly hard to track down, but we'll call them POBox Hosting) provide a fairly standard kind of VPS solution, which they call "Python cloud servers".  These servers may or may not contain Python-the-language as part of their setup, but it's also fairly obvious that support for Python-the-language is not a major selling point for them, and isn't the reason for their use of the name "Python".  Instead, it looks like they chose that name because from time to time they'd used it for various other products in the past.  They've owned the domain python.co.uk for at least the last ten years.&lt;/p&gt;
&lt;p&gt;There are two ways in which their trademark is problematic.  &lt;/p&gt;
&lt;p&gt;Firstly, it is likely to confuse people -- it's easy to imagine someone hearing about Python the language, getting a "Python cloud server", and then wondering where all this great stuff they've heard about is.  This could be a huge problem for the Python community as a whole -- if lots of people are using your trademark for reasons unrelated to the mark, then it is weakened and comes to mean almost nothing.  The PSF have rules about how the Python trademark can be used, and they have to enforce them to make sure that "Python" in a computer software context continues to have a specific meaning.  (As an aside, we use "Python" in our company name and elsewhere by agreement of the PSF; they're fine with it because (a) we asked and (b) it is "a permitted nominative use unlikely to cause confusion".)&lt;/p&gt;
&lt;p&gt;Secondly, and much more immediately worryingly for us at PythonAnywhere -- and for any other EU-based business based around Python -- is the exclusivity of the trademark.  Imagine if we had to describe what we did without using the word "Python"?  "SomethingAnywhere is a development and hosting environment for a programming language that we can't name, that displays in your web browser and runs on our servers." Changing the company's name would be the least of our problems.&lt;/p&gt;
&lt;p&gt;So, we strongly agree with the PSF's opposition to this trademark application.  In the world of computing, "Python" invariably means Python-the-language.  Any other use is confusing, and exclusive trademark on it to mean anything else would be extremely harmful to the Python community.  &lt;/p&gt;
&lt;p&gt;Just for anyone who's interested in a little more detail, here's the letter we sent the PSF expressing our support, which hopefully will be of use to them in their opposition to the trademark.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;To whom it may concern,&lt;/p&gt;
&lt;p&gt;We are writing to oppose the application by POBox Hosting for a trademark for the use of
the word “Python” as it relates to computer software, servers and web hosting, CTM
application number 010848208. In the computing world, the word “Python” is
overwhelmingly used to refer to the Python programming language, and any other
interpretation is hard to credit in that context.&lt;/p&gt;
&lt;p&gt;We are PythonAnywhere LLP, a company based in the United Kingdom, offering computer
software, servers and web hosting services worldwide to programmers who use the
Python programming language. We use the word “Python” in our company name and
when describing our products under license from the Python Software Foundation.
A service that provides a “Python” service that is not specifically designed to incorporate
the Python programming language harms our business by causing confusion amongst
customers. An exclusive mark that prevented us from using the word “Python” to describe
our business would essentially make us and other similar companies unable to operate in
the EU.&lt;/p&gt;
&lt;p&gt;Some background: the PythonAnywhere service was created by a company called
Resolver Systems Ltd, which was founded in 2005, and it was acquired by
PythonAnywhere LLP in a corporate restructure in late 2012 (the people are still the
same). Members of the team behind Resolver Systems and PythonAnywhere first heard
of the Python programming language in 1997, and have used it professionally in the
European Union since that time.&lt;/p&gt;
&lt;p&gt;When we founded Resolver Systems, our aim was to create a new, highly programmable
spreadsheet. The Python programming language was the obvious choice for this, and
when we released our first product, Resolver One, in 2007, we marketed it as “the
Pythonic spreadsheet”. It has been downloaded by approximately 50,000 people
worldwide, and approximately 40% of sales were in the EU.&lt;/p&gt;
&lt;p&gt;PythonAnywhere, which we announced in March 2011, is a website where programmers
who use the Python programming language can easily work on programming projects and
host websites without needing to leave their web browser or install software. The
customer signs up, clicks a button, and starts typing Python programs in their browser. All
server management, maintenance and, for web developers, scalability, is handled by the
system. This is extremely useful for Python developers, trainers and educators (we are
used by a number of university courses), and for people developing and hosting their own
Internet services and websites.&lt;/p&gt;
&lt;p&gt;Since PythonAnywhere's launch, it has been visited by over 174,000 people worldwide,
approximately 35% of whom are in the European Union. Around 15,000 of the people who
have visited the site have registered to use it – again, about 35% of these are from the
European Union.&lt;/p&gt;
&lt;p&gt;We believe that when people look for “Python web hosting” or similar terms, they are
looking for services like ours and like those of our competitors – that is, they are looking for
a service that specialises in providing web hosting (or software, or servers) for people who
use the Python programming language. On that basis we believe that POBox Hosting's
“Python” product is confusing to consumers of Web hosting and software, and any
trademark they gained over the term would damage the Web hosting sector in the EU as a
whole.&lt;/p&gt;
&lt;p&gt;It is worth noting that the Wikipedia page for the word “Python”, in English, French,
German and Dutch, offers the Python programming language as one of the top possible
meanings, but does not refer to POBox Hosting or their products. The Spanish, Italian,
and Portuguese pages for the word Python are all specifically about the Python
programming language. In the minds of Wikipedia's editors (which, the site being editable
by anyone, is a good approximation to the minds of each language's speakers) Python in
the context of computers clearly refers to the Python programming language. The
customers for Web/Internet hosting and related services are computer specialists, and will
therefore be confused by a trademark that does not relate to this language.&lt;/p&gt;
&lt;p&gt;Furthermore, if web hosting and related companies that provide services that help
developers who use the Python programming language specifically are prevented from
using the word “Python” to describe their services by the applied-for trademark, they will
be unable to operate.&lt;/p&gt;
&lt;p&gt;A situation where a company who use Python in a sense different to the computing world
at large have the exclusive right to use Python in the EU is clearly untenable.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Mon, 18 Feb 2013 15:19:57 +0000</pubDate><guid>http://blog.pythonanywhere.com/58/</guid></item><item><title>A kickstarter book project</title><link>http://blog.pythonanywhere.com/57/</link><description>
&lt;p&gt;We're proud to be sponsoring some of the rewards for Michael Herman's Kickstarter book project: &lt;a href="http://kck.st/VQj8hq"&gt;Real Python for Web Development, featuring web2py&lt;/a&gt;.  Michael has a great plan and solid experience, and web2py creator Massimo Di Pierro and Fletcher Heisler, the author of &lt;a href="http://www.kickstarter.com/projects/fletcher/practical-python-learn-programming-for-the-real-wo"&gt;Real Python&lt;/a&gt;, are helping out as co-editors.&lt;/p&gt;
&lt;p&gt;Michael's blown through his initial funding goal, raising $2,500 in less than 24 hours -- so now he's got some stretch goals.  If he raises $10,000 then the book will also cover Flask (a widely-requested extra).  And if it gets up to $15,000 or even $20,000, he'll add something else -- and he wants suggestions as to what.  So even if you don't want to help fund the project, &lt;a href="http://kck.st/VQj8hq"&gt;why not get involved and suggest something&lt;/a&gt;?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Thu, 07 Feb 2013 17:48:31 +0000</pubDate><guid>http://blog.pythonanywhere.com/57/</guid></item><item><title>Static files -- finally!</title><link>http://blog.pythonanywhere.com/56/</link><description>
&lt;p&gt;The big news for this release is proper static files support.  Until now users either had to serve files via Python, using their web app framework, or use an undocumented and unsupported feature of hacking things into &lt;code&gt;/var/www/static&lt;/code&gt;.  Slightly embarassing.&lt;/p&gt;
&lt;p&gt;So, we're pleased to present to you our first attempt at proper support for static files.  Check out the &lt;a href="https://www.pythonanywhere.com/web_app_setup/"&gt;Web Tab&lt;/a&gt;, and you'll find a new section allowing you to map URLs to folders in your patch -- these can be anywhere you like, they don't have to be in /var/www.&lt;/p&gt;
&lt;p&gt;Let us know how you like it!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screenshot of static files UI" src="/static/images/static_files.png" /&gt;&lt;/p&gt;
&lt;p&gt;Bonus, secret update -- check out the editor.  If you don't see anything new, that's probably good news, but if you do notice anything, it's probably a little warning message from &lt;strong&gt;PyFlakes&lt;/strong&gt;, which should automatically detect some potential problems with your Python code, like syntax errors, unused imports and so on.  Hope you find it helpful!  (we all use it).&lt;/p&gt;
&lt;p&gt;Thanks to everyone that's been chasing us to get static files in, including njr, x, econpy, kgullion, sterling312 and little_dood.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Thu, 07 Feb 2013 12:15:08 +0000</pubDate><guid>http://blog.pythonanywhere.com/56/</guid></item><item><title>Outage report; or, the perils of using 502s to trigger web application initialisation</title><link>http://blog.pythonanywhere.com/55/</link><description>
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.  &lt;/p&gt;
&lt;p&gt;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.  &lt;/p&gt;
&lt;p&gt;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.  &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;h2&gt;nginx 50x errors&lt;/h2&gt;
&lt;p&gt;Our web servers run &lt;a href="http://nginx.org/"&gt;nginx&lt;/a&gt; as a front-end server.  It delegates web requests to &lt;a href="http://projects.unbit.it/uwsgi/"&gt;uwsgi&lt;/a&gt; instances that actually run the Python web applications.  These requests are channeled between nginx and uwsgi via Unix domain sockets; each web application has a socket that is accessible both from outside our users' sandboxes (where the nginx server runs) and inside (where the uwsgi apps that serve each user's website live).&lt;/p&gt;
&lt;p&gt;When a request comes in but the associated uwsgi server has a problem there are a number of possible errors.  Firstly, the uwsgi app might be up and running, accept the incoming request, but then crash or take an unreasonably long time to process it.  This leads to an error number 504, "Gateway timeout".  This is what we normally expect to happen when a user's web app is under too much load to handle incoming requests.  Another happens when the user's web app is just not up and running, so when nginx tries to put the request onto the socket for uwsgi, it can't.  This causes a 502 "Bad gateway" error.  &lt;/p&gt;
&lt;p&gt;What we hadn't realised, or at least fully appreciated, is that there's a second kind of situation where you can get a 502 error.  It's possible for a uwsgi server to be up and running, but so overloaded that from nginx's perspective it looks like it's down.  These cause 502 errors too.  &lt;/p&gt;
&lt;p&gt;In this last case, you get an nginx error like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2013/01/31 15:15:42 [error] 4919#0: *1947447 connect() to unix:/var/sockets/www.example.com/socket failed (11: Resource temporarily unavailable) while connecting to upstream, client: XXX.XXX.XXX.XXX, server: www.example.com, request: "GET /something HTTP/1.1", upstream: "uwsgi://unix:/var/sockets/www.example.com/socket:", host: "www.example.com", referrer: "https://www.example.com/"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, if you google for that error you'll see lots of hints suggesting you increase the nginx &lt;code&gt;proxy_connect_timeout&lt;/code&gt; setting, or the Linux &lt;code&gt;net.core.netdev_max_backlog&lt;/code&gt; or &lt;code&gt;net.core.somaxconn&lt;/code&gt; values.  These can possibly help; essentially if the error is being caused by a very short-term spike in traffic, those changes will help smooth it out by letting more stuff queue up on the connection between the uwsgi server and nginx.  But if the uwsgi server is just getting so much traffic that there's no way it can handle it, all changing the settings will do is make the queue take longer to fill up and cause the problem.&lt;/p&gt;
&lt;h2&gt;How we manage user web applications&lt;/h2&gt;
&lt;p&gt;Right, so by now it's probably pretty clear that the outage was caused by heavy traffic overloading a uwsgi server somewhere.  But how did that take out our site?  &lt;/p&gt;
&lt;p&gt;Well, the problem is in how we start web applications.  Each of our web servers can potentially be responsible for hundreds of web apps.  We do not start uwsgi handlers for all of them when the server comes up, as this would bring the machine to its knees.  So what we do is start them on demand; when a request comes in for a web application that isn't running, we detect that it's not running and use an "internal redirect" to push the request over to a part of the main PythonAnywhere web application that starts it up, then does another redirect back so that the requester sees the right page.  Here's the nginx config for that:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;server {

    listen      80;
    server_name  ~(?&amp;lt;domain&amp;gt;.+)$;
    location / {
        # various bits of config here, elided for clarity

        # if you get a 502 error, go to "fallback".
        error_page 502 = @fallback;
    }
    location @fallback {
        # In the fallback triggered by a 502, restart the user's web app.
        # FOR THE LOVE OF GOD, DON'T DO THIS!
        proxy_pass https://www.pythonanywhere.com/run_initialize_web_application_code/$scheme/$domain/$uri?$query_string;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sharp-eyed readers have probably worked out the problem by now.  We were relying on the 502 "Bad gateway" errors to identify unstarted web applications; we'd assumed that unresponsive ones would always give us a 504 "Gateway timeout".  This was a mistake.  The customer website that was getting all of the traffic was causing 502s; and this meant that our setup was constantly telling the main PythonAnywhere app to restart the associated uswgi server.  This was happening on the same server as handles our own site, dozens of times a second -- which, of course, meant that our site went down.  &lt;/p&gt;
&lt;h2&gt;Lessons learned&lt;/h2&gt;
&lt;p&gt;The main lesson we've learned here is that we cannot use 502 errors to decide whether or not a user's uwsgi server is up and running.  We'll blog about the fix for that later.  &lt;/p&gt;
&lt;p&gt;Another thing we may well look at is moving the "start a user's web application" code out of the main PythonAnywhere app.  This would mean that even if our fix doesn't work in every case, it will not take down our site and the many people who use PythonAnywhere for running and developing non-web Python code in the cloud will be blissfully unaware of the problem.&lt;/p&gt;
&lt;p&gt;So, any thoughts from our readers here?  Is there anything we're missing in this analysis?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[UPDATE, 1 Feb 2013 @ 17:36]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We've now tested and pushed what we think is a solid fix.&lt;/p&gt;
&lt;p&gt;Some background first.  The uwsgi processes on a given server are all managed for us by a uwsgi master application.  If a "vassal" file is is present for a web application (in &lt;code&gt;/etc/uwsgi/vassals&lt;/code&gt;) then the application will be started by the uwsgi master, and if the web application crashes then the uwsgi master can be trusted to see this and re-start it.&lt;/p&gt;
&lt;p&gt;So that means that we only need to start a user's web app if it gives a 502 error and there is &lt;em&gt;no&lt;/em&gt; vassal file for it.  If it gives a 502 and there &lt;em&gt;is&lt;/em&gt; a vassal file, then the web app can be assumed to be running but having problems. &lt;/p&gt;
&lt;p&gt;Which in turn means that all we needed to do was put a check in our nginx configuration to check for the vassal file, and only do the internal redirect to start the app if the vassal file isn't there.  If the vassal file is there, it can just raise a 502 error as normal.  The config looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;server {

    listen      80;
    server_name  ~(?&amp;lt;domain&amp;gt;.+)$;
    location / {
        # various bits of config here, elided for clarity

        # if you get a 502 error, go to "fallback".
        error_page 502 = @fallback;
    }
    location @fallback {
        # In the fallback triggered by a 502, restart the user's web app
        # if and only if there is no vassal file for it.
        if (-f /etc/uwsgi/vassals/$domain.ini) {
            return 502;
        }
        proxy_pass https://www.pythonanywhere.com/run_initialize_web_application_code/$scheme/$domain/$uri?$query_string;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Again, any thoughts much appreciated!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Fri, 01 Feb 2013 11:22:19 +0000</pubDate><guid>http://blog.pythonanywhere.com/55/</guid></item><item><title>New release :-)</title><link>http://blog.pythonanywhere.com/54/</link><description>
&lt;p&gt;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!).&lt;/p&gt;
&lt;p&gt;The new stuff is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We've upgraded our Python 3 version from 3.2 to 3.3.&lt;/li&gt;
&lt;li&gt;Bugfix: if you quick-start a web2py app in a directory that is not ~/web2py, the admin password will now be correctly set.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks to all of the people who suggested these fixes, including  marladarla7, pigeonflight, pwoolcoc, gebloom, djfinton, chanin, markstocks,  jpic, ezamr, and Kernie_xvid, &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Mon, 28 Jan 2013 13:45:17 +0000</pubDate><guid>http://blog.pythonanywhere.com/54/</guid></item><item><title>Outages over the weekend</title><link>http://blog.pythonanywhere.com/53/</link><description>
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;We're investigating the problem and will post again with an update.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Mon, 28 Jan 2013 10:33:14 +0000</pubDate><guid>http://blog.pythonanywhere.com/53/</guid></item><item><title>New release - more console stability improvements, unicode fix</title><link>http://blog.pythonanywhere.com/52/</link><description>
&lt;p&gt;Today's new release features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I'm counting chickens here, but  we &lt;em&gt;may&lt;/em&gt; 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&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Improvements to load-balancing between console servers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;and finally, a bugfix that was causing errors in "Reload Web app".&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;Keep in touch!&lt;/p&gt;
&lt;p&gt;Harry + the PythonAnywhere team.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Wed, 09 Jan 2013 13:56:52 +0000</pubDate><guid>http://blog.pythonanywhere.com/52/</guid></item><item><title>WEBAPP ALL THE THINGS!</title><link>http://blog.pythonanywhere.com/51/</link><description>
&lt;p&gt;&lt;img alt="Map of the internet" src="/static/images/internet_map.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Well, it's been weeks and weeks and weeks, but we've finally (finally) managed to get a version of &lt;strong&gt;MULTIPLE WEBAPPS&lt;/strong&gt; out.&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is it working OK?  Can you break it?  What should we improve?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Head on over to your &lt;strong&gt;&lt;a href="https://www.pythonanywhere.com/web_app_setup/"&gt;Web Tab&lt;/a&gt;&lt;/strong&gt; and take a look.  You'll spot your web apps listed on the left - at this point, if you're a Hosting user (which we're now calling &lt;em&gt;Web Developer&lt;/em&gt;) you'll probably have two: one for your &lt;code&gt;&amp;lt;username&amp;gt;.pythonanywhere.com&lt;/code&gt; subdomain, and one for your own domain.&lt;/p&gt;
&lt;p&gt;These are now totally independent, so you can delete your subdomain app if you want to, or replace it with something else.  You can also start adding any other domains you own, using a little wizard we've built (with much sweating and cursing at JavaScript I might add).&lt;/p&gt;
&lt;p&gt;Also, what do you think of &lt;a href="https://www.pythonanywhere.com/pricing/"&gt;our new pricing table&lt;/a&gt;?  Do you think we've got the balance of features right, esp. re storage space + number of web apps?  What do you think of our new account names (warning: only the answer "super-cool" will be accepted as valid feedback to that last.).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[image credit -- &lt;a href="https://secure.flickr.com/photos/jurvetson/916142"&gt;"map of the Internet" by Steve Jurveston&lt;/a&gt;]&lt;/em&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Thu, 20 Dec 2012 15:14:59 +0000</pubDate><guid>http://blog.pythonanywhere.com/51/</guid></item><item><title>Calling all LaTeX experts...</title><link>http://blog.pythonanywhere.com/50/</link><description>
&lt;p&gt;&lt;img alt="LaTeX Lion" src="/static/images/latex_lion.PNG" /&gt; &lt;/p&gt;
&lt;p&gt;We've just released a new version of &lt;a href="http://www.pythonanywhere.com/"&gt;PythonAnywhere&lt;/a&gt; which features a full suite of LaTex executables, available for you to run, in a browser, in our Bash consoles.&lt;/p&gt;
&lt;p&gt;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!".&lt;/p&gt;
&lt;p&gt;So, perhaps it's of use to other people out there, even outside the world of Python?  If you're a big LaTeX user, come check it out.  Just sign up for a free account, start a &lt;strong&gt;Bash &lt;/strong&gt;console and see what you can do.  You can use dropbox, github or just a simple upload (in the &lt;strong&gt;Files&lt;/strong&gt; menu) to get your documents uploaded.&lt;/p&gt;
&lt;p&gt;We've basically installed a combination of the Debian &lt;a href="https://www.tug.org/texlive/"&gt;texlive&lt;/a&gt; and &lt;a href="http://pages.cs.wisc.edu/~ghost/"&gt;ghostscript&lt;/a&gt; packages.  If you're a Python fan, there are a few libraries to help as well, like &lt;a href="https://www.tug.org/applications/pdftex/"&gt;texcaller&lt;/a&gt; and &lt;a href="https://www.tug.org/applications/pdftex/"&gt;pdflatex&lt;/a&gt; which you may find useful too.&lt;/p&gt;
&lt;p&gt;We crave feedback like prehistoric mammals crave an asteroid, so keep it coming!&lt;/p&gt;
&lt;p&gt;Love,
the PythonAnywhere team.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Fri, 07 Dec 2012 12:22:57 +0000</pubDate><guid>http://blog.pythonanywhere.com/50/</guid></item><item><title>Faster file creation and saving </title><link>http://blog.pythonanywhere.com/49/</link><description>
&lt;p&gt;Hi all, &lt;/p&gt;
&lt;p&gt;We deployed a new version this morning. The visible changes are&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;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&lt;/li&gt;
&lt;li&gt;The Python mimetypes module now works correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Progress on multiple web apps is looking good. We are rewriting the last couple of 'Quickstarts' right now.&lt;/p&gt;
&lt;p&gt;Cheers  &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hansel</dc:creator><pubDate>Wed, 28 Nov 2012 12:23:41 +0000</pubDate><guid>http://blog.pythonanywhere.com/49/</guid></item><item><title>Even-even-fasterer file browsing and editing, woo</title><link>http://blog.pythonanywhere.com/48/</link><description>
&lt;p&gt;We've just released a new version with some more improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;browsing files a tad faster&lt;/li&gt;
&lt;li&gt;opening files for viewing + editing &lt;em&gt;much&lt;/em&gt; faster&lt;/li&gt;
&lt;li&gt;saving files still slow&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We've also added a few packages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://orange.biolab.si/"&gt;Orange&lt;/a&gt; (thanks menemosyne1212)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://packages.python.org/flask-mail/"&gt;flask-mail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://hg-git.github.com/"&gt;Hg-Git&lt;/a&gt; (thanks kitsu_eb)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sites.google.com/site/pydatalog/"&gt;PyDataLog&lt;/a&gt; (thanks Pierre)&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;s3cmd&lt;/a&gt; (thanks basketcase)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Keep your feedback and suggestions coming!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Wed, 21 Nov 2012 12:16:10 +0000</pubDate><guid>http://blog.pythonanywhere.com/48/</guid></item><item><title>Faster file viewing</title><link>http://blog.pythonanywhere.com/47/</link><description>
&lt;p&gt;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 &lt;em&gt;much&lt;/em&gt; quicker.  &lt;/p&gt;
&lt;p&gt;Some background: in the older version of PythonAnywhere, every time you browsed a directory, 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.&lt;/p&gt;
&lt;p&gt;There have also been a couple of minor tweaks: &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;ping&lt;/code&gt; 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).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Mon, 19 Nov 2012 14:08:48 +0000</pubDate><guid>http://blog.pythonanywhere.com/47/</guid></item><item><title>New release - a first crack at scaling issues</title><link>http://blog.pythonanywhere.com/46/</link><description>
&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;As many of you know, we've been having some &lt;a href="https://blog.pythonanywhere.com/45/"&gt;scaling issues&lt;/a&gt; in the last week or so.  This new release is our first crack at addressing them.&lt;/p&gt;
&lt;p&gt;Here's what we've managed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;running scheduled tasks on a different server type from consoles&lt;/li&gt;
&lt;li&gt;implement more async / batch job processing of, eg, quota updates using &lt;a href="http://kr.github.com/beanstalkd/"&gt;beanstalk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;optimise our console launchers and file browser views to remove blocking calls to &lt;a href="http://packages.debian.org/sid/cgroup-bin"&gt;cgroups binaries&lt;/a&gt; (these seemed to be real processor hogs)&lt;/li&gt;
&lt;li&gt;more load balancing in uwsgi, including max limits on memory usage (1/2 a gig per worker) and request time (10 minutes)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It's been a fairly hectic couple of weeks!  We're very conscious of unacceptable performance, since we use PythonAnywhere every day - in fact, there's a bit of a Catch-22, since PythonAnywhere being slow slows down our development of fixes to that slowness...  Anyways, we've got there in the end, and we look forward to seeing how those improvements pan out.  We're keeping a close eye on things for the next few days!&lt;/p&gt;
&lt;p&gt;Lots of stuff still to do - we're half-way through some more major speedups to the file browser, and we've got lots more planned.  And, of course, we're looking forward to getting back to work on the multiple-web-apps / Pro plans, which are tantalisingly 90% finished -- so we've only got the remaining 90% to do ;-)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">harry</dc:creator><pubDate>Fri, 09 Nov 2012 13:39:04 +0000</pubDate><guid>http://blog.pythonanywhere.com/46/</guid></item><item><title>Performance issues: What the problem is and what we are doing about it</title><link>http://blog.pythonanywhere.com/45/</link><description>
&lt;p&gt;Over the last couple of months our users have been noticing increasing performance issues. I think the most noticeable one is browsing directories and viewing files. Though the other problem is a slow down of console performance. &lt;/p&gt;
&lt;p&gt;The file browser is currently slow because it launches a new user process which is chrooted and then inspects a user's files. This made for very easy and simple security and when a server is under light load it was actually quite quick. Under heavy load it grinds to a halt. Process start times balloon making file operations take forever for the user.&lt;/p&gt;
&lt;p&gt;We are currently rewriting the code so that it no longer launches a sub-process. As of today we are about halfway through the total rewrite and plan on releasing it in stages once each segment passes through our testing loop. &lt;/p&gt;
&lt;p&gt;The other main performance issue are slow consoles. By this I mean slow start times and laggy response to typing. Part of this problem is that scheduled tasks are run on the same server type as consoles. Scheduled tasks are very spiky so we've split those out to their own server type. Something that will help with latency while also making it easier to scale horizontally.&lt;/p&gt;
&lt;p&gt;The slow start times for consoles is related to the file browser problem. Starting a console would launch a number of sub-processes to perform some admin tasks before actually launching the Python or Bash process. We've rewritten these functions so that this doesn't happen. We should be able to release these fixes soon as they are currently in testing. &lt;/p&gt;
&lt;p&gt;Thanks to everyone for bearing with us, we appreciate the support. Fixing the performance problems have been our top priority and we will not stop working on it until it's fast for everyone. &lt;/p&gt;
&lt;p&gt;All the best &lt;/p&gt;
&lt;p&gt;From the PythonAnywhere team &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hansel</dc:creator><pubDate>Tue, 06 Nov 2012 12:00:56 +0000</pubDate><guid>http://blog.pythonanywhere.com/45/</guid></item><item><title>New minor release</title><link>http://blog.pythonanywhere.com/44/</link><description>
&lt;p&gt;We've just upgraded PythonAnywhere with a bunch of stability fixes.  One nice new thing: if you create a new web2py app, you'll get version 2.0.9 -- and even better, the build-in "upgrade" button in the web2py admin view now works -- just click it, click OK, then once it's done, use the "Reload web app" button on the Web tab of your PythonAnywhere dashboard.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">giles</dc:creator><pubDate>Fri, 26 Oct 2012 11:45:31 +0000</pubDate><guid>http://blog.pythonanywhere.com/44/</guid></item></channel></rss>