Browse Source

increase read block size to 128 KB

1.0.0
Georg Hopp 11 years ago
parent
commit
b7d8300295
  1. 3
      include/tr/comm_end_point.h
  2. 2
      src/connector.c
  3. 10
      testers/testclient.sh

3
include/tr/comm_end_point.h

@ -33,7 +33,8 @@
* Read ahead limits. * Read ahead limits.
* These values should be conficurable in the future. * These values should be conficurable in the future.
*/ */
#define CEP_WRITE_BUFFER_THRESHOLD 128 * 1024
#define CEP_WRITE_BUFFER_THRESHOLD 512 * 1024
#define CEP_DEFAULT_READ_SIZE 128 * 1024
TR_CLASS(TR_CommEndPoint) { TR_CLASS(TR_CommEndPoint) {
TR_EXTENDS(TR_EventSubject); TR_EXTENDS(TR_EventSubject);

2
src/connector.c

@ -65,7 +65,7 @@ connectorAccept(void * _this, TR_Event event)
TR_Connection, TR_Connection,
socket, socket,
connection->protocol, connection->protocol,
8192);
CEP_DEFAULT_READ_SIZE);
TR_eventHandlerIssueEvent( TR_eventHandlerIssueEvent(
(TR_EventHandler)this, (TR_EventHandler)this,
TR_eventSubjectEmit( TR_eventSubjectEmit(

10
testers/testclient.sh

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
BS=8192
COUNT=1000000
CONCURENT=20
IP="localhost"
BS=$((128*1024))
COUNT=10000
CONCURENT=200
IP="192.168.2.13"
pids="" pids=""
i=0 i=0
@ -12,7 +12,7 @@ MESSAGE="GET / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n"
while [ $i -lt ${CONCURENT} ] while [ $i -lt ${CONCURENT} ]
do do
dd if=/dev/zero bs=${BS} count=${COUNT} | nc -q 1 ${IP} 5678 >/dev/null & dd if=/dev/zero bs=${BS} count=${COUNT} | nc -q 1 ${IP} 5678 >/dev/null &
#echo -en "${MESSAGE}" | nc -q 1 -u ${IP} 5678 &
#echo -en "${MESSAGE}" | nc -q 1 ${IP} 5678 &
pids="${pids} $!" pids="${pids} $!"
i=$((i + 1)) i=$((i + 1))

Loading…
Cancel
Save