5 ms·
author here: Java part: 1. Java NIO's performance is amazing: event driven r/w bytes 2. maintain state machine when parsing HTTP from bytes buffer need many loc
by shenedu 14y ago
author here:
Java part:
1. Java NIO's performance is amazing: event driven r/w bytes
2. maintain state machine when parsing HTTP from bytes buffer need many local variables, I get used to do it in a C style code.
Clojure:
I like this language. It's brilliant. So I write a fast http server/client for it. Clojure is also write in JAVA, great interoperation
- nqzero 14y agocan the http-kit server be used from java directly ? last i looked, all the async java webservers seemed limited to 1000s of connections, which largely defeats the purpose. i'm willing to give up the servlet spec if needed
- shenedu 14y agoHey, http-kit can be used to from java directly: https://github.com/http-kit/http-kit/blob/master/test/java/org/httpkit/server/MultiThreadHttpServerTest.java https://github.com/http-kit/http-kit/blob/master/test/java/o... Not recommended! The API is very lowlevel. Maybe you can try to tweak the max allowed open file to a larger value. The default is about 1024, that how you just get 1000(I guess). Jetty is quite good at concurrency, you can double check it. Why not try Clojure? Your web dev's productivity increase by few times instantly.
- nqzero 14y agolooks good. my application (database-ish) is in java and i haven't worked on any bindings yet. just trying to put together a demo that shows off the concurrency