News for hackers. Stuff that matters.
Re:Zed Shaw's latest project - Fret War by zedshaw on Friday November 06, 2009 @05:45PM (#927128)
Nope, not rails (troll). It's a web.py application combined with a Lamson application. The frontend is run through nginx and I use some heavy caching tricks to make it fast as possible.

The primary design for hosting costs (scalability) are:

1) http://wiki.nginx.org/NginxHttpAdditionModule to serve static headers and footers so the framework doesn't.

2) Javascript determines the login state of a user and then displays user state links.

3) Generation of the site is "out of order" for convenience of generation/caching, and then javascript knits it back together. We'll explore more of this later.

4) Caching for about 5 minutes on most pages, depending on usage.

5) Use of http://wiki.nginx.org/NginxHttpProxyModule#proxy_store to do page caching for content that needs to be dynamically generated very infrequently.

6) Gzip compression (should do precompression really) and other tuneups.

7) Using Lamson to accept posts via email so that they're processed off-line and statically generated. This is also really easy for people to use and easy to setup, so triple win.

It's currently not close to a production setup, but I'm going for making it easy to host on a small server to keep costs low. Part of that is just not using the framework when possible.

For statistics, right now the Nginx server is getting a modest 4-10 req/sec for html, but the backend is only serving about 1 request a minute thanks to all the above. Also the site really doesn't accept uploaded content via HTTP except say for photos.

Hope that helps, I may blog about it more later.

Re:Zed Shaw's latest project - Fret War by apu on Friday November 06, 2009 @06:28PM (#927193)
Wow, someone else using web.py, and that too for a "real" project! I always feel like a n00b for using such a stripped-down "framework" but after spending some time trying Pylons and Django, I found them both to be too "heavy-weight" for me.

What do you like and dislike about web.py?

Re:Zed Shaw's latest project - Fret War by zedshaw on Friday November 06, 2009 @07:23PM (#927289)
I like web.py for this because it's tiny, fits HTTP real well (try doing REST with Django), and it's "just a library" so it's easy to mesh with Lamson. Also, I was bored.

What I don't like about web.py is this:

https://bugs.launchpad.net/webpy/+bug/435370

I have to hack that fix in to every web.py install because they're too arrogant to actually fix it properly, even when given the fix.

Re:Zed Shaw's latest project - Fret War by jpeterson on Friday November 06, 2009 @09:45PM (#927404)
Zed, I know you mean well, but your wording in that bug report is extremely asshole-ish. Can't you point out flaws without being so snarky?
Re:Zed Shaw's latest project - Fret War by zedshaw on Saturday November 07, 2009 @01:32AM (#927599)
It's not asshole-ish at all, it was just direct and made the point much clearer with the proper amount of urgency. This bug crashes sites consistently and is easily exploited. That's serious enough to warrant an immediate fix and release with an apology for the design. That's what I've done on my projects, and that's what I expect.

Now, the question is why do you demand humility from me, but not from them?

Re:Zed Shaw's latest project - Fret War by jpeterson on Saturday November 07, 2009 @09:08PM (#928656)
Given the downvotes and the other comment here, it seems taht I'm in error, and I'll retract my statement. I guess I misread it; sorry about that.
Re:Zed Shaw's latest project - Fret War by idm on Saturday November 07, 2009 @01:02AM (#927573)
Seriously? A bug report that identifies a DOS condition gets flagged as "won't fix" -- and Zed's followup explains, with details, why it should be fixed, and what the fix should be.

I tried, and I couldn't find anything asshole-ish about the bug report. It looks like good work to me.

Re:Zed Shaw's latest project - Fret War by didip on Friday November 06, 2009 @10:44PM (#927451)
Hi Zed, did you roll your own session and caching library?

In the past, I've had a few problems with sessions on web.py, like AttributeError (Googling around, one of them is still there https://bugs.launchpad.net/webpy/+bug/204084).

Re:Zed Shaw's latest project - Fret War by zedshaw on Saturday November 07, 2009 @01:37AM (#927604)
We actually keep the sessions very light, and if I could I'd get rid of them entirely.

For caching I'm just using nginx and generating as much content to disk as possible. It is much simpler that way, and the goal is to keep things simple and cheap so I can bootstrap the site.