Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate LLTHW Web App to Asynchronous Server #11

Open
thephoeron opened this issue Oct 11, 2014 · 5 comments
Open

Migrate LLTHW Web App to Asynchronous Server #11

thephoeron opened this issue Oct 11, 2014 · 5 comments

Comments

@thephoeron
Copy link
Owner

The user experience for LLTHW could be vastly improved with an asynchronous web application; currently the application runs on Hunchentoot—a thread-per-request server—which is inherently greedy in terms of system resources. While useful for web applications that need to validate and process arbitrary user data in an isolated environment, LLTHW only needs to serve up content. An asynchronous web application will thus be able to maximize available system resources and provide a faster, stabler experience for all users even under the heaviest traffic spikes (such as the Hacker News fiasco this past July), and buffer against DDoS attacks.

This will also allow for a more sensible use of 3bmd to provide live-updated content, without specifically re-parsing each Markdown document for each user on request; only one copy of each parsed Markdown document needs to live in memory, which can be accessed sanely by all clients. As such this ties in with issue #3 to reduce application memory usage.

The most mature Common Lisp asynchronous server and web application framework appears to be Wookie. It is still in Beta, but it seems to be worthy of production use-cases, such as the official Wookie documentation, and the Turtl platform.

Alternative suggestions are welcome.

@priyadarshan
Copy link

woo could also be a possibility? https://github.com/fukamachi/woo/

@thephoeron
Copy link
Owner Author

Yeah, I've been looking at Woo and I think it might be a better choice; the switch to the new libuv backend on CL-ASYNC has tripped me up on a few projects, and caused me trouble at work. Woo is still listed as "alpha-quality", but the performance is looking good. It will be worthwhile to spool up a demo of LLTHW running on woo---and since it's the holidays I might even have time to do that this week!

@priyadarshan
Copy link

Neat, I can't wait to see the demo!

Thank you so much for llthw. It is extremely helpful.

@priyadarshan
Copy link

By the way, this simple thread was quite helpful in clarifying to me the differences between woo, wookie et al. https://www.reddit.com/r/lisp/comments/2ofkfh/newbie_writing_a_small_lisp_program_for_work/cmn06l4

@thephoeron
Copy link
Owner Author

Alright, reading over the source code for Woo---and it looks like I can get up and running with a dispatcher app function, same as Clack, and the request handler functions simply need to return a list of status code, content-type, and body of the response. Shouldn't take too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants