Zed Shaw's latest project - Fret War (fretwar.com)
Fret War is a guitar competition site where contestants try to defeat lesser guitarists in weekly rounds playing randomly generated music. Awards are given each week for interpretation, accuracy, speed, and uniqueness.
39 comments
[ 3.2 ms ] story [ 95.1 ms ] threadhttp://zedshaw.com/blog/2009-11-6.html
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.
What do you like and dislike about web.py?
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.
I tried, and I couldn't find anything asshole-ish about the bug report. It looks like good work to me.
Now, the question is why do you demand humility from me, but not from them?
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).
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.
http://fretwar.com/static/data/round/1/media/xzibitonics_C.m...
This was on purpose to act as a sort of implicit "invite only" mechanism. It kind of worked a bit too well.
The next round will be more "jamming" oriented and open ended so more people can play.
:-)
By the way, why is it required to have a twitter account ?