github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

vii / teepeedee2

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 100
    • 6
  • Source
  • Commits
  • Network (6)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Fast webserver for dynamic pages — Read more

  cancel

http://cliki.net/teepeedee2

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

correctly url-encoding-decode things again 
vii (author)
Mon Jan 11 10:23:37 -0800 2010
commit  e3cbb15e4efad4668e4894cad05cd6106c1ad3d4
tree    3605ab34c122ea79b604a034707d43aeb1c370b6
parent  88a0a63a9a4f5a8d7df3c1f8ab614f2cde34aab3
teepeedee2 / README.markdown README.markdown
100644 120 lines (78 sloc) 3.338 kb
edit raw blame history

teepeedee2

Homepage

See http://common-lisp.net/projects/teepeedee2.

What's this?

teepeedee2 is a webapplication framework for dynamic webpages. It's goal is to be fast. It only works on Linux.

Quickstart

You need SBCL. On Ubuntu or Debian

$ sudo apt-get install sbcl

Untar or git clone

  $ git clone git://github.com/vii/teepeedee2.git

  $ cd teepeedee2

Start sbcl and run the quickstart.lisp

  $ sbcl --load quickstart.lisp

This will download the following packages with asdf-install, and their dependencies: iterate cffi cl-irregsexp trivial-backtrace

Note that it DISABLES the GPG signature checking! You will be running UNVERIFIED CODE.

      It will try to download the following packages with 
      Install where?
      1) System-wide install: 
         System in /usr/lib/sbcl/site-systems/
         Files in /usr/lib/sbcl/site/ 
      2) Personal installation: 
         System in /home/username/.sbcl/systems/
         Files in /home/username/.sbcl/site/ 
       --> 

Enter "2" and press enter.

Lots of downloading and compiling will occur.

Then visit http://localhost:8080/hello

You can now enter new pages at the SBCL REPL

* (in-package #:teepeedee2.quickstart)

* (defpage "/goodbye" ((name "Friend"))
        (<div (<h1 "Bye bye " name) (<p "The universal time is " (get-universal-time))))

Benchmarking

(in-package #:tpd2)
(defpage "/test" (name) :create-frame nil
    (tpd2.ml.html:<h1 "Hello " name))

(http-start-server 8080)

(event-loop)

Use apachebench

$ ab -n 100000 -c10 http://127.0.0.1:8080/test?name=John

More info

This webserver is not finished and I wrote it to learn and experiment with Common Lisp. There is a lot to be tidied up, now I know the language better. If you have any interest in using it, please get in touch with me, John Fremlin john@freml.in, or http://john.fremlin.org/contact.html

It is faster than all(?) other web application frameworks for serving small dynamic webpages. Please let me know if you have a case where another framework is faster!

You can see benchmarks comparing it to other web application platforms like PHP and Rails in this presentation http://tlug.jp/meetings/2008/11/serving-dynamic-webpages-in-less-then-a-millisecond_john-fremlin_handout.pdf

You can see an example of it running a blog on http://john.freml.in.

It is designed so that small fragments of JavaScript can be delivered at low overhead to many clients.

However, it also includes general support libraries for quickly generating XML/HTML (tpd2.ml2), for doing fast networking in a continuation passing style, i.e. fast event driven userspace threading (tpd2.io).

Note that it trusts the last value of X-Forwarded-For.

For an example application, loaded by default, see the src/game directory.

The addons/ directory contains a few of the other projects (but not all) that teepeedee2 depends on. They are released under their own licence.

The licence for most of tpd2 is the Lisp LGPL. However, I take no profit from making this, and request that if you make an application with it, please release the source so others can learn from it. Don't be selfish!

It runs on SBCL and ClozureCL. It shouldn't be hard to port to other modern Common Lisps.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server