wood burning stoves 2.0*
The moose likes Websphere and the fly likes Websphere getting slow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Websphere getting slow" Watch "Websphere getting slow" New topic
Author

Websphere getting slow

Steve Grant
Ranch Hand

Joined: Nov 24, 2003
Posts: 106
Dear Sir,
I am doing performance testing of my stateless session ejb which calls a VFSIOService class . This class writes the file to the hard disk. I am using JunitPerf as a performance testing tool. I am simulating 50 concurrent users thorugh my JunitPerf code .Each user is uploading the file of 3MB size. Following is the JunitPerfCode :
public class JunitPerformanceTest {
public static Test suite() {

long maxTimeInMillis = 60000;

int concurrentUsers = 50;

Test test = new VfsEjbPerformanceTest("testAddFile");

Test timedTest = new TimedTest(test, maxTimeInMillis);

Test loadTest = new LoadTest(timedTest, concurrentUsers);

return loadTest;
}
public static void main(String args[]) {
junit.textui.TestRunner.run(suite());
}
}
Following is my addFile method in VFSIOService class which does the File wtiting to the hard disk and is called by VFSFacadeBean.
public void addFile(FileTO fileTO) throws VFSException
{
//create the file object from absolute path
File file = null;
File fileParentPath = null;
BufferedOutputStream bout = null;
file = new File(fileTO.getAbsolutePath());

//get the parent path of the file
fileParentPath = new File(file.getParent());

//check parent path exists
if (fileParentPath.exists() == false)
{
//create directories
boolean flag = fileParentPath.mkdirs();
// if(log.isDebugEnabled())
//log.debug(flag+"");
}

try
{
// Check the vault type
if (fileTO.getVaultType() == StorageTypeConst.TYPE_SECURE)
{
//get the security facade home
SecurityFacadeHome securityServiceHome = (SecurityFacadeHome)
ServiceLocator.getHome(JNDIConst.JNDI_SECURITYFACADE_HOME,
SecurityFacadeHome.class);

//get the remote reference
SecurityFacade securityServiceremote = securityServiceHome.create();

// call the encode method
securityServiceremote.encode(fileTO);

}
else if (fileTO.getVaultType() ==
StorageTypeConst.TYPE_REGULAR)
{
// create buffered output stream to the file
bout = new BufferedOutputStream(new
FileOutputStream(file),BYTE_SIZE);

//write the bytes to the file
bout.write(fileTO.getFileBytes(),
START_OFFSET,fileTO.getFileBytes().length);

}
else
{
//delete the above created folder
fileParentPath.delete();

// throw exception for invalid valut type
throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);

}
}
catch(ServiceLocatorException exception)
{

throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}
catch(SecurityException exception)
{
throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}
catch(CreateException exception)
{
throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}
catch(FileNotFoundException exception)
{
throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}
catch(IOException exception)
{
// deleting the destination file
if(file != null)
file.delete();

throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}
finally
{
try{
if(bout != null)
bout.close();

fileTO = null;
}
catch(IOException exception)
{
// deleting the destination file
if(file != null)
file.delete();
throw new VFSException(ExceptionMsg.VFS.FILE_CREATION_ERROR);
}

}
}
Now this method is called by my ejb VFSFacadeBean.
The problem is that when I try to upload files of 50 users with each file size 3MB the websphere server becomes slow and the time taken to upload the file of every user goes very high (on average 12 to 15 min for each user).
When I try to upload file of a single user with file size 3 MB the time taken is 2 secs. Is there any setting for stateless session bean which has to be done in WebSphere . And why is my response time increasing for 50 users.My machine configuration are 512MB Ram and CPU P4 1.6GHZ


SCJP1.4<br />IBM Certified System Administrator -- WebSphere Application Server V5.0 (340)
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
What's the size of your session bean pool?
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Steve Grant
Ranch Hand

Joined: Nov 24, 2003
Posts: 106
Dear Sir,
I have not set any size for session bean in websphere and I dont know how to set it. Sir plzz give me information about how to set the size of stateless session bean in websphere.I am using websphere 5.0
Thanks & regards,
Siddharth K
[ December 08, 2003: Message edited by: Siddharth Kirad ]
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Have you read the section on performance tuning in the InfoCenter?
Kyle
Steve Grant
Ranch Hand

Joined: Nov 24, 2003
Posts: 106
Dear Sir,
I have not read the section on performance tuning .Sir where can i locate this info center ?
Siddharth K
Nurat Lamos
Ranch Hand

Joined: Jan 03, 2003
Posts: 30
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Websphere getting slow
 
Similar Threads
Ejb Performance testing tool
Websphere session bean pool size
IO Performance
Ejb Performance testing tool
IO Performance