Hi Larry,
> 1) In the on-request(.) routine, where you're searching for the next
> available client, this loop could take quite long - the higher the
> load, the longer it could take. Why not add a stack to hold available
> clients (just their index)?
it could be optimized - but looping through a thousand integers is
extremely fast. it's definitely not the number one thing in ebb that
needs to be fixed now :)
> 2) A question about keep-alive. What happens if the browser requests
> keep-alive, but then the user never sends another request? I know
> there are timeouts and such, but I didn't specifically see anywhere
> you close an open/in-use client socket if there is no request for a
> certain period.
for keep-alive connections, user-agents close connections after
they're done with them. otherwise it times out.
> 3) Along the lines of 2), if a client socket is waiting for more read
> data or another write buffer, and it doesn't get it for some time, can
> you timeout and close the socket (send some sort of error back to the
> user)?
this happens. i think the default is 30 seconds.
The timeout can be changed with EBB_TIMEOUT in src/ebb.h
> 4) It would be really nice if ebb supported some sort of simple in-
> memory caching. I know lots of people use memcached, but that is kind
> of a heavyweight solution in my mind - lots of copying across process
> boundaries.
yes, this would be very useful. I'd rather keep ebb simple and focused
on socket processing, but it can be used a general library in which
one could implement such a thing.
Off Topic Advertisement: I'm working on a caching server - which does
require copying across processes - but is a bit more web-oriented than
memcached. It is slightly more than key/value data storage:
http://github.com/ry/caching-service/tree/master
ry