0

Sorry for the length of this, but more info is usually better than not enough...

I needed to add some server based functionality to an Android application which I have in the market. Majority of my past experience has been working with .Net web services and MSSQL, however as Android uses Eclipse & Java I decided to create this web service using similar technologies.

By using some various tutorials, I've developed a (bottom up) web service using axis2 & mySQL and it's communicating quite happily on a local instance on Tomcat7.

Deployment of the war file seems rather simple, however I'm wondering if there is anything special I need to do considering the load it's expected to handle.

The application currently has about 500,000 users each of which may make a request to the server, let's say roughly every 30 seconds. So this would currently be the heaviest traffic expected.

The web service performs a select query on the sql database, does some calculations and then sends back a response - there is no writing being done to the database at all. The expected response time is about 1-10 seconds, dependent on the complexity of the calculation.

I honestly have no idea on the load capabilities of Tomcat, Java Web Service, or mySQL and some Google searching for the answers turned up nothing. But this is probably more due to the fact I didn't know exactly what to look for based on my lack of experience.

Basically I'm looking to find out if the above scenario should be handled just fine by a single instance of Tomcat, webservice and mySQL - or whether additional steps should be taken. At this point, I've no idea whether I'm well below the capabilities and don't even need to be concerned, or if I've made a bad decision moving forward this way.

So, if anyone is able to answer this query, or can just point me in the direction of where I can research this better myself, it'd be greatly appreciated.

Thanks in advance.

Jon
  • 3
  • 1
  • Are your requests cacheable? I suppose that's the most important question to ask yourself. A lot of caching solutions do not depend on the underlying stack. – Rom1 Jun 07 '11 at 14:32
  • No. Every request is going to be different, I don't think there's any way to implement a caching solution. I had considered loading the mySQL table into memory on startup - but this is over 200,000 records, whereas the select statement can filter this down per the request requirements. – Jon Jun 07 '11 at 14:45

1 Answers1

0

A good start would be to load test your web service to see how much it can handle before errors and performance suffer. You can use a tool like SoapUI for that. The SoapUI tool allows for Testing suites which can be setup to load test the web service with varying parameters. SoapUI is not limited to Java, and can be used on almost any web service.

If you find that the server can not handle the expected load then you have a few options

  • Throw more hardware at it
  • Tweak your queries to ensure the web service call finishes in the fastest time possible
  • Profile the application to look for memory and performance bottlenecks
  • Put a cache layer (See Ehcache) in front of your DB to speed up the reads.
Sean
  • 7,597
  • 1
  • 24
  • 26
  • I was planning on load testing by using some beta testers as well as doing a staged roll out to try to identify problems before everything fell apart in a screaming heap "doing it live". SoapUI looks like a great solution for me to find the answers I need, seeing as there is probably no definitive answer someone can give. Thanks for your help, I'll see what other answers come up, but think I'll be marking this as the best solution. – Jon Jun 07 '11 at 15:08
  • You will want to take a look at the max amount of threads tomcat will spawn at a time. I believe the default is 200. Once you have more requests then the max amount of threads then you will have users backed up and waiting. Find your sweet spot using a load testing tool – Sean Jun 07 '11 at 15:11
  • That's more of an answer I was expecting to see (and hoping to avoid). By "default" it sounds like I might be able to increase it, being a dedicated server, so I'll see how the load testing goes and look into it more from there. I think my algorithms are as optimised as possible, at least for my IQ, but a quick read about ehcache seems it may be good a solution to avoid all the db calls wasting time & memory should I find a problem. – Jon Jun 07 '11 at 15:24