WSGI makes us faster, simpler, nicer!

September 20, 2007

We’ve been working for a long time on getting certain infrastructural things fixed. For example, did you know up until now we’ve been running on CGI? As we posted before, the original plan was to get Trac running on a cluster of tracd’s, much like the cluster of Mongrel’s we use for the Rails part of DevjaVu.

Just think about that. At our simplest setup, we’d have 2 Mongrel processes and 2 tracd processes. Plus we have to run Apache for Subversion given our setup. But wait, then we have this load balanced across several machines! With every machine we add, we’d get another set of these processes to worry about.

I was okay with Mongrels, but really, I was a bit upset coming from PHP about how much more I had to worry about to make sure the application was running. With mod_php you can just assume that if Apache is up, the app is up. With Rails and any FCGI or Mongrel-like setup, there were now two layers, one of which is usually a cluster of processes that could die or leak memory.

So recently we started writing a new application to replace our Rails part of DevjaVu. We’re writing it in Pylons, which is really nice and Rails-like, while still very Pythonic. This led us to mod_wsgi, which boasted faster performance than mod_python, and was even easier to configure. We tried our new app on our dev server with mod_wsgi and it was very nice. Then I realized Trac had WSGI support, so I tried Trac on mod_wsgi. Perfect!

After a few changes, DevjaVu production is now running Trac on mod_wsgi. Pages are loading almost twice as fast! Our setup is simpler, too. Once we replace our Rails app with the Pylons app, we can run everything with Apache. We’re stuck with Apache for a while anyway, so why not roll everything in? Faster. Simpler.

And we can finally have nice URLs for real! Let me explain:

Before, we had to have URLs like this:
http://myproject.devjavu.com/projects/myproject/wiki

That was redundant, long and ugly. We were able to rewrite our ideal shorter URLs to the longer version, so you could use URLs like this: http://myproject.devjavu.com/wiki

However, that was just a cosmetic rewrite and Trac would always generate the long URLs.

Now, Trac generates the short URLs all the time and the short URLs are the proper, non-rewritten way Apache serves the request. We have the long versions that you probably have posted around the web do a permanent redirect to the short ones. This way you can still use them, but you should update your links at some point since they are now deprecated.

Anyway, that was fun. Hope you enjoy the changes. We have a lot more coming up. Let us know if you run into problems.

-Jeff

18 Responses to “WSGI makes us faster, simpler, nicer!”

  1. Boris Masis Says:

    Hi guys, thats great news about the faster performance! Question though, looks like DevjaVu has been down for several hours in the morning for the last couple days. Is that upgrade related? Any news?

  2. Jeff Lindsay Says:

    Yes, there’s been some conflicts with our recent upgrades and Engine Yard’s setup, so we’re working with them to resolve this.

  3. Mike Says:

    Jeff,

    The infrastructure upgrade sounds awesome! I actually just emigrated from Rails back to PHP (in part because of endless deployment issues), and I was curious–aside from the reason for your choosing Pylons/WSGI (which presumably is because it is Rails-like), had you gone with, say, PHP, would you have seen comparable performance or is mod_wsgi faster?

    Thanks!

  4. Jeff Lindsay Says:

    Well one other reason we went with Pylons/WSGI for our custom app and site is because Trac is already Python, so if WSGI served both we’d simplify everything down to mod_wsgi.

    I’m not sure I can compare PHP (mod_php I assume) to mod_wsgi, but since they’re both designed around the same concept, they’d be comparable in speed other than the interpreter run-time speed difference, which I can’t imagine is all that different.

  5. Albert Lash Says:

    Hello,

    Devjavu looks cool, I found you via Sycamore, which I became interested in after using Trac for a few weeks and am really digging it. I’m a huge fan of Apache, it has is minor flaws so many benefits. With the new mod_dbd and mod_rewrite stuff that’s in the works, its going to get better and better. Good luck with this new service!

    Albert

  6. vkyp jiunfas Says:

    lnderg akgxuich uqzmwdyh xpalmd jrdecfn btmpg lknpcd

  7. parzufim.com Says:

    viagra cialis levitra clomid buy viagra onli generic viagra http://www.parzufim.com cipro gay viagra buy viagra online cheap viagra
    free viagra
    herbal viagra
    propecia xenical viagra side effects buy viagra zithromax lasix female viagra cream cheapest cialis http://www.parzufim.com

  8. NexiumMan Says:

    Nexium decreases the amount of acid produced in the paunch and buy nexium, nexium from. Nexium is against to study symptoms of gastroesophageal reflux cancer (GERD) and other conditions involving enormous tummy acid such as Zollinger-Ellison syndrome. Nexium is also against to elevate healing of erosive esophagitis (invoice to your eso
    phagus tolerant of by tummy acid). Nexium may also be prearranged to slow gastric inflammation caold by infection with helicobacter pylori (H. pylori), or by the use of nonsteroidal anti-fiery drugs (NSAIDs).

  9. xangamanns Says:

    Dialect heft-trouncing debits medications should eternally be combined with a program of fine fettle eating and proportional mortal activity buy rimonabant now. So plumpness is a dyed in the wool illness that affects divers people. To throw arrange and profancy arrange imponce againishment above the wish stipulations, it is inebriated-priority to transform one’s abstain and agree in invariable mortal activity. Some people, how, may press for extensional treatment. As with other confirmed conditions, such as diabetes or great blood oppression, the use of direction medications may be right for some people who are once againarrange or obese.

  10. Qwofegtz Says:

    How many weeks’ holiday a year are there? kiddy lotia kkskhd

  11. Bxdqxnov Says:

    A financial advisor lolita porn
    fahyfg

  12. Vckkalnw Says:

    I didn’t go to university Pthc Cum =DD

  13. Lcycqyzy Says:

    Hold the line, please Lola Bbs 8)))

  14. Kiapseqe Says:

    I’m doing a phd in chemistry Ls Models Galleries %)

  15. Tpueijxq Says:

    What’s the interest rate on this account? http://eriegafa.de.tl bbs tgp links What can we say? Realism score: high. Interest factor: low. So they’re fucking outside. OK. He’s a wannbe gangsta and she’s a wannbe pornstar, but they both move like surly naive teenagers. It would be different if you walked around the corner and caught this happening, but the motivation is poor, and neither of the performers could probably elaborate on what makes hot sex hot. Not a lot of dynamic range in performance, camera work, blocking or mise en scene.

  16. Vuotawee Says:

    I hate shopping http://unenuigic.de.tl vlsdmodels I love big dicks. I might not be able to take them but I love them and this white chick took it like a rider.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: