Skip to main content

Performancetests Client-Server

1 reply [Last post]
Joined: 2010-07-10

Hi there,

i implemented a server with sockets. Each connected client gets its own thread on the server. The server is executing queries and answering with the result to the client.

So i run a stresstest like the following:

query: for $n in 1 to 1000000 return lastnumber...
so the server is counting to 1000000 an returns 1000000

The problem ist, when i run 1 client it needs 0,141192231 sec to execute
the query.
When i run 1000 clients it needs 135,732144 sec total, so i divide
that with 1000 and get 0,135732... sec for one client.

The testing computer is a 3.4 ghz dualcore with 1 GB ram.

How is it possible that a client is faster when there a more clients?
Any thoughts on that would be great...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-01-07

1. The java virtual machine optimizes code that has been run for a few times
2. A thread can run on a cpu-core, so if you have >= threads than cores, they can run simultaneously.

After all multi-threading is quite a complicated topic, its easy to create errors which only occur very seldom, or on specific machines. Take care ;)

- Clemens