The attachment is that I implement SimpleWeb in C#,
I am new to C#,just learned it in a few weeks.So this
Implemention is dirty and Simple,not Clear.But It Can
You can download .net framework and run csc *.cs
Logged In: NO
This could be pretty cool. I had intended to begin a c#
implementation of Simple but havent had the time. By the way
is the source contained within the .rar file or is this like
a .jar with just the .class files?
Yes,it contained the source.
I am currently working on the design.
I had finded that the server is not quick response to client's
refresh.I think there is some way to avoid this.
To improve the performace,we can send daba to client with
the non-blocking socket.I think this is the best way.
Logged In: YES
I test the SimpleWeb using Qaload.
After More than 400 Simultaneous Users ，
A mass of the errors ("unable to connect to server")
arise.It is because that the server is too busy, so
the thread which accepts the connection havn't no
cup time.I has no proper mothed to solve the problem,
unfortunatly.Can you help me?
Simple can never get overloaded, it uses a vector to store
Sockets and a prioritizing mechanism to poll Sockets from
that vector.The only limitation is the number of file
descriptors the operating system will allow and the amount
of memory allocated to the JVM.
In my opinion your problem is caused by either,
1) A small connection backlog for the ServerSocket
2) The activity of the connected sockets
3) The number of file descriptors allowed by Windows 2000
It is most likely (1) so I recommend that you set the
backlog to a higher amound in the ServerSocket and also
spawn several connection threads as follows.
ServerSocket sock = new ServerSocket(80);
Connection.connect(sock); // one thread
Connection.connect(sock); // two threads
Connection.connect(sock); // three threads
P.S Let me know if this solved your problem.
A higher amound in the ServerSocket cann't solve the
I had tyied to set the ServerSocket's Thread as the
maximum priority,and controlled the processor which dequeue
pollers from the PulseSckeduler.The SimpleWeb achieved the
higher throughput and the error is avoided.
P.S the attachment is the modified source file
I see now what your problem is. To achieve a similar result
without modifying the source you can set the polling maximum
interval to a higher count, which will mean that polling is
less intrusive. Try
ProtocolHandler h = // ...
PipelineHandler p = PipelineHandlerFactory(h, 5, 5000);
Connection c = ConnectionFactory.getConnection(p);
This will half the number of pollers and increase the CPU
cycles spent on polling inactive connections.
Sorry,I cann't express myself exactly in english.
I had tried it,and tested again.Error ratio is sharp down
actually, but not good enough yet.If i set the ServerSocket's
thread as the maximum priority,the error is avoided
completely.Will this modification result in blight?