• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Websphere getting slow

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the size of your session bean pool?
Kyle
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you read the section on performance tuning in the InfoCenter?
Kyle
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,
I have not read the section on performance tuning .Sir where can i locate this info center ?
Siddharth K
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp
 
reply
    Bookmark Topic Watch Topic
  • New Topic