1

I have a chat aplication in java nio package. i want to test the capacity of server. I run my server application and client program is runing through a batch file. so that at time i can run any number of client. when 268 client application is runs RAM stops the process. Ram didnt have suffient memory to execute the next client.

Is there any way that processor use hard disk memmory when Ram is full ?? not java heap space

am using Windows 7 Prof 32 bit, 4 gp ram,i5 processor

Amith
  • 1,907
  • 5
  • 29
  • 48
  • Why do you need to support 20k connections? – casablanca Jul 24 '12 at 05:56
  • @casablanca i want to create a server which support atleast 20k client. (atleast 20k client can communicate at a time) So i want to test my server. – Amith Jul 24 '12 at 06:19
  • My question was why you want to do this -- why do all 20k clients need to communicate with a single server? A cluster of servers would be more practical. – casablanca Jul 24 '12 at 06:35
  • @casablanca may be but i want to know the capacity of this server. i just want to know how many client can communicate with server at a time. i need to create cluster of server for that pupose i need to know the capacity of server. – Amith Jul 24 '12 at 07:01
  • @casablanca. A modern server Can easily handle that. Why make it more complex than needed? – Thorbjørn Ravn Andersen Jul 24 '12 at 08:26
  • Note that 268 connections are very few. You most likely have not yet trimmed the data needed for each connection – Thorbjørn Ravn Andersen Jul 24 '12 at 08:27
  • @ Thorbjørn Ravn Andersen i run each 250 client from 3 system server supports 750 client. my problem is when 250 clients run on a PC its Ram gets filled and it will not execute the next client. i just want to know how many client can communicate with server – Amith Jul 24 '12 at 08:38
  • @ThorbjørnRavnAndersen: I agree that 268 is very little, but 20k may not be "easy" depending on what the server is doing. Which is why I was asking what the application is about. – casablanca Jul 24 '12 at 15:38
  • @amith use a profiler like jvisualvm to find out why – Thorbjørn Ravn Andersen Jul 24 '12 at 17:09

2 Answers2

1

I have recently tried a more humble experiment with 2000 MySQL threaded clients.
And I'm afraid you gonna hit a number of walls.
First of all, you gonna have a java 2GB heap size limit. You should consider going to a 64-bit JVM. See Maximum Java heap size of a 32-bit JVM on a 64-bit OS
Then, Windows 7 32 bit doesn't handle more than 3.12GB of RAM. You should consider a 64-bit OS
Moreover, the OS won't let you open 20k sockets at first. Check MaxUserPort in the registry.
If you pass through all this, it may be time to consider CPU allocation which, under 2k threads and your i5, shouldn't be a problem. But I don't know for 20k ...

Community
  • 1
  • 1
0

For your load test, you should separate the server and the client.

Run the server and only that on your machine. Use other(s) computer(s) to run the clients.

This will avoid you this kind of issue and will be much more realistic. You will never have 20k clients and a server running the same machine :)

You will also be able to monitor the performance of the server w/o having the client interferences on your computer as your resources will be dedicated to your server.

BTW, in w7, there the turboram that allows you to plug an usb dongle to extend the RAM of your computer. This could help you.

M.

poussma
  • 7,033
  • 3
  • 43
  • 68
  • i seperated the server and client. Server is running in PC 1 and Client is Running in PC 1 and PC 2. But both Client machine have the same problem. – Amith Jul 24 '12 at 06:58
  • Have you tweak the command line you use when you run your java application to allocate more or less RAM to the process? Do you run you 268 client in one java program or do you launch 268 java process? – poussma Jul 24 '12 at 06:59
  • 268 java process. i run this 268 java process from a single java program using Batch file. – Amith Jul 24 '12 at 07:05
  • hum, strange to reach the RAM limit with only 250 processes... did you change the java memory configuration ? (with -Xmx parameters)? – poussma Jul 24 '12 at 07:11
  • Then give a look to such document: http://java.sun.com/performance/reference/whitepapers/tuning.html#section4.1.2 It explains how / why to tune your JVM, increase the memory dedicated to the JVM, the `-Xmx4096m`parameter to allocate the whole memory... There are also dozen of questions on SO. BTW, be aware of the x86 limitations. see @Olivier answer – poussma Jul 24 '12 at 07:49