Web Application – Load Test for Millions of Users Hits – Simple Java Program

import java.io.BufferedReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Random;
import java.io.InputStreamReader;

public class URLRequest

public int totalRequests=0;

public void URLHit(int dataID)
try {
// Send data
URL url = new URL(“”+dataID);
System.out.print(“URL : “+url +” ID “+dataID);

URLConnection conn = url.openConnection();
/*OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));

String line;
String result=””;
//while ((line = rd.readLine()) != null) {
// Process line…
//result += line;
} catch (Exception e) {

public static void main(String args[])

Random generator = new Random(1000000 );
for(int i=0;i<=100000;i++)
int roll = generator.nextInt(1000000);
URLRequest ur = new URLRequest();


About ashokabhat

I am a C,C ,JAVA,Adobe Flex,.NET Programmer Currently working as a Software Developer
This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to Web Application – Load Test for Millions of Users Hits – Simple Java Program

  1. Ronald Fobbs says:

    Hi there! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s