Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Server

Name: Anonymous 2012-07-06 19:07

I recently wrote a simple auth server in Common Lisp which basically uses `select' then parses all incoming connections.

It's single threaded, how well will it hold up against say 1000 people, etc?

Name: Anonymous 2012-07-06 19:15

Name: Anonymous 2012-07-06 19:16

>>1
how well will it hold up against say 1000 people, etc?
About 1/2 or 1/3 of the GCC speed, depending on your code.

Name: Anonymous 2012-07-06 19:33

>>3
you mean two or three times GCC speed?

Name: Anonymous 2012-07-06 21:21

>>2
Well i know about bordeaux-threads, however, what i should be asking is what's a better solution to my networking?

Currently as i said, i'm one thread for both getting connections and then parsing their data sent (TCP btw)

I hear that 1 thread per connection doesn't scale well once you get a lot of users.

Would it be better to have a separate IO thread (or 2 for writing and reading) and a parsing thread?

Name: Anonymous 2012-07-06 21:57

You could use:
1. One thread for accepting new connections and placing them on a connection/request queue.
2. One thread to pop connections from the above queue and assign them to worker threads, if available
3. N worker threads that process data and when I/O or CGI scripting is needed they end their work and put the request again in the same request pile, this time with status information that specifies where work stopped before.

IOCP is a good model, you can check it out here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365198%28v=vs.85%29.aspx
Though your implementations won't be as efficient as the M$ IOCP one for some kernel optimizations, Linux is lacking on this area...
And for CGI you may want to check out the FastCGI solution.

Name: Anonymous 2012-07-07 9:12

authism

Name: Anonymous 2012-07-07 11:38

>>6
That's not the best paradigm, it has cache locality issues.

Name: Anonymous 2012-07-07 13:00

>>8
This makes me wonder why are asynchronous callbacks so used. To me they just scream like bad design.
Interrupt handlers should be as small as possible for cache locality reasons but callbacks effectively extend them!

Name: 9 2012-07-07 13:31

Use this 1-san:
— One thread per core or more when being DDoSed.
— Each thread has a vector of non-blocking (a.k.a. asynchronous) sockets.
— Threads iterate on the vector and process a socket when it is ready. Basically you're emulating select but in a more efficient way.

Name: Anonymous 2012-07-07 21:57

dubs check em

Name: Anonymous 2012-07-08 1:46

>>11
nice dubs

Name: Anonymous 2012-07-08 6:53

http://www.aosabook.org/en/nginx.html

Seems a little bullshitty though

Name: Anonymous 2012-07-08 7:13

I recently wrote

how well will it hold up against say 1000 people

Why don't you simply measure that?

Name: Anonymous 2012-07-08 8:58

>>13
4chan uses it.

Name: Anonymous 2012-07-09 19:54

>>15
And 4chan is shit, point proven

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List